Skip to content

[GHSA-9pp5-9c7g-4r83] Spring Security authorization bypass for method security annotations on private methods#5747

Merged
advisory-database[bot] merged 1 commit intotomabai/advisory-improvement-5747from
tomabai-GHSA-9pp5-9c7g-4r83
Oct 15, 2025
Merged

[GHSA-9pp5-9c7g-4r83] Spring Security authorization bypass for method security annotations on private methods#5747
advisory-database[bot] merged 1 commit intotomabai/advisory-improvement-5747from
tomabai-GHSA-9pp5-9c7g-4r83

Conversation

@tomabai
Copy link

@tomabai tomabai commented Jun 24, 2025

Updates

  • Affected products
  • References

Comments
The vulnerability involves both spring-security-aspects and spring-security-core.
spring-security-aspects artifact is right to be flagged because the issue is only exploitable when that module (or @EnableMethodSecurity(mode = ASPECTJ)) is on the classpath.

On the other hand , the actual fix lives in spring-security-core, where the code that scans for security annotations is located. The patch changes a comparison from

if (method == candidate) { … }

to

if (method.equals(candidate)) { … }

Using equals() lets the scanner recognise the same method loaded by different class-loaders/AspectJ weaves, so the annotations are no longer skipped and the bypass is closed.

So to conclude, both packages should be flagged, also the fixing commit is in the core package which is anoth proof that this package is vulnerable. Moreover, to my understanding, if you use spring-security-core 6.4.5 and lower, even with the updated spring-security-aspects 6.4.6 you will still be vulnerable.

@github-actions github-actions bot changed the base branch from main to tomabai/advisory-improvement-5747 June 24, 2025 08:01
@helixplant
Copy link

Hi @tomabai, we are currently looking into this!

@tomabai
Copy link
Author

tomabai commented Jul 2, 2025

@helixplant hi, is there any update?

@tomabai
Copy link
Author

tomabai commented Jul 20, 2025

and now? any updates? why is it taking so long?

@Ya-123456
Copy link

Updates

  • Affected products
  • References

Comments
The vulnerability involves both spring-security-aspects and spring-security-core.
spring-security-aspects artifact is right to be flagged because the issue is only exploitable when that module (or @EnableMethodSecurity(mode = ASPECTJ)) is on the classpath.

On the other hand , the actual fix lives in spring-security-core, where the code that scans for security annotations is located. The patch changes a comparison from

if (method == candidate) { … }

to

if (method.equals(candidate)) { … }

Using equals() lets the scanner recognise the same method loaded by different class-loaders/AspectJ weaves, so the annotations are no longer skipped and the bypass is closed.

So to conclude, both packages should be flagged, also the fixing commit is in the core package which is anoth proof that this package is vulnerable. Moreover, to my understanding, if you use spring-security-core 6.4.5 and lower, even with the updated spring-security-aspects 6.4.6 you will still be vulnerable.

@tomabai
Copy link
Author

tomabai commented Oct 15, 2025

@helixplant any updates?

@advisory-database advisory-database bot merged commit 190137c into tomabai/advisory-improvement-5747 Oct 15, 2025
4 checks passed
@advisory-database
Copy link
Contributor

Hi @tomabai! Thank you so much for contributing to the GitHub Advisory Database. This database is free, open, and accessible to all, and it's people like you who make it great. Thanks for choosing to help others. We hope you send in more contributions in the future!

@advisory-database advisory-database bot deleted the tomabai-GHSA-9pp5-9c7g-4r83 branch October 15, 2025 20:13
@helixplant
Copy link

Hi @tomabai.
Thank you for your patience, we reached out to the CNA to confirm this information. While we have not heard back we’ve been able to validate your findings and have added org.springframework.security:spring-security-core and spring-projects/spring-security@c972de5 to this advisory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants