CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers

What is CWE-113?

CWE-113 is Improper Neutralization of CRLF Sequences in HTTP Headers. The flaw arises when The product receives data from an HTTP agent or component but fails to neutralize, or incorrectly neutralizes, CR and LF characters before including that data in outgoing HTTP headers. The database currently holds 43 vulnerabilities mapped to CWE-113 and none of them are in the CISA Known Exploited Vulnerabilities catalog.

OWASP TOP 10:2025 RANK5 — A05:2025 — Injection
Related CVES (365 days)43
AbstractionVariant
Likelihood of exploit-

Vulnerabilities mapped to CWE-113

43 vulnerabilities617% increase year over year

No data

No vulnerability data in CISA KEV for CWE-113

Official definition

ByMitre CWE

The product receives data from an HTTP agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers. (Roles: Common-Name, Attack-Focused, Common-Name, Attack-Focused)

HTTP agents or components may include a web server, load balancer, reverse proxy, web caching proxy, application firewall, web browser, etc. Regardless of the role, they are expected to maintain coherent, consistent HTTP communication state across all components. However, including unexpected data in an HTTP header allows an attacker to specify the entirety of the HTTP message that is rendered by the client HTTP agent (e.g., web browser) or back-end HTTP agent (e.g., web server), whether the message is part of a request or a response.

When an HTTP request contains unexpected CR and LF characters, the server may respond with an output stream that is interpreted as "splitting" the stream into two different HTTP messages instead of one. CR is carriage return, also given by %0d or \r, and LF is line feed, also given by %0a or \n.

In addition to CR and LF characters, other valid/RFC compliant special characters and unique character encodings can be utilized, such as HT (horizontal tab, also given by %09 or \t) and SP (space, also given as + sign or %20).

These types of unvalidated and unexpected data in HTTP message headers allow an attacker to control the second "split" message to mount attacks such as server-side request forgery, cross-site scripting, and cache poisoning attacks.

Detailed description

HTTP components such as web servers, load balancers, reverse proxies, caching proxies, application firewalls, and browsers are expected to preserve coherent communication state across the request and response path. Unexpected data in a header can cause a client-side or back-end HTTP agent to interpret the resulting stream differently from the application's intent.

When an HTTP request contains unexpected CR and LF characters, the server may interpret the output stream as two HTTP messages rather than one. CR means carriage return and can be represented as %0d or \r; LF means line feed and can be represented as %0a or \n. Other valid or RFC-compliant special characters and character encodings, including HT represented as %09 or \t, and SP represented as + or %20, may also affect interpretation.

If an attacker can control the second message created by the split, the result can support attacks including server-side request forgery, cross-site scripting, and cache poisoning.

Characteristics

This weakness commonly occurs in web-based, language-independent components, including web servers and HTTP intermediaries. Untrusted data is inserted into an HTTP header without correct handling, particularly when it contains CR or LF. Related terms are HTTP request splitting and HTTP response splitting, and the issue can affect both HTTP requests and HTTP responses.

Common consequences

CR and LF characters in an HTTP header may give an attacker control over the remaining headers and body of the intended message, or allow the attacker to create additional messages under their control. The recorded impacts include modifying application data and gaining privileges or assuming another identity. The resulting split-message behavior can also enable server-side request forgery, cross-site scripting, or cache poisoning.

ImpactScopeExplanation
Modify Application Data, Gain Privileges or Assume IdentityIntegrity, Access ControlCR and LF characters in an HTTP header may give attackers control of the remaining headers and body of the message that the application intends to send/receive, as well as allowing them to create additional messages entirely under their control.

Risk mitigations

Use carefully constructed HTTP headers and avoid placing unvalidated input in them. Apply strict allowlist validation based on the complete specification and relevant properties such as length, type, permitted values, syntax, missing or extra fields, consistency, and business rules; reject or transform inputs that do not conform. Do not rely only on denylists, although denylists can help identify or reject severely malformed input. Decode and canonicalize input into the application's internal representation before validation, and ensure that the same input is not decoded twice. Specify an output encoding that the downstream component can handle, such as ISO-8859-1, UTF-7, or UTF-8, and keep encoding expectations consistent across components.

  1. Input Validation · ImplementationConstruct HTTP headers very carefully, avoiding the use of non-validated input data.
  2. Input Validation · ImplementationAssume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. If an input does not strictly conform to specifications, reject it or transform it into something that conforms. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  3. Output Encoding · ImplementationUse and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
  4. Input Validation · ImplementationInputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

Detection methods

Automated static analysis, commonly called Static Application Security Testing (SAST), can find some instances by modeling data flow and control flow in source or compiled code. It searches for potentially vulnerable paths from input sources to sinks where data interacts with external components or lower layers. This approach does not necessarily identify every case that depends on runtime behavior or HTTP component configuration.

MethodApproachEffectiveness
Automated Static AnalysisAutomated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)High

Representative vulnerabilities

The following are representative examples curated in the official record, not an exhaustive list:

  • CVE-2020-15811: A proxy used substring searching instead of parsing the Transfer-Encoding header, enabling request splitting and cache poisoning.
  • CVE-2021-41084: A Scala-based HTTP interface allowed request splitting and response splitting through header names, header values, status reasons, and URIs.
  • CVE-2018-12116: A JavaScript-based framework allowed request splitting through an HTTP request path option.
  • CVE-2004-2146: An application accepted CRLF in an object identifier, allowing HTTP response splitting.
  • CVE-2004-1656: A shopping cart allowed HTTP response splitting and HTML injection through CRLF in a URL parameter.
  • CVE-2005-2060: A bulletin board allowed response splitting through CRLF in a parameter.
  • CVE-2004-2512: Response splitting was possible through PHPSESSID.
  • CVE-2005-1951: An e-commerce application allowed response splitting using CRLF in object identifier parameters.
Sources (2)

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.