Skip to content

Commit c5a0b73

Browse files
committed
doc: clarify EventEmitter error handling in threat model
Add documentation explaining that applications are expected to attach 'error' event handlers to EventEmitters that can emit errors, including HTTP streams. Crashes resulting from missing error handlers are not considered denial-of-service vulnerabilities in Node.js.
1 parent 95245a7 commit c5a0b73

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

SECURITY.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,18 @@ the community they pose.
335335
proper security boundaries between trusted application logic and untrusted
336336
user input.
337337

338+
#### Unhandled 'error' Events on EventEmitters (CWE-248)
339+
340+
* EventEmitters that can emit `'error'` events require the application to
341+
attach an `'error'` event handler. This includes HTTP streams and other
342+
Node.js core streams. If the application fails to attach an `'error'`
343+
handler, the EventEmitter will throw an uncaught exception, which may
344+
crash the process.
345+
* Crashes resulting from missing `'error'` handlers are not considered
346+
denial-of-service vulnerabilities in Node.js. It is the application's
347+
responsibility to properly handle errors by attaching appropriate
348+
`'error'` event listeners to EventEmitters that may emit errors.
349+
338350
## Assessing experimental features reports
339351

340352
Experimental features are eligible for security reports just like any other

0 commit comments

Comments
 (0)