CVE-2024-38821

9.1 CRITICAL

📋 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

Products:
  • Spring Framework
  • Spring Boot
  • Spring Security
Versions: Spring Framework 6.1.0 - 6.1.18, 6.0.0 - 6.0.28, 5.3.0 - 5.3.33
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when all three conditions are met: WebFlux application, using Spring static resources support, and non-permitAll authorization rules on static resources.

⚠️ 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.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. 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.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

all

Change 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

all

Serve 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

🔗 References

📤 Share & Export