Fedora Account System
Red Hat Associate
Red Hat Customer
Netty's CorsHandler does not add a Vary: Origin header to responses when the request carries the literal Origin value "null" and the opt-in null-origin configuration is enabled (CorsConfigBuilder.allowNullOrigin()). The other origin-matching branches, which echo a specific origin or an any-origin value with credentials, do add Vary. In the null-origin branch the handler sets Access-Control-Allow-Origin: null and returns without it. This applies to both simple responses and preflight responses. Because the response differs by Origin for the same URL but does not say so, a shared cache (CDN, reverse proxy or forward proxy) that honors Vary may store the null-origin response keyed only by URL. It can then serve that response to requests from other origins. An attacker can trigger this by sending a request with Origin: null to a cacheable URL, which a sandboxed document or any raw HTTP client can do. The impact is cache poisoning of CORS headers. The legitimate origin may receive a response with a mismatched Access-Control-Allow-Origin value, so the browser blocks its requests. If the response body varies by session or user and the deployment has no other cache isolation, one requester's cached response may be disclosed to a different origin or user. Affected are users of netty-codec-http that use CorsHandler with a CorsConfig that enables allowNullOrigin and place the service behind a shared cache that honors Vary. Versions up to and including 4.1.138.Final, and 4.2.0.Final through 4.2.18.Final, are affected. The issue is fixed in 4.1.139.Final and 4.2.19.Final. Affected versions: >= 4.2.0.Final, <= 4.2.18.Final; <=4.1.138.Final Patched versions: 4.2.19.Final; 4.1.139.Final CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N (5.3) CWE: CWE-346 Upstream advisory: https://github.com/netty/netty/security/advisories/GHSA-x9f7-rg73-4rp6 CVE requested by the Netty Project via PSIRTSUPT-32166.