{"id":"GHSA-4992-7rv2-5pvq","revision":"3d278988ec9544d79106eafb76ba9abf","records":[{"revision":"3d278988ec9544d79106eafb76ba9abf","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-4992-7rv2-5pvq","aliases":["CVE-2026-1527"],"title":"Undici has CRLF Injection in undici via `upgrade` option","description":"### Impact\n\nWhen an application passes user-controlled input to the `upgrade` option of `client.request()`, an attacker can inject CRLF sequences (`\\r\\n`) to:\n\n1. Inject arbitrary HTTP headers\n2. Terminate the HTTP request prematurely and smuggle raw data to non-HTTP services (Redis, Memcached, Elasticsearch)\n\nThe vulnerability exists because undici writes the `upgrade` value directly to the socket without validating for invalid header characters:\n\n```javascript\n// lib/dispatcher/client-h1.js:1121\nif (upgrade) {\n  header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n}\n```\n\n### Patches\n\n Patched in the undici version v7.24.0 and v6.24.0. Users should upgrade to this version or later.\n\n### Workarounds\n\nSanitize the `upgrade` option string before passing to undici:\n\n```javascript\nfunction sanitizeUpgrade(value) {\n  if (/[\\r\\n]/.test(value)) {\n    throw new Error('Invalid upgrade value')\n  }\n  return value\n}\n\nclient.request({\n  upgrade: sanitizeUpgrade(userInput)\n})\n```","state":0,"publishedAt":"2026-03-13T20:41:26+00:00","modifiedAt":"2026-09-10T03:50:37.2469207+00:00","affected":[{"ecosystem":"npm","name":"undici","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"6.24.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"undici","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"7.0.0"},{"kind":"fixed","version":"7.24.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/nodejs/undici/security/advisories/GHSA-4992-7rv2-5pvq","https://nvd.nist.gov/vuln/detail/CVE-2026-1527","https://hackerone.com/reports/3487198","https://cna.openjsf.org/security-advisories.html","https://github.com/nodejs/undici"],"sourceUrl":"https://github.com/advisories/GHSA-4992-7rv2-5pvq","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-4992-7rv2-5pvq","identifiers":["GHSA-4992-7rv2-5pvq","CVE-2026-1527"]},"retained":false,"historicalAffected":[]}],"coverage":[]}