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 "*"