undici is vulnerable to CRLF Injection via upgrade option
undici
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| undici npm |
|
|
Original description
ImpactWhen an application passes user-controlled input to the upgrade option of client.request(), an attacker can inject CRLF sequences (\r\n) to:
* Inject arbitrary HTTP headers * Terminate the HTTP request prematurely and smuggle raw data to non-HTTP services (Redis, Memcached, Elasticsearch) The vulnerability exists because undici writes the upgrade value directly to the socket without validating for invalid header characters: