CVE-2026-123829: Node.js is vulnerable to Permission Model file-name disclosure via recursive fs.watch
A Permission Model bypass in Node.js recursive file watching discloses the names of files and directories the process is not permitted to read. On macOS and Windows, fs.watch() and fs.promises.watch() in recursive mode are backed by the native libuv watcher: FSEventWrap::Start checks kFileSystemRead only once, on the watched root, and FSEventWrap::OnEvent then forwards every filename libuv reports (relative paths at any depth) to the JavaScript callback without checking that each path is covered by the read grant. Code running under --permission with an exact read grant on a directory can therefore learn names such as sub/secret.txt even though readdir on that subdirectory is denied. The flaw exposes names and timing metadata, not file contents, and requires macOS or Windows plus files created under the watched directory by another actor.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 22.23.5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 26.13.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 24.22.3 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 22.23.5Fixed in 24.22.3Fixed in 26.13.1 - Upgrade
Upgrade
alpine/nodejsto a version that resolves this vulnerability.Fixed in 22.23.5-r0 - Upgrade
Upgrade
alpine/nodejsto a version that resolves this vulnerability.Fixed in 24.22.3-r0
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
Which deployments are exposed?
Affected deployments run Node.js 22.x, 24.x, or 26.x on macOS or Windows and use recursive fs.watch() or fs.promises.watch() while the Permission Model is enabled. The issue requires an exact read grant on the watched root directory.
What must an attacker be able to do?
The attacker needs code execution in the Node.js process with its existing permission grants, so it can register a recursive watcher on the permitted root. Files or directories must then be created beneath that root by another actor for their names and timing metadata to be disclosed.
What information can be exposed?
The watcher can receive names of files and directories at deeper paths that are not covered by the process's read grant, such as sub/secret.txt. The issue does not disclose file contents.
How can exposure be reduced before updating?
Avoid recursive fs.watch() and fs.promises.watch() on macOS and Windows when running with an exact read grant on a directory. Where recursive watching is required, do not run untrusted or less-trusted code in that permission-constrained process.
How can I determine whether an application is affected?
Review Node.js processes using --permission for recursive fs.watch() or fs.promises.watch() calls on macOS or Windows. Affected behavior is present if a process granted read access only to a root directory receives watcher events naming entries inside a subdirectory for which readdir is denied.