GHSA-8c42-7qj2-3j46: Medium severity maven/io.netty:netty-codec-http vulnerability
Summary Netty's CorsHandler silently overwrites existing Vary headers, enabling cache poisoning and sensitive information disclosure.
Details io.netty.handler.codec.http.cors.CorsHandler#setVaryHeader overwrites any existing Vary headers set by backend applications.
java private static void setVaryHeader(final HttpResponse response) { response.headers().set(HttpHeaderNames.VARY, HttpHeaderNames.ORIGIN); }
Because set() replaces all existing values for the header, if a backend application sets a Vary header (such as Vary: Authorization or Vary: Cookie) to ensure that intermediate caches (like CDNs) cache responses separately per user, the CorsHandler will overwrite it with Vary: origin. This causes the caching proxy to ignore the authorization context and cache the response based solely on the URL and Origin, allowing an attacker to retrieve another user's cached sensitive data.
Impact This is a Cache Poisoning vulnerability that leads to Information Disclosure. It impacts any Netty-based web application that uses the CorsHandler, sets its own Vary headers to manage caching of authenticated or user-specific responses (e.g., Vary: Authorization), and is deployed behind a caching proxy or CDN. The end-users of these applications are impacted, as their sensitive data may be leaked to unauthorized actors.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/io.netty:netty-codec-httpto a version that resolves this vulnerability.Fixed in 4.1.137.Final - Upgrade
Upgrade
maven/io.netty:netty-codec-httpto a version that resolves this vulnerability.Fixed in 4.2.17.Final - Configuration
Modify/override CorsHandler behavior so setVaryHeader does not call response.headers().set("Vary","origin") (which overwrites any existing backend Vary headers like Vary: Authorization or Vary: Cookie). Instead, append/merge the origin token into the existing Vary header value so intermediate caches continue to vary by the backend’s user/auth-related contexts.
io.netty.handler.codec.http.cors.CorsHandler Vary header handling (setVaryHeader) = Preserve existing Vary values instead of overwriting with Vary: origin
Event History
Frequently Asked Questions
What is the severity of GHSA-8c42-7qj2-3j46?
The severity of GHSA-8c42-7qj2-3j46 is rated as medium with a score of 6.5.
What risks are associated with GHSA-8c42-7qj2-3j46?
GHSA-8c42-7qj2-3j46 poses risks such as cache poisoning and sensitive information disclosure due to the `CorsHandler` overwriting existing Vary headers.
How do I fix GHSA-8c42-7qj2-3j46?
To fix GHSA-8c42-7qj2-3j46, update to the latest version of the Netty library that addresses this issue.
What software is affected by GHSA-8c42-7qj2-3j46?
The affected software includes the maven/io.netty:netty-codec-http library.
What is the cause of the vulnerability in GHSA-8c42-7qj2-3j46?
The vulnerability in GHSA-8c42-7qj2-3j46 is caused by the `CorsHandler#setVaryHeader` method which silently overwrites existing Vary headers.