Skip to content

Add a SignatureAlgorithm value to support the 'none' alg type. #7777

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
bjconlan opened this issue Dec 30, 2019 · 2 comments
Closed

Add a SignatureAlgorithm value to support the 'none' alg type. #7777

bjconlan opened this issue Dec 30, 2019 · 2 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@bjconlan
Copy link

bjconlan commented Dec 30, 2019

Summary

While inherently noted as bad practice (https://connect2id.com/products/nimbus-jose-jwt/vulnerabilities), the 'none' Jwk Algorithm sent by an authentication server should be supported as a SignatureAlgorithm. (This seems to be the case often in poorly configured or older ping federate/ping identity servers)

Currently there is no way to use the NimbusJwtDecoder builder class support this mechanism without implementing a JwtDecoder.

Actual Behavior

Currently only the limited subset of defined enumerable values is supported by the SignatureAlgorithm

Expected Behavior

a) A 'NONE' value is added to the SignatureAlgorithm enum.

b) NimbusJwtDecoder provides overloaded mechanisms for setting the jwsAlgorithm(s) which are inline with those supported by nimbus JOSE (or simply strings)

c) An explicit builder method on the NimbusJwtDecoder is provided to use 'none' as a supported jwsAlgorithm

Version

spring-security-oauth2-jose:5.2.1

Sample

...
  @Bean
  public JwtDecoder jwtDecoder(final ClientRegistrationRepository clientRegistrationRepository) {
    final ClientRegistration.ProviderDetails oauthProvider =
        clientRegistrationRepository.findByRegistrationId(securityProvider).getProviderDetails();
    return NimbusJwtDecoder
        .withJwkSetUri(oauthProvider.getJwkSetUri())
        .jwsAlgorithms(() -> Set.of(SignatureAlgorithm.RS256, SignatureAlgorithm.NONE))
        .build();
  }
...
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 30, 2019
@bjconlan
Copy link
Author

This could perhaps fall under #7269

@bjconlan
Copy link
Author

Actually after tracing the codepath this looks to just be a case of our auth servers being poorly implemented or setup. There shouldn't be a need for this if explicitly using signed jwt tokens (and falling back to plain tokens identifies something is incorrect when using JWK's. Closing.

@eleftherias eleftherias added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants