CVE-2024-38821
📋 TL;DR
CVE-2024-38821 is an authorization bypass vulnerability in Spring WebFlux applications that allows attackers to access protected static resources without proper authentication. This affects Spring WebFlux applications using Spring Security authorization rules on static resources. Only applications meeting all three specific conditions are vulnerable.
💻 Affected Systems
- Spring Framework
- Spring Boot
- Spring Security
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Attackers could access sensitive static files containing credentials, configuration data, or proprietary information, potentially leading to full system compromise.
Likely Case
Unauthorized access to static resources like configuration files, documentation, or internal assets that should be protected by authorization rules.
If Mitigated
Limited impact if static resources don't contain sensitive information or if additional network/application controls prevent access.
🎯 Exploit Status
Exploitation requires knowledge of static resource paths and the specific conditions must be present in the target application.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Spring Framework 6.1.19, 6.0.29, 5.3.34
Vendor Advisory: https://spring.io/security/cve-2024-38821
Restart Required: Yes
Instructions:
1. Update Spring Framework to patched version. 2. Update Spring Boot if using Spring Boot starters. 3. Restart application. 4. Verify authorization rules work correctly.
🔧 Temporary Workarounds
Remove authorization from static resources
allChange authorization rules on static resources to permitAll or remove authorization entirely
Modify Spring Security configuration to use .requestMatchers("/static/**").permitAll()
Move static resources outside Spring Security
allServe static resources through web server (nginx, Apache) instead of Spring WebFlux
Configure web server to serve static files directly
🧯 If You Can't Patch
- Implement network-level access controls to restrict access to static resource endpoints
- Move sensitive static files to locations not served by the vulnerable static resources configuration
🔍 How to Verify
Check if Vulnerable:
Check if application uses Spring WebFlux, has static resources configuration, and applies non-permitAll authorization rules to those resources.
Check Version:
Check Spring Framework version in pom.xml or build.gradle, or run application with --version flag
Verify Fix Applied:
Test that authorization rules properly block unauthorized access to static resources after patching.
📡 Detection & Monitoring
Log Indicators:
- Unauthorized access attempts to static resource paths
- 403 errors followed by successful 200 responses to same static resources
Network Indicators:
- HTTP requests to static resource paths without proper authentication headers
SIEM Query:
source="web_server" AND (uri_path="/static/*" OR uri_path="/resources/*") AND response_code=200 AND NOT auth_successful=true