CVE-2025-41248
High · 7.5CVSS
7.5
EPSS
0.4%
Published
Sep 16, 2025
CISA due date
—
Cloudanix analysis
A permission-checking feature in some applications can miss checks on certain complex code setups, letting people reach parts of the system they should not.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Web Framework
- Class
- Authorization Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw allows authorization bypass because Spring Security's annotation detection fails to resolve @PreAuthorize and similar annotations on methods in type hierarchies involving parameterized super types with unbounded generics when @EnableMethodSecurity is active.
Why it matters to the business
Attackers may gain unauthorized access to protected application functions and data, increasing exposure risk for sensitive operations until fixed.
How an attack unfolds
An attacker identifies endpoints protected by method security annotations placed on methods within generic superclasses or interfaces, then invokes those methods directly; the flawed detection skips the authorization check, granting access that should have been denied.
How to fix it
Upgrade Spring Security to a version that correctly resolves annotations across generic type hierarchies; avoid placing security annotations on methods in generic superclasses or interfaces until updated.
How to confirm the fix worked
Audit code using @EnableMethodSecurity for annotations on generic hierarchies, then verify authorization enforcement with targeted tests after applying updates.
Typical attack path
- Map application endpoints using @EnableMethodSecurity
- Locate methods inheriting security annotations from parameterized generic super types
- Send requests targeting those methods without required credentials or roles
- Bypass authorization and access restricted functionality
How to detect it
Review application logs for authorization decisions around methods in generic hierarchies and monitor for access patterns that bypass expected permission checks.
What your security team should do
- Determine whether @EnableMethodSecurity is enabled and if annotations exist on generic super types
- Prioritize patching once fixed releases are available given the authorization bypass nature
- Temporarily refactor affected methods to non-generic locations if immediate upgrade is not feasible
The record
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 .
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Maven | org.springframework.security:spring-security-core | 6.4.0 | 6.4.10 |
| Maven | org.springframework.security:spring-security-core | 6.5.0 | 6.5.4 |
| Chainguard | apache-nifi | 0 | 2.5.0-r11 |
| Chainguard | apache-nifi-compat | 0 | 2.5.0-r11 |
| Chainguard | apache-nifi-registry | 0 | 2.5.0-r6 |
| Chainguard | apache-nifi-registry-toolkit | 0 | 2.5.0-r6 |
| Chainguard | apache-nifi-toolkit | 0 | 2.5.0-r11 |
| Chainguard | jenkins-2 | 0 | 2.528-r0 |
| Chainguard | jenkins-2-openjdk-17 | 0 | 2.528-r0 |
| Chainguard | jenkins-2-openjdk-21 | 0 | 2.528-r0 |
| Chainguard | jenkins-2.504 | 0 | 2.504.3-r5 |
| Chainguard | jenkins-2.504-openjdk-17 | 0 | 2.504.3-r5 |
| Chainguard | jenkins-2.504-openjdk-21 | 0 | 2.504.3-r5 |
| Chainguard | jenkins-2.516 | 0 | 2.516.2-r1 |
| Chainguard | jenkins-2.516-openjdk-17 | 0 | 2.516.2-r1 |
| Chainguard | jenkins-2.516-openjdk-21 | 0 | 2.516.2-r1 |
| Chainguard | jenkins-compat | 0 | 2.528-r0 |
| Chainguard | jenkins-docker-agent | 0 | 2.528-r0 |
| Chainguard | jenkins-docker-agent-openjdk-17 | 0 | 2.528-r0 |
| Chainguard | jenkins-docker-agent-openjdk-21 | 0 | 2.528-r0 |
| Chainguard | jenkins-remoting | 0 | 2.528-r0 |
| Chainguard | jenkins-utils | 0 | 2.528-r0 |
| Chainguard | nacos | 0 | 3.1.0-r0 |
| Chainguard | nacos-compat | 0 | 3.1.0-r0 |
| Chainguard | nacos-docker | 0 | 3.1.0-r0 |
| Chainguard | thingsboard | 0 | 4.2-r6 |
| Chainguard | thingsboard-tb-js-executor | 0 | 4.2-r6 |
| Chainguard | thingsboard-tb-mqtt-transport | 0 | 4.2-r6 |
| Chainguard | thingsboard-tb-node | 0 | 4.2-r6 |
| Chainguard | thingsboard-tb-web-ui | 0 | 4.2-r6 |
| Wolfi | apache-nifi | 0 | 2.5.0-r11 |
| Wolfi | apache-nifi-compat | 0 | 2.5.0-r11 |
| Wolfi | apache-nifi-registry | 0 | 2.5.0-r6 |
| Wolfi | apache-nifi-registry-toolkit | 0 | 2.5.0-r6 |
| Wolfi | apache-nifi-toolkit | 0 | 2.5.0-r11 |
| Wolfi | jenkins-2 | 0 | 2.528-r0 |
| Wolfi | jenkins-2-openjdk-17 | 0 | 2.528-r0 |
| Wolfi | jenkins-2-openjdk-21 | 0 | 2.528-r0 |
| Wolfi | jenkins-compat | 0 | 2.528-r0 |
| Wolfi | jenkins-docker-agent | 0 | 2.528-r0 |
| Wolfi | jenkins-docker-agent-openjdk-17 | 0 | 2.528-r0 |
| Wolfi | jenkins-docker-agent-openjdk-21 | 0 | 2.528-r0 |
| Wolfi | jenkins-remoting | 0 | 2.528-r0 |
| Wolfi | jenkins-utils | 0 | 2.528-r0 |
| Wolfi | thingsboard | 0 | 4.2-r6 |
| Wolfi | thingsboard-tb-js-executor | 0 | 4.2-r6 |
| Wolfi | thingsboard-tb-mqtt-transport | 0 | 4.2-r6 |
| Wolfi | thingsboard-tb-node | 0 | 4.2-r6 |
| Wolfi | thingsboard-tb-web-ui | 0 | 4.2-r6 |
| maven | org.springframework.security/spring-security-core | 6.4.0 | 6.4.10 |
| maven | org.springframework.security/spring-security-core | 6.5.0 | 6.5.4 |
Related vulnerabilities
- GHSA-vqxh-445g-37fc Spring Security has a broken timing attack mitigation implemented in… Also affects org.springframework.security:spring-security-core
- CVE-2025-22234 The fix applied in CVE-2025-22228 inadvertently broke the timing attack mitigation… Also affects org.springframework.security:spring-security-core
- CVE-2025-41232 Spring Security Aspects may not correctly locate method security annotations on private… Also affects org.springframework.security:spring-security-core
- CVE-2025-22223 Spring Security 6.4.0 - 6.4.3 may not correctly locate method security annotations on… Also affects org.springframework.security:spring-security-core
- CVE-2024-38827 The usage of String.toLowerCase() and String.toUpperCase() has some Locale dependent… Also affects org.springframework.security:spring-security-core
- CVE-2024-38810 Missing Authorization When Using @AuthorizeReturnObject in Spring Security 6.3.0 and… Also affects org.springframework.security:spring-security-core
- CVE-2024-22257 In Spring Security, versions 5.7.x prior to 5.7.12, 5.8.x prior to 5.8.11, versions 6.0.x… Also affects org.springframework.security:spring-security-core
- CVE-2024-22234 In Spring Security, versions 6.1.x prior to 6.1.7 and versions 6.2.x prior to 6.2.2, an… Also affects org.springframework.security:spring-security-core