{"id":"GHSA-q223-fc7f-xg75","kind":"vulnerability","aliases":["GHSA-q223-fc7f-xg75"],"related":[],"title":"Process crash when a handler returns a stream that fails before it is read","description":"| Field | Value |\n| --- | --- |\n| Ecosystem | npm |\n| Package | `@nestjs/core` |\n| Affected versions | `>= 12.4.0, < 12.5.0` |\n| Patched versions | `12.5.0` |\n| Severity | High |\n| CVSS v3.1 | `AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H` (7.5) |\n| CWE | CWE-248 (Uncaught Exception) |\n\n### Summary\n\nSince 12.4.0, a route handler may return a Node.js `Readable` stream. A stream that failed before it was read, for example `fs.createReadStream()` of a file that does not exist, raised an error that nothing handled, which terminated the process. A single `HEAD` request, or a client that disconnected before the first chunk, was enough.\n\n### Impact\n\nApplications on 12.4.x that return a `Readable` from a handler, for a path a client can influence, and bind no interceptor to that route are affected, on every HTTP adapter. No authentication is needed unless a guard protects the route. Versions before 12.4.0 do not support returning a `Readable` this way.\n\n### Patches\n\nFixed in **12.5.0**. The router now handles the errors of every stream it holds, including streams it stops without reading.\n\n### Workarounds\n\nWrap the stream in a `StreamableFile`, or check that the file exists before opening the stream.\n\n### Credit\n\nReported by Anthropic's OSS Scanner.","summary":"When a NestJS route handler returns a Node.js Readable stream that fails before it is read, such as a missing file, the error goes unhandled and terminates the process. A single HEAD request or an early client disconnect is enough to crash the server.","severity":"high","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"@nestjs/core","fixed":["12.5.0"],"affected":">= 12.4.0, < 12.5.0","ecosystem":"npm"}],"ecosystems":["npm"],"tags":["cwe-248","nestjs","node","npm","package","self-hosted"],"not_affected_if":["no-readable-return","pre-12.4.0","streamable-file"],"how_to_check":"- Check the installed version with `npm ls @nestjs/core`; affected versions are `>= 12.4.0, < 12.5.0`.\n- Search the code for route handlers that return a `Readable` (for example `fs.createReadStream`) on paths a client can influence, without a `StreamableFile` wrapper or an interceptor on that route.","fix":"- `@nestjs/core`: `12.5.0`\n- Workaround named in the advisory: wrap the stream in a `StreamableFile`, or check that the file exists before opening the stream.","status":"open","published_at":"2026-11-12T19:03:53+00:00","first_seen_at":"2026-11-12T19:14:24+00:00","triaged_at":"2026-11-12T19:15:45+00:00","updated_at":"2026-11-12T19:15:45+00:00","category":"package","confidence":0.85,"triage":{"at":"2026-11-12T19:15:45Z","model":"claude-haiku-5-5","output":{"fix":"- `@nestjs/core`: `12.5.0`\n- Workaround named in the advisory: wrap the stream in a `StreamableFile`, or check that the file exists before opening the stream.","reach":"internet","title":"NestJS core: unhandled stream error from a handler crashes the Node process","impact":"medium","summary":"When a NestJS route handler returns a Node.js Readable stream that fails before it is read, such as a missing file, the error goes unhandled and terminates the process. A single HEAD request or an early client disconnect is enough to crash the server.","audience":"developers","category":"package","nicknames":[],"who_cares":["nestjs","node","npm","self-hosted"],"confidence":0.85,"fix_status":"available","needs_auth":"no","worst_case":"Any unauthenticated request crashes the whole Node process","analyst_note":"","how_to_check":"- Check the installed version with `npm ls @nestjs/core`; affected versions are `>= 12.4.0, < 12.5.0`.\n- Search the code for route handlers that return a `Readable` (for example `fs.createReadStream`) on paths a client can influence, without a `StreamableFile` wrapper or an interceptor on that route.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["pre-12.4.0","streamable-file","no-readable-return"],"who_is_affected":"Applications on @nestjs/core 12.4.x that return a Readable stream from a route handler, for a path a client can influence, and that bind no interceptor to that route. The flaw applies on every HTTP adapter. Applications on versions before 12.4.0 do not support returning a Readable this way, and routes whose streams are wrapped in StreamableFile or checked for existence first are not exposed.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000819,"input_tokens":5009,"output_tokens":637,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-248':27B,108C '12.4':169C '12.4.0':87C,113C,210C '12.5.0':88C,91C,222C '7.5':105C 'adapt':197C 'affect':85C,193C 'anthrop':260C 'applic':167C 'authent':199C 'av':96C 'bind':186C 'check':248C 'chunk':163C 'client':71B,157C,182C 'crash':2A,76B 'credit':257C 'cvss':94C 'cwe':26B,106C,107C 'disconnect':72B,159C 'earli':70B 'ecosystem':81C 'enough':74B,165C 'error':57B,143C,228C 'everi':195C,230C 'exampl':132C 'except':110C 'exist':140C,252C 'fail':10A,46B,126C 'fc7f':18A,23A 'field':79C 'file':55B,136C,251C 'first':162C 'fix':220C 'fs.createreadstream':133C 'ghsa':16A,21A 'ghsa-q223-fc7f-xg75':15A,20A 'goe':58B 'guard':204C 'h':104C 'handl':146C,226C 'handler':5A,39B,116C,177C 'head':66B,153C 'high':93C 'hold':233C 'host':34B 'http':196C 'impact':166C 'includ':234C 'influenc':184C 'interceptor':188C 'l/pr':98C 'may':117C 'miss':54B 'n/a':103C 'n/ac':97C 'n/i':102C 'n/s':100C 'n/ui':99C 'need':201C 'nestj':28B,37B 'nestjs/core':25A,84C 'node':29B 'node.js':42B,120C 'noth':145C 'npm':30B,82C 'open':254C 'oss':262C 'packag':31B,83C 'patch':89C,219C 'path':180C 'process':1A,63B,150C 'protect':205C 'q223':17A,22A 'rais':141C 'read':14A,50B,130C,239C 'readabl':43B,121C,174C,216C 'report':258C 'request':67B,154C 'return':6A,40B,118C,172C,214C 'rout':38B,115C,191C,207C 'router':224C 'scanner':263C 'self':33B 'self-host':32B 'server':78B 'sever':92C 'sinc':112C 'singl':65B,152C 'stop':237C 'stream':8A,44B,122C,124C,231C,235C,243C,256C 'streamablefil':246C 'summari':111C 'support':213C 'termin':61B,148C 'u/c':101C 'uncaught':109C 'unhandl':59B 'unless':202C 'v3.1':95C 'valu':80C 'version':86C,90C,208C 'way':218C 'without':238C 'workaround':240C 'wrap':241C 'x':170C 'xg75':19A,24A","nicknames":[],"mitigations":[],"who_affected":"Applications on @nestjs/core 12.4.x that return a Readable stream from a route handler, for a path a client can influence, and that bind no interceptor to that route. The flaw applies on every HTTP adapter. Applications on versions before 12.4.0 do not support returning a Readable this way, and routes whose streams are wrapped in StreamableFile or checked for existence first are not exposed.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["core"],"ptokens":["core","nestjs"],"labels":["cwe248","high","nestjs","node","npm","package","selfhosted"],"campaign_type":null,"search_a":"'crash':2A 'fail':10A 'fc7f':18A,23A 'ghsa':16A,21A 'ghsa-q223-fc7f-xg75':15A,20A 'handler':5A 'nestjs/core':25A 'process':1A 'q223':17A,22A 'read':14A 'return':6A 'stream':8A 'xg75':19A,24A","search_b":"'-248':27B 'client':71B 'crash':76B 'cwe':26B 'disconnect':72B 'earli':70B 'enough':74B 'error':57B 'fail':46B 'file':55B 'goe':58B 'handler':39B 'head':66B 'host':34B 'miss':54B 'nestj':28B,37B 'node':29B 'node.js':42B 'npm':30B 'packag':31B 'process':63B 'read':50B 'readabl':43B 'request':67B 'return':40B 'rout':38B 'self':33B 'self-host':32B 'server':78B 'singl':65B 'stream':44B 'termin':61B 'unhandl':59B","search_c":"'-248':108C '12.4':169C '12.4.0':87C,113C,210C '12.5.0':88C,91C,222C '7.5':105C 'adapt':197C 'affect':85C,193C 'anthrop':260C 'applic':167C 'authent':199C 'av':96C 'bind':186C 'check':248C 'chunk':163C 'client':157C,182C 'credit':257C 'cvss':94C 'cwe':106C,107C 'disconnect':159C 'ecosystem':81C 'enough':165C 'error':143C,228C 'everi':195C,230C 'exampl':132C 'except':110C 'exist':140C,252C 'fail':126C 'field':79C 'file':136C,251C 'first':162C 'fix':220C 'fs.createreadstream':133C 'guard':204C 'h':104C 'handl':146C,226C 'handler':116C,177C 'head':153C 'high':93C 'hold':233C 'http':196C 'impact':166C 'includ':234C 'influenc':184C 'interceptor':188C 'l/pr':98C 'may':117C 'n/a':103C 'n/ac':97C 'n/i':102C 'n/s':100C 'n/ui':99C 'need':201C 'nestjs/core':84C 'node.js':120C 'noth':145C 'npm':82C 'open':254C 'oss':262C 'packag':83C 'patch':89C,219C 'path':180C 'process':150C 'protect':205C 'rais':141C 'read':130C,239C 'readabl':121C,174C,216C 'report':258C 'request':154C 'return':118C,172C,214C 'rout':115C,191C,207C 'router':224C 'scanner':263C 'sever':92C 'sinc':112C 'singl':152C 'stop':237C 'stream':122C,124C,231C,235C,243C,256C 'streamablefil':246C 'summari':111C 'support':213C 'termin':148C 'u/c':101C 'uncaught':109C 'unless':202C 'v3.1':95C 'valu':80C 'version':86C,90C,208C 'way':218C 'without':238C 'workaround':240C 'wrap':241C 'x':170C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-12T19:03:53+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"ghsa-repo","external_id":"GHSA-q223-fc7f-xg75","url":"https://github.com/nestjs/nest/security/advisories/GHSA-q223-fc7f-xg75","severity":"high","published_at":"2026-11-12T19:03:53+00:00","modified_at":"2026-11-12T19:03:53+00:00","first_seen_at":"2026-11-12T19:14:24+00:00","fetched_at":"2026-11-12T19:14:24+00:00","note":null}],"documents":[{"id":137720,"url":"https://github.com/nestjs/nest/security/advisories/GHSA-q223-fc7f-xg75","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa-repo","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}