A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-7387

CVE-2024-7387: OpenShift Builder RCE Vulnerability

CVE-2024-7387 is a remote code execution vulnerability in OpenShift Builder allowing command injection via path traversal. Attackers can execute arbitrary commands on nodes running builder containers. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: May 26, 2026

CVE-2024-7387 Overview

CVE-2024-7387 is a command injection vulnerability via path traversal in openshift/builder. The flaw allows a user with permission to create BuildConfig resources to override executable files inside the privileged build container. When the Docker build strategy is used, the spec.source.secrets.secret.destinationDir attribute can be manipulated to write files outside the intended target directory. An attacker exploiting this issue can execute arbitrary commands on the OpenShift node hosting the builder container and escalate privileges on the underlying host. The weakness is classified under CWE-250: Execution with Unnecessary Privileges.

Critical Impact

An authenticated user with build permissions can break out of the builder container and execute arbitrary commands on the OpenShift node, leading to cluster-level privilege escalation.

Affected Products

  • Red Hat OpenShift Container Platform (openshift/builder component)
  • OpenShift builds using the Docker build strategy
  • Container images shipping the vulnerable openshift/builder binary prior to the patch

Discovery Timeline

  • 2024-09-17 - CVE-2024-7387 published to the National Vulnerability Database
  • 2024-10-02 - Public technical advisory released describing the privilege escalation path
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2024-7387

Vulnerability Analysis

The vulnerability resides in the copyLocalObject function within pkg/build/builder/docker.go in openshift/builder. During a build, the builder copies user-supplied secrets and config maps into the build container. The destination path is derived from the spec.source.secrets.secret.destinationDir field of the BuildConfig. The builder concatenates this attacker-controlled value with a target directory using filepath.Join without validating that the resulting path remains within the intended root.

Because the Docker build strategy runs the builder pod in a privileged context, files written through this path are effectively executed with elevated privileges. An attacker can supply a relative path containing .. segments, or rely on symlinks under their control, to redirect writes to arbitrary locations inside the privileged container, including locations on the host that are bind-mounted into the pod.

Root Cause

The root cause is missing path containment checks combined with execution under unnecessary privileges [CWE-250]. The builder accepted a user-supplied destinationDir and constructed the final destination without resolving symbolic links or verifying that the cleaned absolute path remained a subdirectory of the target. This "Zip-Slip" style flaw allowed file overwrites outside the secrets directory, including binaries invoked later in the build pipeline.

Attack Vector

Exploitation requires an account with permission to create or modify BuildConfig resources using the Docker strategy. The attacker crafts a BuildConfig whose secret destinationDir traverses out of the intended path, then triggers a build. When the builder copies the secret payload, it overwrites an executable that the privileged container later invokes, yielding command execution on the node. The patch adds absolute-path enforcement, symlink resolution via filepath.EvalSymlinks, and a strings.HasPrefix check that rejects destinations outside the target directory.

go
func (d *DockerBuilder) copyLocalObject(s localObjectBuildSource, sourceDir, targetDir string) error {
	if !filepath.IsAbs(sourceDir) {
		return fmt.Errorf("cannot copy local object - source directory %q must be an absolute path", sourceDir)

	}
	if !filepath.IsAbs(targetDir) {
		return fmt.Errorf("cannot copy local object - target directory %q must be an absolute path", targetDir)
	}
	dstDir := filepath.Join(targetDir, s.DestinationPath())
	if err := os.MkdirAll(dstDir, 0777); err != nil {
		return err
	}
	// Evaluate symlinks at the destination dir. EvalSymlinks calls filepath.Clean, ensuring the
	// returned path is an absolute path (we checked targetDir and thus dstDir is absolute above).
	dstDir, err := filepath.EvalSymlinks(dstDir)
	if err != nil {
		return err
	}
	// sourceDir and targetDir should always be absolute paths, therefore HasPrefix can verify if
	// dstDir is a subdirectory of targetDir.
	if !strings.HasPrefix(dstDir, targetDir) {
		return fmt.Errorf("destination path %q is outside of the target directory %q", dstDir, targetDir)
	}

Source: GitHub OpenShift Builder commit 0b62633 - this is the upstream patch that introduces absolute path validation, symlink evaluation, and the prefix check to prevent the traversal.

Detection Methods for CVE-2024-7387

Indicators of Compromise

  • BuildConfig objects containing spec.source.secrets[*].destinationDir values with .. sequences, absolute paths, or symlink-bait entries pointing outside the build context.
  • Unexpected modifications to executables inside builder containers, such as /usr/bin/* or /tmp/build/* binaries being overwritten during a build run.
  • Builder pods spawning processes that are not part of the normal docker build workflow, particularly shells or network utilities executed as root on the node.
  • Audit log entries showing build creation by service accounts or users without an established history of triggering Docker-strategy builds.

Detection Strategies

  • Inspect Kubernetes audit logs for create and update operations on BuildConfig and Build resources, alerting on destinationDir values that fail path-traversal validation.
  • Use admission controllers (OPA/Gatekeeper, Kyverno) to reject BuildConfig objects whose secret or config map destinationDir is not a simple relative path without .. segments.
  • Correlate container runtime events on OpenShift nodes with the lifecycle of builder pods to identify privileged file writes outside expected directories.
  • Monitor for process executions inside builder containers whose parent is the builder binary but whose image path does not match a known build toolchain component.

Monitoring Recommendations

  • Forward OpenShift API server audit logs and node-level container telemetry to a centralized analytics platform for retention and querying.
  • Establish a baseline of normal builder pod behavior (processes, file writes, outbound connections) and alert on deviations.
  • Track which identities can create BuildConfig resources with the Docker strategy and review that list against least-privilege requirements on a recurring basis.

How to Mitigate CVE-2024-7387

Immediate Actions Required

  • Apply the Red Hat security errata for openshift/builder referenced in RHSA-2024:3718, RHSA-2024:6685, RHSA-2024:6687, RHSA-2024:6689, RHSA-2024:6691, and RHSA-2024:6705.
  • Audit RBAC bindings that grant create/update on builds.build.openshift.io and buildconfigs.build.openshift.io and remove unnecessary access.
  • Review existing BuildConfig resources for suspicious destinationDir values and disable any that contain path traversal sequences.
  • Rotate cluster credentials and service account tokens if there is evidence that builder pods executed unauthorized commands on a node.

Patch Information

Red Hat addressed the issue across OpenShift Container Platform versions through the advisories listed above. The upstream fix is committed in openshift/builder commit 0b62633, which enforces absolute paths, resolves symlinks with filepath.EvalSymlinks, and verifies that the resolved destination remains within the target directory. Additional context is available in the Red Hat CVE page and Red Hat Bugzilla #2302259.

Workarounds

  • Prefer the Source build strategy over the Docker build strategy where feasible, since the privileged execution model is the prerequisite for exploitation.
  • Restrict the system:build-strategy-docker cluster role binding to a minimal set of trusted users and service accounts.
  • Use an admission policy to reject BuildConfig resources whose secret or config map destinationDir is absolute or contains ...
  • Isolate build nodes from production workloads so that a successful node compromise does not extend to sensitive tenants.
bash
# Remove the cluster-wide ability to use the Docker build strategy
oc adm policy remove-cluster-role-from-group \
  system:build-strategy-docker system:authenticated

# Review which subjects can still launch Docker-strategy builds
oc get clusterrolebindings -o json | \
  jq '.items[] | select(.roleRef.name=="system:build-strategy-docker") | {name: .metadata.name, subjects: .subjects}'

# Audit existing BuildConfigs for suspicious destinationDir values
oc get buildconfigs --all-namespaces -o json | \
  jq '.items[] | {ns: .metadata.namespace, name: .metadata.name,
      dirs: [.spec.source.secrets[]?.destinationDir]} |
      select(.dirs[]? | test("\\.\\.|^/"))'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechOpenshift

  • SeverityCRITICAL

  • CVSS Score9.1

  • EPSS Probability0.79%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-250
  • Technical References
  • Red Hat Security Advisory RHSA-2024:3718

  • Red Hat Security Advisory RHSA-2024:6685

  • Red Hat Security Advisory RHSA-2024:6687

  • Red Hat Security Advisory RHSA-2024:6689

  • Red Hat Security Advisory RHSA-2024:6691

  • Red Hat Security Advisory RHSA-2024:6705

  • Red Hat CVE Details for CVE-2024-7387

  • Red Hat Bug Report #2302259

  • GitHub OpenShift Commit Log

  • Stuxxn Advisory on OpenShift Privilege Escalation
  • Related CVEs
  • CVE-2024-45496: OpenShift Privilege Escalation Flaw

  • CVE-2025-14243: OpenShift Mirror Registry Disclosure Flaw

  • CVE-2025-57854: OpenShift Update Service Escalation Flaw

  • CVE-2025-13888: OpenShift GitOps Privilege Escalation
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English