Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add security setting to more strictly enforce audience validation #622

Merged
merged 1 commit into from
Oct 14, 2021
Merged

Add security setting to more strictly enforce audience validation #622

merged 1 commit into from
Oct 14, 2021

Conversation

nholden
Copy link
Contributor

@nholden nholden commented Oct 12, 2021

Status

READY

Migrations

NO

Description

Per the SAML 2.0 Core specification, Section 2.5.1.4, a service provider should expect SAML responses to include an <AudienceRestriction> element containing an <Audience> element with a URI reference that uniquely identifies the service provider.

Ruby SAML contains logic to validate that responses contain an <Audience> element matching settings.sp_entity_id. However, if the <AudienceRestriction> contains only empty <Audience> elements, Ruby SAML skips that validation per #444. It seems incorrect that we'd consider a response with a non-empty <Audience> element not matching settings.sp_entity_id to be invalid, but we'd consider a response with an empty <Audience> element (which also wouldn't match settings.sp_entity_id) to be valid.

This PR adds a new security option that will consider SAML responses containing only empty <Audience> elements to be invalid. By default, this option is not enabled, so it should not be a breaking change.

@pitbulk pitbulk merged commit 74c2545 into SAML-Toolkits:master Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants