VAITP Dataset

← Back to the dataset

CVE-2026-85077

Sanic allows CRLF injection in headers, causing response splitting hijacks.

  • CVSS 8.2
  • CWE-113
  • Input Validation and Sanitization
  • Remote

Sanic is an opensource python web server/framework. Prior to version 24.12.1, and in version 25.12.0, the HTTP/1.1 response pipeline in sanic/response/types.py serializes response header names and values without rejecting carriage-return or line-feed characters. Applications that place attacker-controlled data in response.headers, file(…, filename=…), or cookie path and domain attributes can therefore emit injected headers and may split responses. Depending on application and proxy behavior, this can enable session fixation through injected cookies, cache poisoning, or security-header corruption. This issue is fixed in versions 24.12.1 and 25.12.1.

CVSS base score
8.2
Published
2026-09-17
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Sanic
Fixed by upgrading
Yes

Solution

Upgrade Sanic to version 24.12.1 or later (or 25.12.1 or later).

Vulnerable code sample

from sanic import Sanic, response

app = Sanic(__name__)

@app.get("/test")
async def test(request):
    user_input = request.args.get("msg", "")
    # VULNERABLE: header injection
    resp = response.text("OK", headers={"X-User": user_input})
    return resp

Patched code sample

from sanic import Sanic, response

app = Sanic(__name__)

@app.get("/test")
async def test(request):
    user_input = request.args.get("msg", "")
    # FIX: strip CRLF
    user_input = user_input.replace("\r", "").replace("\n", "")
    resp = response.text("OK", headers={"X-User": user_input})
    return resp

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • v24 LTS security patch (#3165) (sanic-org/sanic)
    guide/content/en/emoji.py, guide/webapp/display/markdown.py · DocsRenderer.heading, guide/webapp/display/plugins/tabs.py · Tabs._render_tab, sanic/cli/arguments.py · DevelopmentGroup.attach, sanic/config.py, sanic/exceptions.py, sanic/handlers/error.py · ErrorHandler.response, sanic/http/http1.py · Http.http1, sanic/http/http1.py · Http.read, sanic/logging/formatter.py · DebugFormatter._color_exception_line, sanic/mixins/startup.py · StartupMixin.get_server_location, sanic/request/types.py and 7 more
  • cleanup CRLF header injection (sanic-org/sanic)
    sanic/response/types.py, sanic/response/types.py · BaseHTTPResponse.processed_headers
  • v25 LTS security patch (#3164) (sanic-org/sanic)
    sanic/http/http1.py · Http.read, sanic/request/types.py · Request.__init__, sanic/worker/inspector.py, sanic/__version__.py

Cite this entry

@misc{vaitp:cve202685077,
  title        = {{Sanic allows CRLF injection in headers, causing response splitting hijacks.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-85077},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-85077/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.