/

CVE-2026-85077

Severity:

HIGH RISK

(8.2)

HTTP Response Splitting (CWE-113) in Sanic Framework

CVE-2026-85077

Awaiting Analysis

Vulnerability type

Category:

HTTP Response Splitting

CWE:

CWE-113

Impact:

Response Injection and HTTP Response Splitting

Severity:

HIGH RISK

(8.2)

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

Sanic versions with the affected HTTP/1.1 response pipeline do not reject carriage-return or line-feed characters in serialized response header names and values. If attacker-controlled data reaches response headers, filenames, or cookie attributes, an attacker may inject headers or split responses, potentially enabling session fixation, cache poisoning, or security-header corruption.

Affected context

The vulnerability occurs in Sanic applications that serialize attacker-influenced data into HTTP/1.1 responses without filtering carriage-return and line-feed characters. Risk is higher when applications derive response headers, download filenames, cookie paths, or cookie domains from request data or other untrusted sources, particularly when responses pass through caches, reverse proxies, or browsers that interpret injected headers.

Exploit preconditions

  • Attack surface: An HTTP/1.1 response generated by a Sanic application
  • Required access: Ability to influence data assigned to response headers, file download filenames, or cookie path and domain attributes
  • Trigger point: Serialization of the affected response metadata before it is sent to the client
  • Why exploitation is possible: Carriage-return and line-feed characters are not rejected before header names and values are emitted, allowing response metadata to be interpreted as additional headers or separate response content

Why this happens

The underlying bug is insufficient validation of data at an HTTP response serialization boundary. Response header names and values are treated as ordinary strings even when they contain control characters that have structural meaning in the HTTP protocol. This behavior maps to CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers, because untrusted input can alter the intended response structure.

Potential impact

  • An attacker may inject additional HTTP response headers
  • Session cookies could be manipulated, potentially enabling session fixation
  • Shared caches could be poisoned or supplied with unintended metadata
  • Security-related headers could be overwritten, removed, or corrupted
  • Clients, proxies, or downstream services could interpret a response differently from the application

General mitigation guidance

Mitigation generally focuses on enforcing protocol-safe output handling and reducing trust in data used to construct responses.

Common defensive patterns include:

  • Rejecting or safely normalizing carriage-return and line-feed characters in header names and values
  • Using framework and library APIs that enforce HTTP header grammar by default
  • Keeping attacker-controlled data out of response metadata where possible
  • Applying allowlists for filenames and cookie attribute values
  • Separating untrusted data from security-sensitive headers and cookie settings
  • Running applications and reverse proxies with consistent header-validation policies
  • Limiting cookie scope and privileges so that a single response-injection issue has less impact

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis rules that flag response headers, filenames, or cookie attributes populated from request-controlled data
  • Code review checks for direct concatenation or interpolation into HTTP response metadata
  • Tests that verify control characters are rejected or safely handled at response boundaries
  • Integration testing through relevant reverse proxies, caches, and clients
  • Runtime policy enforcement that blocks malformed response headers and records rejected control characters
  • Automated security review tools that recognize CRLF flow from input sources to HTTP output sinks

Sources

SourceLink
github.comgithub.com/sanic-org/sanic/commit/47349d689d65fa1907977ac100e867894aeafb22
github.comgithub.com/sanic-org/sanic/commit/9a95bb1c187558949606b915f5162c15f2db781b
github.comgithub.com/sanic-org/sanic/commit/a332796506c7c588b6930b02a8886e43eb8ea8d6
github.comgithub.com/sanic-org/sanic/pull/3164
github.comgithub.com/sanic-org/sanic/pull/3165
github.comgithub.com/sanic-org/sanic/releases/tag/v24.12.1
github.comgithub.com/sanic-org/sanic/releases/tag/v25.12.1
github.comgithub.com/sanic-org/sanic/security/advisories/GHSA-m64h-22vf-48wm

Frequently asked

questions

It can be exploitable through normal HTTP requests when an application copies attacker-controlled values into affected response metadata. Direct server access is generally not required.

The attacker needs a way to influence a response header, download filename, or cookie path or domain value. The exact scope depends on the application's routes and data flows.

Ensure response serializers reject carriage-return and line-feed characters, and use APIs that enforce valid HTTP header grammar by default. Avoid placing untrusted values in security-sensitive response metadata.

Apply strict output validation, use allowlists for structured response attributes, test responses through deployed proxies and caches, and include CRLF-flow checks in code review and automated security testing.

Find out what's already
exploitable in your codebase.