CVE-2023-32005 Overview
A vulnerability has been identified in Node.js version 20, affecting users of the experimental permission model when the --allow-fs-read flag is used with a non-* argument. This flaw arises from an inadequate permission model that fails to restrict file stats through the fs.statfs API. As a result, malicious actors can retrieve stats from files that they do not have explicit read access to.
This vulnerability affects all users using the experimental permission model in Node.js 20. It is important to note that at the time this CVE was issued, the permission model was an experimental feature of Node.js.
Critical Impact
Attackers can bypass the experimental permission model to access file system statistics from files they should not have access to, potentially revealing sensitive information about the file system structure and storage allocation.
Affected Products
- Node.js version 20.x (experimental permission model)
- Systems using the --allow-fs-read flag with specific path arguments
- Applications relying on the experimental permission model for file system access control
Discovery Timeline
- 2023-09-12 - CVE CVE-2023-32005 published to NVD
- 2025-05-05 - Last updated in NVD database
Technical Details for CVE-2023-32005
Vulnerability Analysis
This vulnerability is classified under CWE-732 (Incorrect Permission Assignment for Critical Resource). The core issue lies in how Node.js's experimental permission model handles the fs.statfs API. When users configure the permission model with the --allow-fs-read flag to restrict file system access to specific paths, the fs.statfs function does not properly respect these restrictions.
The permission model was designed to provide a security boundary that limits which files and directories a Node.js application can access. However, the fs.statfs API was not integrated with this permission checking mechanism, creating a gap in the security model that allows information disclosure.
Root Cause
The root cause of this vulnerability stems from an incomplete implementation of the permission model in Node.js 20. When the experimental permission model was developed, the fs.statfs API was not included in the permission checks that govern file system operations. This oversight allows the API to return file system statistics regardless of the restrictions specified through the --allow-fs-read flag.
The fs.statfs function returns information about the mounted file system containing a specified path, including details such as block size, total blocks, free blocks, and other file system metadata. Without proper permission enforcement, this information can be extracted for any file path, even those outside the permitted scope.
Attack Vector
The attack vector for this vulnerability is network-based and requires no authentication or user interaction. An attacker who can execute JavaScript code within a Node.js application that uses the experimental permission model can exploit this vulnerability by calling fs.statfs with arbitrary file paths.
The exploitation is straightforward—an attacker simply calls the fs.statfs function with a path that should be restricted according to the permission model configuration. Because the permission check is absent for this specific API, the function returns the file system statistics without validating whether the caller has read access to the specified path.
For detailed technical information about this vulnerability, refer to the HackerOne Report #2051224.
Detection Methods for CVE-2023-32005
Indicators of Compromise
- Unexpected calls to fs.statfs or fs.statfsSync APIs targeting paths outside the configured --allow-fs-read scope
- Application logs showing file system statistics queries for sensitive directories such as /etc, /root, or other restricted paths
- Anomalous patterns of file system metadata collection that do not align with legitimate application behavior
Detection Strategies
- Implement application-level logging to track all fs.statfs and fs.statfsSync API calls and their target paths
- Deploy runtime application self-protection (RASP) solutions to monitor Node.js API calls and flag suspicious file system operations
- Use SentinelOne's behavioral detection to identify patterns consistent with information gathering through file system statistics
Monitoring Recommendations
- Monitor Node.js applications for calls to fs.statfs with paths outside the expected application scope
- Establish baseline behavior for legitimate file system operations and alert on deviations
- Review and audit applications using the experimental permission model to ensure they are not exposed to untrusted input
How to Mitigate CVE-2023-32005
Immediate Actions Required
- Upgrade Node.js to the latest patched version that addresses this permission model bypass
- If upgrading is not immediately possible, avoid relying on the experimental permission model as a security boundary
- Implement additional application-level checks before calling fs.statfs to validate the requested path against permitted locations
- Consider using containerization or operating system-level sandboxing as an additional layer of file system access control
Patch Information
Node.js has addressed this vulnerability in subsequent releases. Users should upgrade to the latest stable version of Node.js 20.x or newer that includes the fix for this permission model bypass. Refer to the NetApp Security Advisory NTAP-20231103-0004 for additional vendor-specific guidance.
Workarounds
- Do not rely solely on the experimental permission model for security-critical applications until the feature is considered stable
- Implement wrapper functions around fs.statfs that enforce your own path validation before calling the underlying API
- Use operating system-level permissions (file ownership, SELinux, AppArmor) as the primary access control mechanism
- Consider running Node.js applications in isolated containers with restricted file system access
# Example: Running Node.js with restricted file system access using a container
# This provides OS-level isolation independent of Node.js permission model
# Create a container with limited file system visibility
docker run --read-only \
--tmpfs /tmp:rw,noexec,nosuid \
-v /app/data:/app/data:ro \
node:20 node --experimental-permission \
--allow-fs-read=/app/data your-app.js
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

