Inadequate Permission Model in Node.js Allows Unauthorized File Stats Retrieval

nodejs Updated 02 Oct 2025

Summary

10/07/2024
N/A
Yes i
Unrated
Not published

CVE-2024-22018: A vulnerability has been identified in Node.js, affecting users of the experimental permission model when the --allow-fs-read flag is used. Affects nodejs versions < 20.15.1-r0. Fixed in 20.15.1-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Node.js is a popular open-source JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to build scalable network applications and is widely used for server-side and networking applications. The experimental permission model in Node.js aims to provide enhanced security by restricting access to certain resources based on permissions. However, a vulnerability has been discovered in this model that allows unauthorized retrieval of file stats through the fs.lstat API.

Vulnerability Detail

The vulnerability arises from the inadequate permission model in Node.js when the --allow-fs-read flag is used. The model fails to properly restrict file stats retrieval, enabling malicious actors to access stats from files they do not have explicit read access to. This can lead to unauthorized access to sensitive information and potential security breaches. The vulnerability affects all users utilizing the experimental permission model in Node.js versions 20 and 21.

How To Fix

Minimum fixed version

20.15.1-r0

This is the first release that contains the fix.

sudo apk add --upgrade nodejs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, users can avoid using the experimental permission model in Node.js or refrain from using the --allow-fs-read flag. By not enabling this flag, the vulnerability can be mitigated. However, this workaround may limit certain functionalities and features provided by the experimental permission model.

Conclusion

The inadequate permission model in Node.js, specifically when using the --allow-fs-read flag, allows unauthorized retrieval of file stats. This can lead to unauthorized access to sensitive information and potential security breaches. It is recommended to upgrade to the fixed version of Node.js to mitigate the vulnerability.

See every vulnerability recorded for nodejs →

Share this vulnerability

FAQ

Node.js is an open-source JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to build scalable network applications and is widely used for server-side and networking applications.

The experimental permission model in Node.js aims to provide enhanced security by restricting access to certain resources based on permissions. It is an experimental feature that is still being developed and refined.

The vulnerability allows unauthorized retrieval of file stats through the fs.lstat API when the --allow-fs-read flag is used. This can lead to unauthorized access to sensitive information and potential security breaches.

The vulnerability affects Node.js versions 20 and 21 when the experimental permission model is used.

To fix the vulnerability, users should upgrade to Node.js version 20.15.1-r0 or later, where the issue has been addressed.

Related vulnerabilities

Recent vulnerabilities recorded for nodejs.

How To Fix

Minimum fixed version

20.15.1-r0

This is the first release that contains the fix.

sudo apk add --upgrade nodejs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback