CVE-2026-126355: Cross-Site Request Forgery Protection Bypass via Hyperlink Auditing in Hono
Vulnerability ID: CVE-2026-126355
CVSS Score: 5.3
Published: 2026-11-12
CVE-2026-126355 (GHSA-46wx-v44x-9hh2) is a Cross-Site Request Forgery (CSRF) validation bypass in Hono, a web application framework for JavaScript runtimes. Prior to version 4.13.16, Hono's built-in csrf() middleware only evaluated origin headers for requests matching standard HTML form MIME types (application/x-www-form-urlencoded, multipart/form-data, and text/plain). By leveraging the HTML anchor ping attribute in Chromium-based browsers, an attacker can initiate an unprompted, credentialed cross-origin HTTP POST request with Content-Type: text/ping without triggering a CORS preflight request. Because text/ping was omitted from the middleware regular expression, requests bypassed Origin and Sec-Fetch-Site verification, allowing unauthorized state-changing operations.
TL;DR
Hono versions prior to 4.13.16 fail to validate Origin and Sec-Fetch-Site headers on HTTP POST requests with Content-Type: text/ping. Attackers can exploit this oversight via the HTML attribute in Chromium-based browsers to bypass CSRF protection and trigger unauthorized state-modifying actions on endpoints that rely on URL path or query parameters.
Technical Details
- Vulnerability ID: CVE-2026-126355 / GHSA-46wx-v44x-9hh2
- Weakness Type: CWE-352: Cross-Site Request Forgery (CSRF)
- CVSS v3.1 Score: 5.3 Medium (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N)
- Attack Vector: Network via HTML Hyperlink Auditing (Content-Type: text/ping)
- Affected Component: hono/csrf Middleware (src/middleware/csrf/index.ts)
- Affected Versions: Hono < 4.13.16
- Patched Version: Hono 4.13.16
- CISA KEV Status: Not Listed
Affected Systems
- Hono Web Framework (npm package: hono)
-
hono: < 4.13.16 (Fixed in:
4.13.16)
Code Analysis
Commit: bf16471
Update CSRF middleware regular expression to validate requests with Content-Type: text/ping
File: src/middleware/csrf/index.ts
@@ -26,8 +26,8 @@ interface CSRFOptions {
}
const isSafeMethodRe = /^(GET|HEAD|OPTIONS)$/
-const isRequestedByFormElementRe =
- /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)\b/i
+const isCsrfContentTypeRe =
+ /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/(?:plain|ping))\b/i
/**
* CSRF Protection Middleware for Hono.
@@ -138,7 +138,7 @@ export const csrf = (options?: CSRFOptions): MiddlewareHandler => {
return async function csrf(c, next) {
if (
!isSafeMethodRe.test(c.req.method) &&
- isRequestedByFormElementRe.test(c.req.header('content-type') || 'text/plain') &&
+ isCsrfContentTypeRe.test(c.req.header('content-type') || 'text/plain') &&
!(await isAllowedSecFetchSite(c.req.header('sec-fetch-site'), c)) &&
!(await isAllowedOrigin(c.req.header('origin'), c))
) {
Mitigation Strategies
- Upgrade Hono to version 4.13.16 or later to include text/ping in the CSRF Content-Type validation regex.
- Configure authentication and session cookies with SameSite=Lax or SameSite=Strict to prevent browsers from attaching credentials to cross-site POST requests.
- Require explicit application/json request bodies and Content-Type validation on state-modifying POST endpoints rather than relying on URL path or query parameters.
- Deploy WAF or reverse proxy rules to reject cross-origin POST requests carrying Content-Type: text/ping or Ping-From/Ping-To headers.
Remediation Steps:
- Audit package.json and lockfiles (package-lock.json, pnpm-lock.yaml, bun.lockb) to identify Hono versions prior to 4.13.16.
- Update the hono dependency to >= 4.13.16 using npm, pnpm, yarn, or bun.
- Verify that csrf() middleware is configured with explicit allowed origins or Sec-Fetch-Site validation rules matching your deployment domains.
- Run regression tests simulating cross-origin POST requests with Content-Type: text/ping to confirm the server responds with HTTP 403 Forbidden.
References
- GitHub Security Advisory GHSA-46wx-v44x-9hh2
- Hono Fix Commit bf16471913b5199212dac33f5d170f94745dd26a
- Hono Release v4.13.16
- CVE.org Record: CVE-2026-126355
- NVD Detail: CVE-2026-126355
- CVEProject cvelistV5 Record for CVE-2026-126355
Read the full report for CVE-2026-126355 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)