CVE-2024-21896

The permission model protects itself against path traversal attacks by calling path.resolve() on any paths given by the user

High · published February 20, 2024

CVSS v3.0
7.9
EPSS
1%
Percentile
69.4
In the wild
Unconfirmed
What it is

⚡ A crafty monkey-patch can turn a safe path resolution into a sneaky path traversal vulnerability! The experimental permission model in Node.js 20 and 21 is letting mischief through its cracks. 🔥 Think of it like a restaurant that has a strict kitchen policy. If a waiter can secretly rewrite the recipes, they could serve up whatever they want, even dishes that shouldn't exist on the menu! An attacker could exploit this flaw to navigate the file system without permission, allowing them to read sensitive files or even execute malicious scripts. The consequences could be absolutely devastating for your application’s integrity and user data!

Put simply

Think of it like a restaurant that has a strict kitchen policy. If a waiter can secretly rewrite the recipes, they could serve up whatever they want, even dishes that shouldn't exist on the menu! This vulnerability arises from the ability to monkey-patch the Buffer internals, specifically Buffer.prototype.utf8Write. By altering the output of path.resolve(), an attacker can bypass the intended security of the permission model and execute path traversal attacks.

What to do

An attacker could exploit this flaw to navigate the file system without permission, allowing them to read sensitive files or even execute malicious scripts. The consequences could be absolutely devastating for your application’s integrity and user data! To secure your application, avoid using the experimental permission model in Node.js 20 and 21 until this vulnerability is resolved. When it’s available, ensure you update to the latest stable version where this issue is patched. Always validate and sanitize user inputs rigorously! You’ve got this! Stay vigilant and keep your applications secure! 🛡️

The record
Technical detail
CVSS v3.0
7.9 · HIGH
Vector
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N/CR:M/IR:M/AR:M
CVSS v4.0
Not supplied
EPSS
0.01262 · 69.4th percentile
Published
2024-02-20T01:31Z
EPSS history
Timeline
  • 20 FEB 01:31Z
    The permission model protects itself against path traversal attacks by calling path.resolve() on any paths given by the user
    cvelistv5