@@ -27,9 +27,9 @@ guidelines on how to secure a Node.js application.
2727## Threat List
2828
2929The Node.js [ threat model] [ ] defines what is or is not considered a
30- * vulnerability in Node.js itself * . Some of the topics below are not
30+ _ vulnerability in Node.js itself _ . Some of the topics below are not
3131vulnerabilities in Node.js core according to that model, but they are still
32- important * application-level * threats that you should account for when building
32+ important _ application-level _ threats that you should account for when building
3333and operating Node.js software.
3434
3535### Denial of Service of HTTP server (CWE-400)
@@ -198,7 +198,7 @@ According to the Node.js [threat model][], scenarios that require a malicious
198198third-party module are ** not** considered vulnerabilities in Node.js core,
199199because Node.js treats the code it is asked to run (including dependencies)
200200as trusted. However, malicious or compromised dependencies remain one of the
201- most critical * application-level * risks for Node.js users and should be
201+ most critical _ application-level _ risks for Node.js users and should be
202202treated as such.
203203
204204Currently, in Node.js, any package can access powerful resources such as
@@ -416,27 +416,11 @@ Assuming the following directory structure:
416416If server.js uses ` require('./auth') ` it will follow the module resolution
417417algorithm and load _ auth_ instead of _ auth.js_ .
418418
419- ** Mitigations**
420-
421- Using the [ policy mechanism with integrity checking] [ ] can avoid the above
422- threat. Configure a policy manifest that:
423-
424- - Pins the expected integrity of the modules your application should load.
425- - Maps resolution of dependencies (for example, ensuring ` ./auth ` resolves to
426- the exact ` auth.js ` file you expect).
427-
428- With such a policy enabled, attempts to load unexpected files or files whose
429- content has changed will fail integrity checks instead of being silently
430- accepted.
431-
432- Note, it's always recommended the use of ` --policy-integrity ` to avoid policy mutations.
433-
434419## Node.js Permission Model
435420
436421Node.js provides a ** permission model**
437422that can be used to restrict what a given process is allowed to do at runtime.
438- This model complements the Node.js [ threat model] [ ] and the policy mechanism
439- described above by enforcing least-privilege at the runtime level.
423+ This model complements the Node.js [ threat model] [ ] .
440424
441425When enabled (for example, using the ` --permission ` flag), the
442426permission model lets you selectively allow or deny access to sensitive
@@ -452,7 +436,7 @@ untrusted configuration, or unexpected behavior in your own code, since even
452436trusted code will be prevented from performing actions outside the permissions
453437you have explicitly granted.
454438
455- Refer to the Node.js permissions documentation for up-to-date flags and
439+ Refer to the [ Node.js permissions documentation] [ ] for up-to-date flags and
456440options.
457441
458442## Experimental Features in Production
@@ -484,6 +468,7 @@ You can also collaborate with other projects and security experts through the [O
484468[ unpublish the package ] : https://docs.npmjs.com/unpublishing-packages-from-the-registry
485469[ CWE-444 ] : https://cwe.mitre.org/data/definitions/444.html
486470[ RFC7230 ] : https://datatracker.ietf.org/doc/html/rfc7230#section-3
471+ [ Node.js permissions documentation ] : https://nodejs.org/api/permissions.html#permission-model
487472[ policy mechanism ] : https://nodejs.org/api/permissions.html#policies
488473[ typosquatting ] : https://en.wikipedia.org/wiki/Typosquatting
489474[ Mitigations for lockfile poisoning ] : https://blog.ulisesgascon.com/lockfile-posioned
@@ -496,7 +481,6 @@ You can also collaborate with other projects and security experts through the [O
496481[ CVE-2018-16487 ] : https://www.cve.org/CVERecord?id=CVE-2018-16487
497482[ scrypt ] : https://nodejs.org/api/crypto.html#cryptoscryptpassword-salt-keylen-options-callback
498483[ Module Resolution Algorithm ] : https://nodejs.org/api/modules.html#modules_all_together
499- [ policy mechanism with integrity checking ] : https://nodejs.org/api/permissions.html#integrity-checks
500484[ experimental-features ] : #experimental-features-in-production
501485[ `Socket` ] : https://socket.dev/
502486[ OpenSSF ] : https://openssf.org/
0 commit comments