# CVE-2024-22017: Privilege escalation in Node

> Attackers can retain privileged operations after dropping privileges via setuid() if libuv io_uring was initialized earlier, leading to privilege escalation in Node.js applications.

- **Severity:** High 7.3 (`CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:C/C:L/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Mar 2024
- **Updated:** 30 Apr 2025
- **Also known as:** AZL-35886, AZL-35899, BELL-CVE-2024-22017, BIT-node-2024-22017, BIT-node-min-2024-22017, GHSA-vr4q-vx84-9g5x, openSUSE-SU-2024:13972-1

## What is CVE-2024-22017?

CVE-2024-22017 is a high-severity vulnerability in NodeJS Node, published on 19 Mar 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

Weakness: CWE-250 (Execution with Unnecessary Privileges)

## Which versions are affected by CVE-2024-22017?

2 open source packages ship an affected version, including node and node-min.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `node` | Bitnami | From 20.0.0 | 20.11.1, 21.6.2 |
| `node-min` | Bitnami | From 20.0.0 | 20.11.1, 21.6.2 |
| `nodejs-electron` | openSUSE:Tumbleweed | All versions | 29.4.0-1.1 |

## How do I fix CVE-2024-22017?

Upgrade node to a fixed version for your release line: 20.11.1 or 21.6.2.

## Is CVE-2024-22017 being exploited?

There is no known exploitation of CVE-2024-22017 in the wild and no public exploit code.

Public exploit code:

- https://github.com/SpiralBL0CK/cve-2024-22017_to_test (github_poc): https://github.com/SpiralBL0CK/cve-2024-22017_to_test

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-22017 and fix it if it is affected.

What it is: CVE-2024-22017 is a high-severity vulnerability in NodeJS Node, published on 19 Mar 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-22017 in the wild and no public exploit code.

Affected packages and fixed versions:
- node (Bitnami): affected from 20.0.0; fixed in 20.11.1, 21.6.2
- node-min (Bitnami): affected from 20.0.0; fixed in 20.11.1, 21.6.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-22017/ (Markdown: https://insights.sbomify.com/CVE-2024-22017/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-22017
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-22017
- OSV: https://osv.dev/vulnerability/CVE-2024-22017

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-22017/
Summaries are generated and may contain mistakes; the official description above is the record.
