setuid() does not drop all privileges due to io_uring
A setuid() call does not drop all privileges because libuv's io_uring operations, initialised before the call, continue to run with the original privileges. An attacker could perform privileged operations despite the process having supposedly dropped them.
- Triaged in 25 hours
- Fixed in 5 months
- Disclosed after 6 months
Summary by the program
setuid() does not affect libuv's internal io_uring operations if initialized before the call to setuid().
This allows the process to perform privileged operations despite presumably having dropped such privileges through a call to setuid().
This vulnerability affects all users using version greater or equal than Node.js 18.18.0, Node.js 20.4.0 and Node.js 21.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
A process that believes it has dropped privileges via setuid() may still perform privileged operations, potentially allowing an attacker to bypass intended privilege restrictions.
What the attacker needed
Node.js version >= 18.18.0, 20.4.0, or 21; libuv io_uring initialised before setuid()
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program wants to lower its privileges (for example, to stop being root), it calls setuid(). But if it uses a feature called io_uring (a way to do many input/output operations efficiently) and that feature was set up before the privilege drop, the io_uring operations keep the old, higher privileges. So the program can still do things it should no longer be allowed to do.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.