VMware Spring Security Content-Length header suppression (CVE-2026-22732)
A vulnerability in Spring Security versions < 7.0.4 allows attackers to bypass security header injection by manipulating the Content-Length header, leading to the absence of X-Frame-Options and other security headers.
CVE search metadata
CVE search record: CVE-2026-22732. Severity: critical. CVSS: 9.1. EPSS: 0.49%. KEV: no. Product: Spring Security (< 5.7.22, 5.8.24, 6.3.15, 6.4.15, 6.5.9, 7.0.4). Brief: VMware Spring Security Content-Length header suppression (CVE-2026-22732). Brief link: https://feed.craftedsignal.io/briefs/2026-10-spring-security-header-bypass/
Triage facts
Revision 1- Applicability
- Spring Security (< 5.7.22, 5.8.24, 6.3.15, 6.4.15, 6.5.9, 7.0.4)
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 5 public sources
- Freshness
- Revision 1Oct 30, 00:26 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- B3Likely
CVE-2026-22732 is a vulnerability in Spring Security where specific methods for setting the 'Content-Length' header bypass the 'OnCommittedResponseWrapper'. This prevents the wrapper from triggering 'onResponseCommitted()', causing the framework to fail to inject essential security headers such as 'X-Frame-Options', 'X-Content-Type-Options', and 'Cache-Control'. This vulnerability affects multiple versions of Spring Security. Fixes are available in versions 6.5.9 and 7.0.4; for versions where an upgrade is not possible, a 'BeanPostProcessor' configuration can be applied to force eager header writing.
Impact
Successful exploitation results in the suppression of critical security headers. This exposes applications to various web-based attacks that rely on the absence of browser-side security policies, such as clickjacking (due to missing 'X-Frame-Options') or MIME-sniffing attacks (due to missing 'X-Content-Type-Options').
Recommendation
- Upgrade Spring Security to the patched versions: 6.5.9 or 7.0.4.
- If upgrading is not immediately feasible, implement a 'BeanPostProcessor' to set 'shouldWriteHeadersEagerly' to 'true' for 'HeaderWriterFilter' beans.
- Audit existing codebase for manual 'Content-Length' header settings using the 'io.moderne.recipe.cve202622732.FindSpringSecurityHeaderSuppression' recipe provided by Moderne.
Immediate actions
Upgrade Spring Security to version 6.5.9 or 7.0.4 or higher across all Java applications.
Threat Hunt
Identify applications manually setting Content-Length headers in Servlet responses
Data: Static analysis of source code for 'setHeader("Content-Length", ...)' or 'setIntHeader("Content-Length", ...)'
Mitigations
Deploy 'BeanPostProcessor' to force eager header writing in environments that cannot be patched immediately.
CVE-2026-22732