Response header splitting is a web attack where an application lets attacker-controlled input break HTTP response headers into separate fields. If newline characters are accepted in header values, an attacker can inject extra headers, manipulate cookies, or trigger cache poisoning and response splitting in intermediaries.
How Response Header Splitting Works
Response header splitting happens when attacker-controlled data is inserted into an HTTP response header without proper sanitization. If newline characters survive validation, the application can be tricked into ending one header field and starting another, which changes how the browser, proxy, or cache interprets the response.
That behaviour turns a simple input-handling flaw into a protocol-level issue. The attack can alter headers that the application never intended to expose, which is why header construction must treat line breaks as dangerous control characters rather than ordinary text.
Why Response Header Splitting Is Dangerous
The main danger is that the attacker can create or modify response metadata that downstream systems trust. That may include cookies, redirects, cache directives, content type, or security headers, and the impact often depends on where the injected response is processed.
Because HTTP intermediaries may cache or forward the malformed response differently from the origin server, the same flaw can produce inconsistent behaviour across clients and infrastructure. The result may be session tampering, cache poisoning, or header-based confusion that is hard to reproduce from a single request.
Web Application Attacks Guide places response splitting in the wider family of request and response manipulation issues, where multiple parsing layers interpret the same data differently.
Where It Usually Appears
Response header splitting usually appears wherever user input is reflected into header values, such as file download names, redirect targets, error messages, or custom application headers. The flaw is especially likely when developers assume a framework will normalise dangerous characters for them, but the application later concatenates raw input into the final header string.
It can also surface in edge components, reverse proxies, and templating logic that generate headers from application data. Even when the application itself is not intentionally sending attacker-controlled headers, an intermediary or library bug can still expose the same weakness if newline handling is inconsistent.
CRLF Injection and HTTP Response Splitting Guide is the most directly relevant reference for understanding how header injection emerges and where it tends to hide in real web stacks.
Prevention and Defensive Handling
Prevention starts with rejecting or encoding line-break characters before any value reaches an HTTP header. Header-building code should use safe framework APIs rather than string concatenation, and any input that can influence a header should be treated as untrusted until it has passed strict validation.
Defensive review also matters for adjacent controls such as caching behaviour, redirect handling, and output encoding. Even a small header injection issue can become more serious when combined with downstream caches, shared proxies, or weak boundary checks between application layers.
For broader control mapping, response header splitting aligns well with NIST SP 800-53 Rev 5 Security and Privacy Controls, especially where secure software handling, integrity, and input validation are part of the control environment.
Detection, Testing, and Post-Exploitation Review
Detection usually comes from a mix of source review, dynamic testing, and log inspection. Testers look for newline handling in parameters that feed headers, while defenders watch for unexpected duplicate headers, malformed response formatting, suspicious cache behaviour, or cookie changes that do not match application logic.
If exploitation is suspected, teams should review whether sessions, cookies, redirects, or cached responses were modified through the vulnerable path. The key question is not just whether the bug existed, but whether a crafted response was actually served to other users or stored by an intermediary.
Because the issue is fundamentally about malformed HTTP metadata, it also maps naturally to the OWASP API Security Top 10 where response handling, authorization boundaries, and exposed business flows can be undermined by unsafe input handling.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 addresses the attack and risk surface, while OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP ASVS | V4 — API and Web Service | Covers web-service input handling that feeds HTTP response headers. |
| Recommendation — Validate and encode header-bound input before it reaches any response-generating API. | ||
| NIST SP 800-53 Rev 5 | SI-10 — Information Input Validation | Directly addresses rejecting dangerous control characters in application input. |
| Recommendation — Apply SI-10 to block CRLF characters from values that populate HTTP headers. | ||
| OWASP API Security Top 10 | API8 — Security Misconfiguration | Response header splitting often stems from unsafe response construction and header handling. |
| Recommendation — Harden response-generation paths so attacker input cannot alter header structure. | ||
Related resources from NHI Mgmt Group
- Why do header assertions matter more than response bodies in auth testing?
- What happens when HSTS is added through a meta tag instead of an HTTP response header?
- How should security teams use HTTP response header scanning in a web security programme?
- Why does HTTP header injection create a broader account takeover risk than a simple response manipulation issue?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 16, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org