From f418fcc635e435a3a2c88b3efc145b4300c962bc Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Mon, 29 Dec 2025 21:07:14 -0300 Subject: [PATCH] doc: clarify threat model for application-level API exposure Add examples of non-vulnerabilities when applications expose Node.js APIs to untrusted users without proper security boundaries. PR-URL: https://github.com/nodejs/node/pull/61184 Reviewed-By: Aviv Keller Reviewed-By: Chengzhong Wu Reviewed-By: Matteo Collina Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Marco Ippolito --- SECURITY.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/SECURITY.md b/SECURITY.md index a641148bcea..2270a0161fe 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -309,6 +309,32 @@ the community they pose. Node.js releases won't be affected by such vulnerabilities. Users are responsible for keeping the software they use through Corepack up-to-date. +#### Exposing Application-Level APIs to Untrusted Users (CWE-653) + +* Node.js trusts the application code that uses its APIs. When application code + exposes Node.js functionality to untrusted users in an unsafe manner, any + resulting crashes, data corruption, or other issues are not considered + vulnerabilities in Node.js itself. It is the application's responsibility to: + * Validate and sanitize all untrusted input before passing it to Node.js APIs. + * Design appropriate access controls and security boundaries. + * Avoid exposing low-level or dangerous APIs directly to untrusted users. + +* Examples of scenarios that are **not** Node.js vulnerabilities: + * Allowing untrusted users to register SQLite user-defined functions that can + perform arbitrary operations (e.g., closing database connections during query + execution, causing crashes or use-after-free conditions). + * Exposing `child_process.exec()` or similar APIs to untrusted users without + proper input validation, allowing command injection. + * Allowing untrusted users to control file paths passed to file system APIs + without validation, leading to path traversal issues. + * Permitting untrusted users to define custom code that executes with the + application's privileges (e.g., custom transforms, plugins, or callbacks). + +* These scenarios represent application-level security issues, not Node.js + vulnerabilities. The root cause is the application's failure to establish + proper security boundaries between trusted application logic and untrusted + user input. + ## Assessing experimental features reports Experimental features are eligible for security reports just like any other