# CVE-2024-32019: ndsudo: local privilege escalation via untrusted search path

> Local attackers can escalate privileges to root by manipulating the PATH environment variable to hijack commands executed by the SUID ndsudo tool.

- **Severity:** High 8.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 12 Apr 2024
- **Updated:** 6 Sep 2024
- **Also known as:** GHSA-pmhq-4cxq-wj93

## What is CVE-2024-32019?

CVE-2024-32019 is a high-severity vulnerability in netdata, published on 12 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Netdata is an open source observability tool. In affected versions the `ndsudo` tool shipped with affected versions of the Netdata Agent allows an attacker to run arbitrary programs with root permissions. The `ndsudo` tool is packaged as a `root`-owned executable with the SUID bit set. It only runs a restricted set of external commands, but its search paths are supplied by the `PATH` environment variable. This allows an attacker to control where `ndsudo` looks for these commands, which may be a path the attacker has write access to. This may lead to local privilege escalation. This vulnerability has been addressed in versions 1.45.3 and 1.45.2-169. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-426 (Untrusted Search Path)

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


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

No fix has been published for CVE-2024-32019 yet. Limit exposure of the affected software until one is available.

## Is CVE-2024-32019 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32019 exists.

Public exploit code:

- POC for netdata ndsudo vulnerability - CVE-2024-32019 (github_poc): https://github.com/AzureADTrent/CVE-2024-32019-POC
- CVE-2024-32019 is a high-severity local privilege escalation vulnerability in Netdata (versions >= 1.44.0-60 < 1.45.3), caused by insecure use of the PATH variable in the ndsudo SUID binary, allowing attackers to execute arbitrary commands as root. (github_poc): https://github.com/dollarboysushil/CVE-2024-32019-Netdata-ndsudo-PATH-Vulnerability-Privilege-Escalation
- this is a poc for the CVE-2025-24893 (github_poc): https://github.com/AliElKhatteb/CVE-2024-32019-POC
- Netdata ndsudo Privilege Escalation PoC (github_poc): https://github.com/T1erno/CVE-2024-32019-Netdata-ndsudo-Privilege-Escalation-PoC
- https://github.com/x0da6h/POC-for-CVE-2024-32019 (github_poc): https://github.com/x0da6h/POC-for-CVE-2024-32019
- Netdata ndsudo privilege escalation (metasploit)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-32019 is a high-severity vulnerability in netdata, published on 12 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32019 exists.

Affected product: netdata. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-32019/ (Markdown: https://insights.sbomify.com/CVE-2024-32019/index.md)
```

## Sources

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

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