undici vulnerable to cross-user information disclosure and parse-time crash via degenerate private cache directives
Summary
Two issues in undici's cache interceptor, both fixed by the same patch on lib/util/cache.js:
- Shared-cache disclosure: Responses with malformed qualified
Cache-Control: privatedirectives such asprivate=""orprivate=","can be incorrectly stored in the default shared cache, then served to a later caller with the same cache key. - Parse-time crash: Mixed unqualified-and-qualified
privatedirectives in the same header (such aspublic, max-age=60, private, private="hdr") cause an uncaughtTypeErrorin the cache-control parser, terminating the request.
Impact
Shared-cache disclosure
Applications using interceptors.cache() in shared mode may cache a user-specific response and serve it to a later caller with the same cache key. This can disclose private response bodies and headers, including Set-Cookie.
Required conditions:
- the cache interceptor is enabled in shared mode, including the default configuration;
- an upstream returns a malformed directive such as
Cache-Control: public, max-age=300, private=""; - another request later matches the same cache key, without a separating
Varyheader.
Parse-time crash
Applications using interceptors.cache() against an upstream that returns a Cache-Control header combining unqualified private with qualified private="..." see an uncaught TypeError: output.private.concat is not a function during response handling. The request rejects; depending on the consumer's error handling, the process may exit.
Details
private="" is parsed as { private: [''] }. The shared-cache guard only rejects private === true, so the response can be stored. When served from cache, the previous user's body and headers may be returned to a different user.
For the crash variant, an unqualified private directive sets output.private = true, then a subsequent qualified private="hdr" directive attempts output.private.concat(['hdr']), which throws because boolean has no concat method.
The patch routes the qualified-directive path through a shared helper that normalizes empty-after-trim arrays to true and preserves existing true values, closing both vectors.
Patches
Upgrade to undici 7.29.0 or 8.9.0. Both releases fix the qualified private directive handling that caused the shared-cache storage and the parser crash.
Workarounds
Until patched, avoid shared interceptors.cache() for user-specific responses, use type: 'private', or disable caching for affected origins.
Credit
Disclosure variant reported by @h0rk1p via HackerOne report #3817497.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | undici | >= 7.0.0, < 7.29.0, >= 8.0.0, < 8.9.0 | 7.29.0, 8.9.0 |
References
- https://github.com/nodejs/undici/security/advisories/GHSA-4cwx-7wf7-3272
- https://nvd.nist.gov/vuln/detail/CVE-2026-13697
- https://github.com/nodejs/undici/commit/4fe5bc5fefe5ac81a200fc8e1cf84b8bf8464451
- https://cna.openjsf.org/security-advisories.html
- https://github.com/nodejs/undici
- https://github.com/nodejs/undici/releases/tag/v7.29.0
- https://github.com/nodejs/undici/releases/tag/v8.9.0
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H- Weakness (CWE)
CWE-200, CWE-248, CWE-525- Platform
- npm
- Package
undici- Disclosed
- 03.08.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-4cwx-7wf7-3272 - CC BY 4.0
Vulnerability history: undici
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 46
- First → latest
- 06.2022 09.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 13
- Medium 21
- Low 12
Disclosures per year
- 2022: 5
- 2023: 3
- 2024: 5
- 2025: 2
- 2026: 31
-
undici vulnerable to cross-user information disclosure and parse-time crash via degenerate private cache directives this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.