VDB
Sign up
MEDIUM5.9

GHSA-pmjh-fq2x-6v4x

undici vulnerable to Denial of Service via orphaned RetryHandler response body

Quick fix

GHSA-pmjh-fq2x-6v4x — undici: upgrade to the fixed version with the command below.

npm install undici@7.29.1

Details

### Impact

undici's `RetryHandler` can leave a response body pending indefinitely. When a retried request receives a non-retryable response after a truncated one, the original `response.body` held by the application is never settled, so reads such as `response.body.text()` hang and `bodyTimeout` does not fire. A malicious server can repeat this to accumulate pending promises and streams, leading to denial of service.

### Patches

Patched in undici v7.29.1 and v8.10.2.

### Workarounds

Impose an independent request deadline and destroy the response body when it expires. `bodyTimeout` alone does not prevent this.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm/undici
Introduced in: 7.11.0Fixed in: 7.29.1
Fixnpm install undici@7.29.1
npm/undici
Introduced in: 8.0.0Fixed in: 8.10.2
Fixnpm install undici@8.10.2

References