CVE-2025-41248: Spring Security authorization bypass for method security annotations on parameterized types
The Spring Framework annotation detection mechanism may not correctly resolve annotations on methods within type hierarchies with a parameterized super type with unbounded generics. This can be an issue if such annotations are used for authorization decisions.
Your application may be affected by this if you are using Spring Security's @EnableMethodSecurity feature.
You are not affected by this if you are not using @EnableMethodSecurity or if you do not use security annotations on methods in generic superclasses or generic interfaces.
This CVE is published in conjunction with CVE-2025-41248
Other sources
The Spring Security annotation detection mechanism may not correctly resolve annotations on methods within type hierarchies with a parameterized super type with unbounded generics. This can be an issue when using @PreAuthorize and other method security annotations, resulting in an authorization bypass.
Your application may be affected by this if you are using Spring Security's @EnableMethodSecurity feature.
You are not affected by this if you are not using @EnableMethodSecurity or if you do not use security annotations on methods in generic superclasses or generic interfaces.
This CVE is published in conjunction with CVE-2025-41249 https://spring.io/security/cve-2025-41249 .
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.springframework.security:spring-security-coreto a version that resolves this vulnerability.Fixed in 6.5.4 - Upgrade
Upgrade
maven/org.springframework.security:spring-security-coreto a version that resolves this vulnerability.Fixed in 6.4.10 - Configuration
If not required, do not enable Spring Security method security (@EnableMethodSecurity), since applications using it may be affected.
Spring Security @EnableMethodSecurity = disable / do not use - Configuration
If you use @EnableMethodSecurity, avoid using @PreAuthorize and other method security annotations on methods declared within generic superclasses or generic interfaces with unbounded generics (parameterized super types), as annotation resolution may fail and enable authorization bypass.
Spring Security method security annotations method security annotations on methods in generic superclasses or generic interfaces = avoid / refactor
Event History
Frequently Asked Questions
What is the severity of CVE-2025-41248?
CVE-2025-41248 is classified as a vulnerability that could lead to authorization issues in Spring Security.
How do I fix CVE-2025-41248?
To mitigate CVE-2025-41248, ensure you are using the latest version of Spring Security that addresses this annotation detection issue.
What are the potential impacts of CVE-2025-41248?
The potential impact of CVE-2025-41248 includes improper access control due to mismanaged method security annotations.
Which versions of Spring Security are affected by CVE-2025-41248?
CVE-2025-41248 affects various versions of Spring Security that utilize the annotation detection mechanism.
What is the cause of CVE-2025-41248?
CVE-2025-41248 is caused by the Spring Security framework's failure to correctly resolve annotations in methods with parameterized super types and unbounded generics.