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

[CVE-2023-23612] Remove trimming of whitespace when extracting SAML backend roles #2381

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jan 6, 2023

Description

OpenSearch uses JWTs to store role claims obtained from the Identity Provider (IdP) when the authentication backend is SAML or OpenID Connect. There is an issue in how those claims are processed from the JWTs where the leading and trailing whitespace is trimmed, allowing users to potentially claim roles they are not assigned to if any role matches the whitespace-stripped version of the roles they are a member of.

This pull request remove trimming of whitespace when extracting SAML backend roles.

Testing

New unit test has been added to verify the functionality

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@cwperks cwperks requested a review from a team January 6, 2023 15:32
@cwperks cwperks added the backport 2.x backport to 2.x branch label Jan 6, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2023

Codecov Report

Merging #2381 (51364ad) into main (8ccad5c) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #2381      +/-   ##
============================================
- Coverage     61.10%   61.05%   -0.05%     
+ Complexity     3273     3269       -4     
============================================
  Files           260      260              
  Lines         18364    18362       -2     
  Branches       3250     3249       -1     
============================================
- Hits          11221    11211      -10     
- Misses         5558     5562       +4     
- Partials       1585     1589       +4     
Impacted Files Coverage Δ
...ic/auth/http/jwt/AbstractHTTPJwtAuthenticator.java 54.76% <ø> (-1.06%) ⬇️
...urity/ssl/transport/SecuritySSLNettyTransport.java 62.36% <0.00%> (-4.31%) ⬇️
...earch/security/ssl/util/SSLConnectionTestUtil.java 93.18% <0.00%> (-2.28%) ⬇️
.../dlic/auth/ldap2/LDAPConnectionFactoryFactory.java 57.46% <0.00%> (-1.50%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cwperks cwperks merged commit 8ee28d1 into opensearch-project:main Jan 6, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 6, 2023
peternied pushed a commit that referenced this pull request Jan 6, 2023
…) (#2383)

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit 8ee28d1)
@peternied
Copy link
Member

@cwperks Should this be backported to 1.x -> 1.3?

@peternied peternied changed the title Remove trimming of whitespace when extracting SAML backend roles [CVE-2023-23612] Remove trimming of whitespace when extracting SAML backend roles Jan 24, 2023
wuychn pushed a commit to ochprince/security that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants