Skip to content

GHSA-4w7w-5xrc-9h26 CVE-2026-109829

undici vulnerable to cache poisoning and cross-user disclosure via cross-origin redirects

Critical npm
Severity
7.4 / 10
Critical · CVSS 3.1
Exploit chance (EPSS)
0.15%
Chance of exploitation in the next 30 days. Higher than 4.06% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-346 Origin Validation Error
CWE-524 Use of Cache Containing Sensitive Information
Fix
7.30.1
Upgrade undici to this version or later

Description

Impact

When an originless Agent composes the redirect and cache interceptors as compose(redirect(), cache()) with a shared cache (type: 'shared'), the cache builds its key from the original request URL before the redirect handler changes the origin. The response produced after a redirect is then stored under the original key, even when the redirect crossed to a different origin.

An attacker who controls the target of a redirect from a trusted URL can have their response cached under that trusted URL. A later caller requesting the trusted URL receives the attacker's body from the shared cache without either origin being contacted, allowing persistent cache poisoning. The same key confusion also discloses private data: when an authenticated request returns a private, no-store redirect to a user-specific resource, the final response is stored under the original URL and can be served to a later unauthenticated caller.

The cache interceptor was introduced in undici 7.0.0, and all 7.x and 8.x releases before the patched versions are affected. Applications are affected only when an originless Agent, a shared MemoryCacheStore or SqliteCacheStore, and the composition compose(redirect(), cache()) are all used. Origin-bound Client and Pool dispatchers, and the reverse composition compose(cache(), redirect()), are not affected.

Patches

Upgrade to 7.30.1 or 8.12.2. Before storing a response, undici now verifies that the origin that produced it still matches the cache key, and preserves each redirect hop's cache-control policy, so cross-origin redirect responses and responses behind a no-store or private hop are no longer cached under the original key.

Workarounds

Compose the interceptors as compose(cache(), redirect()), use per-origin dispatchers and cache stores, or disable shared caching on redirect-capable requests.

Affected versions

npm

PackageVulnerableFixed in
undici
>= 7.0.0, < 7.30.1
7.30.1
undici
>= 8.0.0, < 8.12.2
8.12.2
undici
>= 7.0.0, < 7.30.1
7.30.1
undici
>= 8.0.0, < 8.12.2
8.12.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

undici npm → 7.30.1

npm
npm install undici@7.30.1
yarn
yarn add undici@7.30.1
pnpm
pnpm add undici@7.30.1

Severity breakdown

CVSS 3.1 7.4

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Weakness

CWE-346: Origin Validation Error

The product does not properly verify that the source of data or communication is valid.

CWE-524: Use of Cache Containing Sensitive Information

The code uses a cache that contains sensitive information, but the cache can be read by an actor outside of the intended control sphere.

How to prevent it
  • Architecture and Design: Protect information stored in cache.
  • Architecture and Design: Do not store unnecessarily sensitive information in the cache.
  • Architecture and Design: Consider using encryption in the cache.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-55wc-3pg8-jfw6
undici vulnerable to Denial of Service via unhandled exception in the decompress interceptor
High Also affects undici
GHSA-qrxm-fqhp-jwvm
undici vulnerable to Denial of Service via TLS 1.2 certificate-changing renegotiation
High Also affects undici
GHSA-9fm3-97px-rjf6
undici WebSocket client vulnerable to Denial of Service via unbounded automatic PONG buffering
High Also affects undici
GHSA-4qv8-2p9j-2685
undici vulnerable to Denial of Service via unbounded memory in the EventSource parser
High Also affects undici
GHSA-xjj6-f33q-929c
undici vulnerable to Denial of Service via unhandled error on excessive content-encodings
High Also affects undici
GHSA-f72v-6w45-q472
undici vulnerable to Subresource Integrity bypass via non-lowercase algorithm tokens
High Also affects undici
GHSA-2m5v-pch6-74hx
undici vulnerable to TLS certificate validation bypass via dropped tls options in Agent
Critical Also affects undici
GHSA-qq8j-7v2v-3rwp
undici WebSocket client vulnerable to Denial of Service via failed HTTP/2 handshake
High Also affects undici

Credits: Kushalkhemka, UlisesGascon, bengsky13, mayank-jangid-moon, mcollina, opensec-intelligence, skigeek16

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor