CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-26PP-8WGV-HJVM

GHSA-26PP-8WGV-HJVM: HTTP Response Splitting via CRLF Injection in Hono's setCookie

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 8, 2026·5 min read·44 visits

Executive Summary (TL;DR)

Hono versions prior to 4.12.12 do not sanitize cookie names in the `setCookie` utility, leading to CRLF injection. Attackers can exploit this to inject arbitrary HTTP headers or split the response, provided the application uses dynamic user input for cookie names. Upgrading to version 4.12.12 resolves the vulnerability.

The Hono web framework contains a vulnerability in its cookie management utility that allows HTTP response splitting. The `setCookie` function fails to validate or sanitize user-supplied cookie names against control characters. If an application utilizes untrusted input to define a cookie name, an attacker can inject carriage return and line feed (CRLF) characters to manipulate the raw HTTP response headers.

Vulnerability Overview

The Hono web framework provides a utility for managing HTTP cookies. Developers rely on the setCookie function to instruct clients to store stateful information. This function is part of the hono/cookie module and handles the serialization of cookie names, values, and attributes into a standard HTTP header format.

Vulnerability GHSA-26PP-8WGV-HJVM exists because this serialization process fails to sanitize input. Specifically, the framework does not strip or validate carriage return and line feed characters before appending them to the HTTP response stream. This flaw falls under CWE-113, Improper Neutralization of CRLF Sequences in HTTP Headers.

Applications are vulnerable if they dynamically generate cookie names based on untrusted user input. An attacker can exploit this behavior to inject arbitrary HTTP headers into the server's response. This leads to HTTP response splitting, which undermines the integrity of the client-server communication channel.

Root Cause Analysis

The defect originates in the internal _serialize function located in src/utils/cookie.ts. This function takes a cookie name, value, and options object, returning a formatted string for the Set-Cookie header. The vulnerable implementation directly interpolates the name and value arguments into a template string.

The code executes let cookie = \${name}=${value}`without prior validation of thenameargument. According to RFC 6265, a cookie name must be a valid token, meaning it cannot contain control characters or separators like equals signs and semicolons. The_serialize` function erroneously assumes the caller provides a compliant token.

When an application passes an untrusted string as the cookie name, the unvalidated input becomes part of the HTTP header. The HTTP protocol uses carriage return (\r or %0D) and line feed (\n or %0A) characters to separate distinct headers. By including these characters in the cookie name, the input breaks out of the Set-Cookie context.

Code Analysis

The vulnerable implementation lacked any conditional checks on the input string. The code immediately generated the cookie string using string interpolation. This approach trusted that developers would only use static or pre-validated strings for cookie names.

The patch introduced in commit a586cd72e3f6122792e631ecf1817e5cabb803ec implements strict input validation. The maintainer added a regular expression, validCookieNameRegEx, which verifies that the cookie name only contains characters permitted by the RFC 6265 token specification.

// Patched implementation in src/utils/cookie.ts
const _serialize = (name: string, value: string, opt: CookieOptions = {}): string => {
+  if (!validCookieNameRegEx.test(name)) {
+    throw new Error('Invalid cookie name')
+  }
+
   let cookie = `${name}=${value}`
   // ...
}

If the input contains forbidden characters, including \r and \n, the function immediately throws an error. This prevents the execution flow from reaching the string interpolation step. The test cases added alongside the patch confirm that supplying strings like legit\r\nX-Injected: evil correctly triggers the validation error. The fix completely eliminates the CRLF injection vector at the framework level.

Exploitation Methodology

Exploitation requires the target application to accept user input and use it as the first argument to the setCookie function. While applications commonly store user input in cookie values, using user input for cookie names is an uncommon pattern. If this condition is met, the attacker sends a crafted payload containing CRLF characters.

A standard exploit payload injects a new header by breaking the current line. The payload user_pref\r\nLocation: http://malicious.com begins with a benign string, followed by the CRLF sequence, and then the injected header. When the application processes this input, the resulting HTTP response contains a Set-Cookie header that terminates early.

The framework generates the following raw HTTP response stream:

HTTP/1.1 200 OK
Set-Cookie: user_pref
Location: http://malicious.com=value

The HTTP client parses the injected Location header as a legitimate directive from the server. This specific payload results in an unvalidated redirect, forcing the victim's browser to navigate to an attacker-controlled domain. The = character from the original template literal becomes part of the injected header's value, which is often ignored by the client parser.

Impact Assessment

The primary impact is HTTP Response Splitting and Header Injection. The severity is constrained by the prerequisite that the application must use dynamic, user-controllable data for cookie names. In scenarios where this prerequisite is satisfied, the attacker gains significant control over the client's interaction with the application.

Header injection allows attackers to manipulate security controls. An attacker can inject a Set-Cookie header to perform session fixation or overwrite existing session identifiers. They can also inject a Content-Security-Policy header to weaken protections, enabling secondary attacks like Cross-Site Scripting (XSS).

In severe cases, an attacker can use a double CRLF sequence (\r\n\r\n) to terminate the header section entirely. This allows them to inject arbitrary content into the response body. If the application sits behind a caching proxy, this technique can poison the cache, causing the proxy to serve the malicious payload to subsequent visitors.

Remediation and Mitigation

The vulnerability is resolved in Hono version 4.12.12. Administrators and developers must update the hono package to this version or a later release. The patch is entirely backward compatible for applications using compliant cookie names.

If an immediate upgrade is not feasible, developers must implement strict validation on any user input used in HTTP responses. Input used for cookie names must be validated against an allowlist of alphanumeric characters. Applications should never permit control characters or separators in cookie names.

Network defenders can deploy Web Application Firewall (WAF) rules to inspect inbound traffic for anomalous CRLF sequences. Rules should block requests containing URL-encoded carriage return (%0D) or line feed (%0A) characters in parameters known to influence HTTP headers. This provides a temporary defense-in-depth measure.

Official Patches

HonoRelease tag for patched version v4.12.12
HonoFix commit implementing cookie name validation

Fix Analysis (1)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Affected Systems

Hono Web Framework

Affected Versions Detail

Product
Affected Versions
Fixed Version
hono
Hono
< 4.12.124.12.12
AttributeDetail
Vulnerability TypeHTTP Response Splitting / CRLF Injection
CWE IDCWE-113, CWE-93
Affected Componenthono/cookie (setCookie utility)
Exploit StatusProof of Concept available
CVSS Score5.3 (Moderate)
Attack VectorNetwork

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1565.002Data Manipulation: Runtime Data Manipulation
Impact
CWE-113
Improper Neutralization of CRLF Sequences in HTTP Headers

Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting')

Known Exploits & Detection

Security ResearchDemonstrates HTTP Response Splitting via injected Location header.

Vulnerability Timeline

Fix committed by maintainers
2026-04-07
Security advisory published
2026-04-08

References & Sources

  • [1]GitHub Advisory: GHSA-26PP-8WGV-HJVM
  • [2]Hono Fix Commit
  • [3]Hono Release v4.12.12

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 7 hours ago•CVE-2026-48861
2.1

CVE-2026-48861: HTTP Request Splitting and Smuggling via Method Parameter CRLF Injection in Elixir Mint

CVE-2026-48861 is a client-side HTTP request-line CRLF (Carriage Return Line Feed) injection vulnerability in the popular Elixir HTTP client library, Mint. The vulnerability permits HTTP Request Splitting and HTTP Request Smuggling when an application forwards untrusted, attacker-controlled inputs to Mint's HTTP client requests as either the HTTP request method or target. By embedding CRLF characters within these parameters, an attacker can terminate the request line prematurely, inject malicious headers, or pipeline entirely independent requests. These smuggled requests are then processed by upstream or downstream proxy servers as separate HTTP queries on the same TCP connection. While Mint version 1.7.0 introduced target validation to secure the request target, the HTTP request method parameter remained completely unvalidated. This flaw allows attackers to bypass routing filters, access restricted internal APIs, or poison HTTP caches under default configurations.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 7 hours ago•CVE-2026-49753
6.3

CVE-2026-49753: HTTP Request/Response Smuggling via Inconsistent Content-Length Parsing in Elixir Mint Client

An Inconsistent Interpretation of HTTP Requests (HTTP Request/Response Smuggling) vulnerability in the Elixir Mint HTTP client allows attacker-controlled HTTP/1 servers to desynchronize response framing on shared connections due to over-lenient parsing of sign-prefixed Content-Length headers.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 8 hours ago•CVE-2026-49754
8.2

CVE-2026-49754: Denial of Service via Unbounded HTTP/2 CONTINUATION Frame Accumulation in Elixir Mint

An allocation of resources without limits or throttling vulnerability in Elixir Mint allows an attacker-controlled HTTP/2 server to exhaust memory in a Mint client. The vulnerability is exploited by sending a HEADERS frame without the END_HEADERS flag followed by an infinite stream of CONTINUATION frames. Because the client lacks limits on the incoming header-block accumulator, the client continuously consumes memory until an out-of-memory crash occurs.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 8 hours ago•CVE-2026-48596
2.1

CVE-2026-48596: Improper Neutralization of CRLF Sequences in Elixir Tesla Multipart HTTP Client

CVE-2026-48596 is an Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Request/Response Splitting, CWE-113) in the Elixir Tesla HTTP client. The flaw resides in how multipart content-type parameters are joined and serialized, enabling attackers to inject arbitrary headers or split HTTP requests when applications pass untrusted inputs to the parameters of multipart uploads.

Alon Barad
Alon Barad
5 views•6 min read
•about 9 hours ago•CVE-2026-48594
8.2

CVE-2026-48594: Decompression Bomb Denial of Service in Elixir Tesla HTTP Client

An improper handling of highly compressed data (decompression bomb) vulnerability exists in the Elixir Tesla HTTP client when utilizing response decompression middlewares. By serving highly compressed responses or stacked content-encoding headers, a malicious server can cause arbitrary heap exhaustion, leading to a denial of service (DoS) crash in the BEAM virtual machine.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 9 hours ago•CVE-2026-48595
8.2

CVE-2026-48595: Cross-Origin Credential Leakage in Elixir Tesla Client via Case-Sensitive Redirect Filter Bypass

A high-severity security vulnerability in Elixir's Tesla HTTP client library (CVE-2026-48595) allows unauthenticated remote attackers to harvest sensitive credentials, including Authorization headers and cookies. The flaw resides in the 'Tesla.Middleware.FollowRedirects' component, which performs case-sensitive lookups when stripping credentials during cross-origin redirects. Because HTTP headers are case-insensitive by RFC specifications, standard canonical casing (e.g., 'Authorization') bypasses the lowercase-only blocklist, leaking tokens to untrusted external redirect destinations.

Alon Barad
Alon Barad
6 views•5 min read