Aug 17, 2026·5 min read·1 visit
Netty's CorsHandler replaces application-defined Vary headers with Origin, allowing downstream caching proxies to cache private user sessions and expose them to unauthorized clients.
A technical analysis of CVE-2026-59903 in Netty's HTTP CORS handler, where the CorsHandler overwrites existing application Vary headers with Origin, leading to unauthorized caching of sensitive information.
The affected component is io.netty.handler.codec.http.cors.CorsHandler within the Netty asynchronous, event-driven network application framework. This handler is responsible for configuring and applying Cross-Origin Resource Sharing (CORS) rules to HTTP responses. In vulnerable configurations, this component exposes an attack surface where outgoing HTTP response headers can be modified in an insecure manner.\n\nThe vulnerability belongs to the class CWE-524 (Use of Cache Containing Sensitive Information). Specifically, when processing HTTP responses, the handler replaces any existing application-defined Vary headers with a single Vary: Origin header. This behavior completely overrides critical session-partitioning attributes such as Authorization or Cookie.\n\nAs a consequence, intermediate caching proxies, reverse proxies, and Content Delivery Networks (CDNs) fail to isolate cached content based on user session credentials. This behavior allows attackers to retrieve private, authenticated responses belonging to other users who share the same origin, resulting in potential information disclosure.
The root cause of this vulnerability lies in the implementation of the private setVaryHeader method within the CorsHandler.java source file. This method is executed to automatically append CORS-related headers to outbound HTTP responses to prevent cross-origin cache poisoning.\n\nThe method is implemented using Netty's HttpHeaders API. Specifically, it invokes response.headers().set(HttpHeaderNames.VARY, HttpHeaderNames.ORIGIN). Under Netty's API contract, calling set(CharSequence name, Object value) performs two operations: it first removes all existing values associated with the header name, and then sets the header to the single new value.\n\nBy calling .set() instead of an additive function, the handler discards any existing values previously set on the Vary header by upstream handlers or backend applications. If an application developer sets Vary: Authorization, Cookie to enforce cache key segregation based on user identity, this information is wiped out, and the header is rewritten to contain only Origin.
The vulnerable implementation of setVaryHeader in CorsHandler.java uses the destructive .set() method on the HTTP headers collection. This completely replaces existing multi-value headers:\n\njava\n// Vulnerable Implementation\nprivate static void setVaryHeader(final HttpResponse response) {\n response.headers().set(HttpHeaderNames.VARY, HttpHeaderNames.ORIGIN);\n}\n\n\nThe patch introduces conditional logic to inspect the current state of the headers map. It verifies whether the value Origin is already present before applying changes, using case-insensitive comparison:\n\njava\n// Patched Implementation\nprivate static void setVaryHeader(final HttpResponse response) {\n if (!response.headers().containsValue(HttpHeaderNames.VARY, HttpHeaderNames.ORIGIN, true)) {\n response.headers().add(HttpHeaderNames.VARY, HttpHeaderNames.ORIGIN);\n }\n}\n\n\nBy substituting .set() with .add(), the framework preserves all pre-existing entries associated with the Vary header. The resulting HTTP response retains both the application's original attributes (such as Authorization or Cookie) and the necessary Origin attribute, satisfying both CORS requirements and cache partitioning controls.
The exploitation of this vulnerability is passive and relies on the interaction between a vulnerable backend application and a downstream caching mechanism, such as a CDN or a reverse proxy. No specialized payloads are sent to the backend server to trigger execution.\n\nAn attacker first identifies a target endpoint that serves sensitive, user-specific data under active caching policies (e.g., public cache-control headers). If a victim user issues an authenticated request to this endpoint, the backend application generates a response containing the user's private data, accompanied by a Vary: Authorization header to isolate the cache. When the response passes through Netty's CorsHandler, the original Vary values are overwritten with Vary: Origin.\n\nThe caching proxy receives the response and parses Vary: Origin. It caches the response, indexing it solely by the URL and the client's Origin header. When the attacker subsequently sends a request to the same URL using the same origin, the caching proxy serves the cached response belonging to the victim, exposing sensitive data.
The security impact is classified as Medium with a CVSS base score of 6.5. Because the vulnerability is situated in the networking pipeline, it can be triggered remotely without authentication, leading to high confidentiality impacts.\n\nAn attacker exploiting this flaw can systematically harvest sensitive data, personal identifiable information (PII), and session tokens belonging to other users. This is particularly critical in architectures where Netty acts as an API gateway or a reverse proxy serving multiple microservices.\n\nBecause exploitation leaves no abnormal traces in application-level logs (as the traffic is served directly from the CDN or caching proxy cache), detecting active exploitation is difficult and relies on monitoring cache hit ratios or proxy-level logging.
Detecting this vulnerability requires auditing dependencies for affected versions of the netty-codec-http library. System administrators can run dependency analyzer plugins to identify the presence of io.netty:netty-codec-http versions prior to 4.1.137.Final or 4.2.17.Final.\n\nThe primary remediation is upgrading Netty dependencies to versions 4.1.137.Final or 4.2.17.Final. For systems where immediate upgrades are not viable, virtual patching can be implemented at the reverse proxy or CDN tier.\n\nFor example, Nginx can be configured to force cache-key partitioning using custom configuration variables that append authentication parameters to the proxy cache key. Additionally, developers can insert a custom channel handler downstream of CorsHandler in the Netty pipeline to re-insert the missing Vary values.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
netty-codec-http Netty | < 4.1.137.Final | 4.1.137.Final |
netty-codec-http Netty | >= 4.2.0.Final, < 4.2.17.Final | 4.2.17.Final |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-524 |
| Attack Vector | Network |
| Attack Complexity | High |
| CVSS Score | 6.5 |
| Exploit Status | None |
| Impact | Information Disclosure / Confidentiality (High) |
The product stores sensitive information in a cache that is accessible to unauthorized actors, or does not properly isolate cached entries between different user sessions.
A high-severity logic inversion flaw in the uniget CLI completely bypasses Sigstore cryptographic signature verification on metadata files by default. If an attacker can poison the package metadata cache or repository, they can execute arbitrary OS commands under the privileges of the active user.
An uncontrolled resource consumption vulnerability in Netty's SctpMessageCompletionHandler allows unauthenticated remote attackers to cause a Denial of Service. By transmitting a series of large, fragmented Stream Control Transmission Protocol (SCTP) messages, an attacker can exhaust the Java Virtual Machine heap or direct memory. This occurs because the handler fails to enforce limits on the cumulative byte size of buffered, incomplete SCTP fragments.
A command injection bypass vulnerability exists in the Glances system monitoring tool prior to v4.5.6. This flaw permits an attacker with local process or container metadata control to bypass action-template sanitizers by reconstructing shell execution operators across adjacent unescaped variables. When a system alert triggers a configured action template, the reconstructed operators are evaluated by the underlying shell, leading to arbitrary code execution in the context of the Glances process.
Grav CMS prior to version 1.7.53 and 2.0.0-rc.8 is vulnerable to an unauthenticated remote denial of service (DoS) vulnerability. By supplying crafted query parameters with extremely large dimensions to image assets, remote unauthenticated attackers can force the server to allocate massive amounts of system memory, leading to kernel Out-Of-Memory (OOM) termination of web worker processes.
CVE-2026-53657 is a local privilege escalation vulnerability in Lima (lima-vm/lima) affecting versions prior to 2.1.3 when configured with the QEMU driver. The guest agent daemon, running as root, creates its communication socket `/run/lima-guestagent.sock` with world-writable permissions (0777). This allows unprivileged local users to command the agent to establish arbitrary tunnels, including to privileged local UNIX sockets (like D-Bus). Because the target daemon authenticates the incoming connection using the credentials of the root-owned guest agent (via SO_PEERCRED), unprivileged users can perform root operations, resulting in complete guest VM compromise.
An unauthenticated Denial of Service vulnerability exists in the s2n-quic library's CryptoStream reassembler due to a lack of buffer limits on out-of-order cryptographic frames. An attacker can transmit a crafted CRYPTO frame with an extremely high offset and nominal payload, forcing the receiver to execute unbounded memory allocations and causing service crashes.