---
id: "GHSA-46wx-v44x-9hh2"
page: "https://infrastack.ai/live/GHSA-46wx-v44x-9hh2"
kind: "vulnerability"
aliases: ["GHSA-46wx-v44x-9hh2"]
title: "`csrf()` does not check requests sent by hyperlink auditing (`text/ping`)"
severity: "medium"
cvss: 5.3
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "hono", "fixed": ["4.13.16"], "affected": "< 4.13.16", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["bun", "cloudflare-workers", "cwe-352", "deno", "hono", "node", "package"]
not_affected_if: ["firefox-only-users", "no-csrf-middleware", "no-state-changing-get-or-query-routes"]
published_at: "2026-11-01T02:38:44+00:00"
first_seen_at: "2026-11-09T22:53:17+00:00"
updated_at: "2026-11-09T22:56:32+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/honojs/hono/security/advisories/GHSA-46wx-v44x-9hh2", "first_seen_at": "2026-11-09T22:53:17+00:00"}]
exploit_sources: []
---

# `csrf()` does not check requests sent by hyperlink auditing (`text/ping`)

Link for people: https://infrastack.ai/live/GHSA-46wx-v44x-9hh2 (this .md is for agents)

The csrf() middleware in Hono only checks requests whose Content-Type is a form type, so Chromium hyperlink-auditing POSTs with text/ping skip the origin check. A malicious page visited by a logged-in user in Chrome or Edge can make the browser send a state-changing request to the application.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:hono affected < 4.13.16 fixed 4.13.16

## How to check

- Check the installed Hono version with `npm ls hono` and compare it to `4.13.16`.
- Search the app for `csrf()` from `hono/csrf` and confirm whether it relies on it for CSRF protection.
- Look for state-changing routes whose effect depends only on the path or query string.

## Fix

- `hono` `4.13.16` and later (fixed version from the product data).

## Timeline

- 2026-11-09T22:53:17+00:00 ghsa-repo https://github.com/honojs/hono/security/advisories/GHSA-46wx-v44x-9hh2

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/honojs/hono/security/advisories/GHSA-46wx-v44x-9hh2

## From the sources

### Summary

`csrf()` validates a request only when its `Content-Type` is one of the three types an HTML form can send. Chromium's hyperlink auditing (`<a ping>`) sends a cross-origin POST with the user's cookies and the content type `text/ping`, which is not in that list. The middleware does not look at `Origin` or `Sec-Fetch-Site` for such a request, so it is passed to the handler.

### Details

The middleware skips the origin check when the content type is not one that a form submission produces. The assumption was that any other content type requires a CORS preflight and therefore cannot be sent cross-origin with credentials. Hyperlink auditing is an exception: Chrome and Edge send the ping as a credentialed POST without a preflight, with a fixed body and `Content-Type: text/ping`.

A page on another origin can therefore trigger a POST to any URL of the application. The `csrf()` options for `origin` and `secFetchSite` do not change the outcome, because neither header is evaluated for the request.

The request body is fixed, so only actions whose effect does not depend on the body can be triggered. Firefox does not send pings by default. As with any CSRF, the user's cookie must be sent with the request, which with the default `SameSite=Lax` means a same-site origin or a cookie set with `SameSite=None`.

### Impact

A user who visits a malicious page in Chrome or Edge while logged in to an application protected by `csrf()` can be made to send a state-changing request to that application, such as logging out, deleting a resource, or toggling a setting that is selected by the path or query string.

This issue affects applications that rely on `csrf()` as their CSRF protection and expose state-changing endpoints whose effect does not depend on the request body.

### Workarounds

Reject requests with a `Content-Type` of `text/ping` in a middleware registered before `csrf()`, or set session cookies with `SameSite=Strict`.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
