GHSA-4w7w-5xrc-9h26: SQL Injection

Published Oct 27, 2026
·
Updated

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 Software

2 affected componentsFixes available
npm/undici>=8.0.0<8.12.2
8.12.2
npm/undici>=7.0.0<7.30.1
7.30.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/undici to a version that resolves this vulnerability.

    Fixed in 8.12.2
  2. Upgrade

    Upgrade npm/undici to a version that resolves this vulnerability.

    Fixed in 7.30.1
  3. Upgrade

    Upgrade undici to a version that resolves this vulnerability.

    Fixed in 7.30.1
  4. Upgrade

    Upgrade undici to a version that resolves this vulnerability.

    Fixed in 8.12.2
  5. Configuration

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

    undici cache and redirect interceptors interceptor composition = compose(cache(), redirect())

Event History

Oct 27, 2026
Advisory Published
via GitHub·07:02 PM
Data Sourced
via GitHub·07:02 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are affected?

An application is affected only if it uses an originless Agent, a shared MemoryCacheStore or SqliteCacheStore, and composes the interceptors as compose(redirect(), cache()). The issue applies to Undici 7.x and 8.x releases before the patched versions.

2

What does an attacker need to exploit the cache poisoning behavior?

The attacker must control the target of a redirect from a trusted URL. Their response can then be cached under the trusted URL's original cache key and served to later callers without contacting either origin.

3

Can this issue expose authenticated data to unauthenticated callers?

Yes. If an authenticated request receives a private, no-store redirect to a user-specific resource, the final response can be stored under the original URL and later served from the shared cache to an unauthenticated caller.

4

How can I determine whether my application is exposed?

Review the Agent and interceptor setup for an originless Agent using a shared MemoryCacheStore or SqliteCacheStore with redirect() placed before cache() in compose(redirect(), cache()). Also determine whether the deployed Undici version is in the affected 7.x or 8.x ranges before the patched releases.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203