CVE-2025-71381: Hono - Vary Header Injection in CORS Middleware
Hono before 4.10.2 (fixed in 4.10.3) contains a flaw in its CORS middleware: when the origin is not set to "", the middleware copies the Vary header from the incoming request into the response. Because Vary is a response header that should be managed by the server, an attacker can supply arbitrary Vary values that are reflected into the response, potentially causing cache key pollution and inconsistent CORS enforcement in environments that rely on shared caches or proxies.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Honoto a version that resolves this vulnerability.Fixed in 4.10.3 - Configuration
Ensure the CORS middleware does not reflect/suffix arbitrary incoming Vary header values into the response when the configured origin is not "*" (fixed behavior is included in Hono 4.10.3).
Hono CORS middleware Vary header handling = Do not copy Vary from incoming request to response when origin is not "*"
Event History
Frequently Asked Questions
What is the severity of CVE-2025-71381?
The severity of CVE-2025-71381 is medium with a CVSS score of 6.9.
How do I fix CVE-2025-71381?
To fix CVE-2025-71381, update Hono to version 4.10.3 or later.
What impact does CVE-2025-71381 have on my application?
CVE-2025-71381 allows an attacker to manipulate the Vary header in the response, potentially affecting caching mechanisms.
Which versions of Hono are affected by CVE-2025-71381?
CVE-2025-71381 affects versions of Hono prior to 4.10.2.
Is there any workaround for CVE-2025-71381 if I cannot upgrade?
If an upgrade is not possible, consider adjusting the CORS configuration to eliminate the use of the Vary header from incoming requests.