CVE-2024-7387: Github.com/openshift/builder Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-qqv8-ph7f-h3f7
CVSS 9.1
CWE-250
Published
Advisory Summary

CVE-2024-7387 is a MODERATE (CVSS 9.1) path traversal vulnerability (CWE-250: Execution with Unnecessary Privileges) affecting Github.com/openshift/builder libraries in the Go ecosystem. The issue involves openshift builder has a path traversal, allows command injection in privileged buildcontainer. Remediation is available in the latest vendor maintenance releases.

CVE-2024-7387 at a Glance

CVE Identifier CVE-2024-7387
GHSA Identifier GHSA-qqv8-ph7f-h3f7
Severity MODERATE
CVSS v3.1 Base Score 9.1
CWE Classification CWE-250: Execution with Unnecessary Privileges
Affected Product Github.com/openshift/builder
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-7387

To remediate this vulnerability, upgrade all affected Github.com/openshift/builder dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/openshift/builder fixed: Latest secure release
Upgrade github.com/openshift/builder to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/openshift/builder

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-7387, inspect your project dependencies for Github.com/openshift/builder:

inspect dependencies for github.com/openshift/builder

Analyze the terminal output to locate any version of Github.com/openshift/builder in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-250: Execution with Unnecessary Privileges, where the product performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses. In Github.com/openshift/builder, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2024-7387 Affected Github.com/openshift/builder Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/openshift/builder
Go
≤ 4.0.0

References

Frequently Asked Questions

What is CVE-2024-7387?
CVE-2024-7387 is a security vulnerability in Github.com/openshift/builder involving OpenShift Builder has a path traversal, allows command injection in privileged BuildContainer under CWE-250: Execution with Unnecessary Privileges.
Which Github.com/openshift/builder versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/openshift/builder.
What version fixes CVE-2024-7387?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/openshift/builder affected?
Yes, github.com/openshift/builder is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-7387?
CVE-2024-7387 has a CVSS v3.1 base score of 9.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-7387?
CVE-2024-7387 is classified under CWE-250: Execution with Unnecessary Privileges (The product performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses.).
How can I check Go dependencies for CVE-2024-7387?
Run the dependency tree command: 'inspect dependencies for github.com/openshift/builder'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qqv8-ph7f-h3f7",
  "modified" : "2026-08-11T18:30:31Z",
  "published" : "2024-09-17T00:31:06Z",
  "aliases" : [ "CVE-2024-7387" ],
  "summary" : "OpenShift Builder has a path traversal, allows command injection in privileged BuildContainer",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/openshift/builder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-7387"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openshift/builder/commit/0b62633adfa2836465202bc851885e078ec888d1"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:3718"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6122"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6685"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6687"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6689"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6691"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6705"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2024-7387"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2302259"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/openshift/builder"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3129"
  }, {
    "type" : "WEB",
    "url" : "https://stuxxn.github.io/advisory/2024/10/02/openshift-build-docker-priv-esc.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-250" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-17T18:31:41Z",
    "nvd_published_at" : "2024-09-17T00:15:52Z"
  }
}