HexBrain

Internet Bug Bounty · Report #2590608

fs.fchown/fchmod bypasses permission model

Validstatus
lowseverity
$249bounty
34upvotes
16 Oct 2024disclosed

How it was found

Hello IBB team, i would like to submit a report about Node.js vulnerability that i have reported to the Node.js team, which was assigned to CVE-2024-36137 and disclosed today. Please check #2472071.

Modifier: I have proposed a fix(-25% shouldn't be apllied) and the feature is experimental (-50%), so I believe the final ratio is 50%.

Details:

A vulnerability has been identified in Node.js, affecting users of the experimental permission model when the --allow-fs-write flag is used.

Node.js Permission Model do not operate on file descriptors, however, operations such as fs.fchown or fs.fchmod can use a "read-only" file descriptor to change the owner and permissions of a file.

This vulnerability affects all users using the experimental permission model in Node.js 20 and Node.js 21.

Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.

Impact

Node.js Permission Model do not operate on file descriptors, however, operations such as fs.fchown or fs.fchmod can use a "read-only" file descriptor to change the owner and permissions of a file.

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original