Skip to content

ServerBearerTokenAuthenticationConverter validates parameters when not enabled #16038

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

Closed
sjohnr opened this issue Nov 4, 2024 · 1 comment
Closed
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue type: bug A general bug
Milestone

Comments

@sjohnr
Copy link
Member

sjohnr commented Nov 4, 2024

ServerBearerTokenAuthenticationConverter validates the query parameter access_token when allowUriQueryParameter is false. The spec states that

Resource servers MAY support this method.

for query string parameters, but does not indicate in the Error Codes section that the access_token parameter MUST be validated if the server doesn't support that particular method for resolving the token.

Note: This also applies to DefaultBearerTokenResolver, and includes when allowFormEncodedBodyParameter is set to false.

@sjohnr sjohnr added type: bug A general bug in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) labels Nov 4, 2024
@sjohnr sjohnr added this to the 6.2.x milestone Nov 4, 2024
@sjohnr sjohnr self-assigned this Nov 4, 2024
@sjohnr sjohnr changed the title ServerBearerTokenAuthenticationConverter validates query param when allowUriQueryParameter is false ServerBearerTokenAuthenticationConverter validates parameters when not enabled Nov 4, 2024
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 5, 2024
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 5, 2024
@jonah1und1
Copy link
Contributor

I created a PR for this, please feel free to review it.

jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 5, 2024
# Conflicts:
#	oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/web/DefaultBearerTokenResolver.java
#	oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/web/server/authentication/ServerBearerTokenAuthenticationConverter.java
#	oauth2/oauth2-resource-server/src/test/java/org/springframework/security/oauth2/server/resource/web/DefaultBearerTokenResolverTests.java
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 5, 2024
@sjohnr sjohnr assigned jonah1und1 and unassigned sjohnr Nov 5, 2024
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 6, 2024
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 6, 2024
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 6, 2024
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 6, 2024
jonah1und1 added a commit to jonah1und1/spring-security that referenced this issue Nov 6, 2024
@sjohnr sjohnr modified the milestones: 6.2.x, 6.3.9 Apr 7, 2025
@sjohnr sjohnr added the status: duplicate A duplicate of another issue label Apr 7, 2025
sjohnr pushed a commit that referenced this issue Apr 7, 2025
@sjohnr sjohnr closed this as completed in 3c0fef5 Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants