CVE-2026-123829
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, and it is widely used for web applications and server-side development. Node.js includes an opt-in Permission Model that lets an application restrict its own access to the file system, child processes, and other capabilities at startup.
An information exposure vulnerability (CVE-2026-123829) has been identified in the Node.js Permission Model's handling of recursive fs.watch(), which allows attackers to learn the names of files and directories the process is not permitted to read. On macOS and Windows, code running under the Permission Model can watch a directory it is allowed to read and receive the names of nested files and directories whose read access is denied.
Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification, or destruction of all data or performing a business function outside the user's limits.
This issue affects multiple versions of Node.js.
Details
Module Info
- Product: Node.js
- Affected packages:
node - Affected versions: >=0.0.0 <22.23.5, >=23.0.0 <24.22.3, >=25.0.0 <26.13.1
- GitHub repository: https://github.com/nodejs/node
- Published packages: https://github.com/nodejs/node/releases/tag/v20.20.2
- Package manager: Not applicable. Node.js is distributed as runtime builds from nodejs.org rather than as a published npm package.
- Fixed in: OSS Node.js 22.23.5, 24.22.3, 26.13.1; NES for Node.js v20.20.6
Vulnerability Info
This Low-severity vulnerability is found in the node package in multiple versions of Node.js. On macOS and Windows, fs.watch() and fs.promises.watch() in recursive mode are backed by the native libuv watcher, which FSEventWrap in src/fs_event_wrap.cc wraps. When the Permission Model is enabled, FSEventWrap::Start checks kFileSystemRead once, on the watched root only:
BufferValue path(env->isolate(), args[0]);
CHECK_NOT_NULL(*path);
THROW_IF_INSUFFICIENT_PERMISSIONS(
env, permission::PermissionScope::kFileSystemRead, *path);
unsigned int flags = 0;
if (args[2]->IsTrue())
flags |= UV_FS_EVENT_RECURSIVE;With UV_FS_EVENT_RECURSIVE set, libuv reports events for descendants at any depth, passing their path relative to the watched root. FSEventWrap::OnEvent encodes that filename and hands it to the JavaScript callback without checking whether the descendant is covered by the read grant:
if (filename != nullptr) {
Local<Value> error;
MaybeLocal<Value> fn = StringBytes::Encode(env->isolate(),
filename,
wrap->encoding_,
&error);
...
argv[2] = fn.ToLocalChecked();
}
wrap->MakeCallback(env->onchange_string(), arraysize(argv), argv);A process started with --permission and an exact (non-wildcard) read grant on a directory is denied readdir on that directory's subdirectories, but a recursive watch on the granted directory still delivers names such as sub/secret.txt whenever another actor creates or changes files below it. This discloses the names of denied files and directories, and the timing of changes to them, though not their contents. On other platforms, recursive watching uses a JavaScript fallback built on the regular, permission-checked fs APIs, so only macOS and Windows are affected.
Mitigation
Node.js release lines prior to v22 are End-of-Life and will not receive any upstream updates to address this issue. For more information see here. The Node.js 23.x and 25.x release lines covered by the affected ranges are also End-of-Life.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a supported Node.js release that carries the fix (v22.23.5, v24.22.3 or v26.13.1 or later).
- Migrate affected applications away from the End-of-Life Node.js release lines.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- Trail of Bits (OpenAI) (finder)