undici vulnerable to cache poisoning and cross-user disclosure via a protocol-relative redirect path
Description
Impact
The fix for the cross-origin redirect cache poisoning issues (CVE-2026-109829, CVE-2026-116592) stores a response only when every hop in the redirect history is on the cache key's origin. undici records each hop from the request path with new URL(path, origin), which mis-parses a path beginning with //: a Location of http://attacker//trusted/x sends the request to the attacker origin with the path //trusted/x, but new URL('//trusted/x', 'http://attacker') reads that path as a protocol-relative URL and records the hop as http://trusted/x. The every-hop origin check then sees only same-origin hops.
An attacker who controls the target of a redirect from a trusted URL can again 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, and with SqliteCacheStore the entry survives restarts. The same mis-recorded history also lets a cross-origin 304 revalidate the trusted entry.
Applications are affected only when a shared MemoryCacheStore or SqliteCacheStore and the composition compose(redirect(), cache()) are used, and the trusted origin redirects to a URL the attacker controls (for example through an open redirect).
Patches
Upgrade to undici 7.30.4 or 8.14.1. undici now records each redirect hop from the origin and path the request was actually sent to, so a path beginning with // is recorded as a hop to the attacker's origin and the every-hop origin check rejects it.
Workarounds
Use per-origin dispatchers and cache stores, or disable shared caching on redirect-capable requests.