# CVE-2024-7387: Openshift/builder: path traversal allows command injection in privileged buildcontainer using docker build strategy

> Attackers can execute arbitrary commands on OpenShift nodes via path traversal in privileged build containers using the Docker strategy.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 16 Sep 2024
- **Updated:** 11 Aug 2026
- **Also known as:** GHSA-qqv8-ph7f-h3f7, GO-2024-3129

## What is CVE-2024-7387?

CVE-2024-7387 is a critical path traversal vulnerability in Red Hat OpenShift Container Platform 4.12, published on 16 Sep 2024. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

A flaw was found in openshift/builder. This vulnerability allows command injection via path traversal, where a malicious user can execute arbitrary commands on the OpenShift node running the builder container. When using the “Docker” strategy, executable files inside the privileged build container can be overridden using the `spec.source.secrets.secret.destinationDir` attribute of the `BuildConfig` definition. An attacker running code in a privileged container could escalate their permissions on the node running the container.

Weakness: CWE-250 (Execution with Unnecessary Privileges)

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

3 open source packages ship an affected version, including github.com/openshift/builder.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/openshift/builder` | Go | All versions | None |
| `github.com/openshift/builder` | Go | All versions to 4.0.0 | None |
| `github.com/openshift/builder` | Go | All versions to 4.0.0 | None |

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

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

## Is CVE-2024-7387 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-7387 is a critical path traversal vulnerability in Red Hat OpenShift Container Platform 4.12, published on 16 Sep 2024. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-7387 exists.

Affected packages and fixed versions:
- github.com/openshift/builder (Go): affected all versions; no fix listed
- github.com/openshift/builder (Go): affected all versions up to 4.0.0; no fix listed
- github.com/openshift/builder (Go): affected all versions up to 4.0.0; no fix listed

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

## Sources

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

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