CVE-2026-85077
Sanic allows CRLF injection in headers, causing response splitting hijacks.
- CVSS 8.2
- 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.
- CWE
- 113
- 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 respPatched 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 respPayload
__VAITP_MODEL_REFUSED__
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/}}
}
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 ::
