/

CVE-2026-38967

Severity:

CRITICAL RISK

(9.8)

HTTP Response Header Injection (CWE-113) in CrowCpp Crow Web Framework

CVE-2026-38967

Deferred

Vulnerability type

Category:

HTTP Response Splitting / Header Injection

CWE:

CWE-113

Impact:

Response Header Manipulation and HTTP Response Splitting

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CrowCpp Crow through v1.3.1 allows HTTP response header injection when applications pass unvalidated values into response headers.

An attacker who can influence these header values may be able to inject additional headers or manipulate the response, enabling cache poisoning, open redirects, or content spoofing under certain conditions.

Affected context

This vulnerability affects applications built with CrowCpp Crow (through v1.3.1) that construct HTTP responses using attacker-controlled data in header fields without proper validation or normalization.

It typically arises in routes or middleware where user input—such as query parameters, form fields, cookies, or upstream service data—is written directly into response headers (e.g., Location, Set-Cookie, X-* headers) without removing or rejecting CR/LF or other control characters.

Exploit preconditions

  • Attack surface: HTTP endpoints implemented using Crow (e.g., REST APIs, web backends, callback URLs).
  • Required access: Ability to send HTTP requests that influence response header values (often unauthenticated or low-privileged).
  • Trigger point: Framework or application code that interpolates or copies untrusted input into response headers.
  • Why exploitation is possible: Crow does not enforce strict validation or canonicalization of header values, allowing newline or delimiter characters to break header structure and inject attacker-controlled headers or response fragments.

Why this happens

The underlying bug class is improper neutralization of CR/LF and related control characters in HTTP response headers, mapped to CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting').

Application code relies on Crow's header APIs to emit HTTP headers but passes in values derived from untrusted input without sanitization or validation.

Because Crow does not consistently reject or sanitize header values containing characters such as \r and \n, attackers can terminate an existing header line and start new headers or even a new response body section, effectively splitting or manipulating the HTTP response stream.

Potential impact

  • Injection of arbitrary HTTP response headers, which can be used for:
  • Cache poisoning by manipulating Location, Cache-Control, or other caching-related headers.
  • Security policy weakening by injecting or altering headers like Content-Security-Policy, X-Frame-Options, or Access-Control-Allow-*.
  • HTTP response splitting, potentially leading to:
  • Cross-site scripting (XSS) in some proxy or browser combinations.
  • Session fixation or cookie manipulation via crafted Set-Cookie headers.
  • Open redirect behavior via malicious Location headers.
  • Interference with logging, monitoring, or intermediary proxies due to malformed responses.
  • Degradation of service or unexpected errors in clients and intermediaries that consume corrupted HTTP responses.

General mitigation guidance

Effective mitigation focuses on eliminating the ability for untrusted input to alter header structure:

  • Normalize and validate all response header values before setting them, rejecting any input containing \r, \n, or other control characters that can affect protocol framing.
  • Use narrowly scoped helper functions or wrappers for setting headers that only accept validated, encoded values and centralize header-safety checks.
  • Avoid constructing headers directly from raw user input; instead, use whitelists, fixed patterns, or parameterized mappings (e.g., map known tokens to known header values).
  • Apply strict separation between untrusted data and protocol syntax: treat headers as a structured API, not as concatenated strings.
  • Reduce privileges where possible, for example by running the application behind a reverse proxy that can enforce basic header sanity checks and drop clearly malformed responses.

How teams detect issues like this

Detection typically combines code-level review and behavioral testing:

  • Static analysis and code review:
  • Search for all locations where Crow response headers are set (e.g., header manipulation APIs) and inspect whether the values can be influenced by request parameters, user data, or external services.
  • Flag patterns where raw input is concatenated into headers or where there is no explicit validation or encoding logic.
  • Enforce secure coding guidelines or linters that disallow CR/LF in header values or require centralized header-setting utilities.
  • Dynamic and fuzz testing:
  • Send crafted requests including %0d%0a or equivalent CR/LF sequences in parameters that are reflected in headers, and observe response behavior.
  • Use automated security testing tools or proxies that are aware of HTTP response splitting and header injection patterns.
  • Operational monitoring:
  • Monitor for anomalous or malformed responses in logs and reverse proxy metrics, including responses with duplicated or unexpected headers.

Sources

SourceLink
github.comgithub.com/CrowCpp/Crow/issues/1165
github.comgithub.com/CrowCpp/Crow/pull/1167

Frequently asked

questions

Exploitability depends on whether your Crow-based application uses untrusted input in response headers. If header values are static or derived only from trusted configuration, the practical risk is reduced; if user-controlled data is copied into headers, exploitation can be straightforward.

Not necessarily. In many designs, anonymous users can influence header-related data (e.g., via query parameters or redirects). Any endpoint that reflects request data into response headers without validation can be a candidate, regardless of authentication.

Centralize header creation behind a small set of safe APIs that:

  • Reject header values containing CR/LF or other control characters.
  • Use whitelists or constrained enums for header values where possible.
  • Ensure that all routes use these APIs instead of manually building header strings.

Adopt a defense-in-depth approach:

  • Treat all user input as untrusted and validate it according to strict, context-specific rules.
  • Enforce secure header-setting practices via code review checklists and static analysis rules.
  • Place Crow services behind reverse proxies configured to normalize or block malformed responses.
  • Provide developer training and secure coding guidelines that explicitly cover HTTP response splitting and header injection risks.
Find out what's already
exploitable in your codebase.