DEV Community

CVE Reports
CVE Reports

Posted on Originally published at cvereports.com

CVE-2026-126355: CVE-2026-126355: Cross-Site Request Forgery Protection Bypass via Hyperlink Auditing in Hono

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

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))
     ) {
Enter fullscreen mode Exit fullscreen mode

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:

  1. Audit package.json and lockfiles (package-lock.json, pnpm-lock.yaml, bun.lockb) to identify Hono versions prior to 4.13.16.
  2. Update the hono dependency to >= 4.13.16 using npm, pnpm, yarn, or bun.
  3. Verify that csrf() middleware is configured with explicit allowed origins or Sec-Fetch-Site validation rules matching your deployment domains.
  4. Run regression tests simulating cross-origin POST requests with Content-Type: text/ping to confirm the server responds with HTTP 403 Forbidden.

References


Read the full report for CVE-2026-126355 on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)