CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')

Variant Incomplete Simple

CWE版本: 4.18

更新日期: 2025-09-09

弱点描述

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.

常见后果

影响范围: Integrity Access Control

技术影响: Modify Application Data Gain Privileges or Assume Identity

说明: CR 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.

潜在缓解措施

阶段: Implementation

策略: Input Validation

描述: Construct HTTP headers very carefully, avoiding the use of non-validated input data.

阶段: Implementation

策略: Input Validation

阶段: Implementation

策略: Output Encoding

描述: Use 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.

阶段: Implementation

策略: Input Validation

描述: Inputs 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.

检测方法

方法: Automated Static Analysis

Automated 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

观察示例

参考: CVE-2020-15811

Chain: Proxy uses a substring search instead of parsing the Transfer-Encoding header (CWE-697), allowing request splitting (CWE-113) and cache poisoning

参考: CVE-2021-41084

Scala-based HTTP interface allows request splitting and response splitting through header names, header values, status reasons, and URIs

参考: CVE-2018-12116

Javascript-based framework allows request splitting through a path option of an HTTP request

参考: CVE-2004-2146

Application accepts CRLF in an object ID, allowing HTTP response splitting.

参考: CVE-2004-1656

Shopping cart allows HTTP response splitting to perform HTML injection via CRLF in a parameter for a url

参考: CVE-2005-2060

Bulletin board allows response splitting via CRLF in parameter.

参考: CVE-2004-2512

Response splitting via CRLF in PHPSESSID.

参考: CVE-2005-1951

e-commerce app allows HTTP response splitting using CRLF in object id parameters

引入模式

阶段 说明
Implementation -

适用平台

编程语言
Not Language-Specific (Undetermined)
技术
Web Based (Undetermined)

分类映射

分类名称 条目ID 条目名称 映射适配度
PLOVER - HTTP response splitting -
7 Pernicious Kingdoms - HTTP Response Splitting -
WASC 25 HTTP Response Splitting -
Software Fault Patterns SFP24 Tainted input to command -
关键信息

CWE ID: CWE-113

抽象级别: Variant

结构: Simple

状态: Incomplete

相关弱点
相关攻击模式
CAPEC-105 CAPEC-31 CAPEC-34 CAPEC-85