REDHAT-BUG-2302259: High severity Red Hat OpenShift Container Platform vulnerability

Published Aug 1, 2024
·
Updated

OpenShift allows a user to create his own images with the help of the build component. This component has three primary build strategies available (Docu - Understanding image builds):

Docker build Source-to-Image (S2I) build Custom build

As the builds are running in a privileged container, a vulnerability in this process allows an attacker to escalate their permissions on the cluster and host nodes.

The custom build is not safe, because they can execute any code within a privileged container and are disabled by default. The other two strategies are considered as safe and are enabled for all users that can create builds.

But there is a note about the docker strategy:

Grant docker build permissions with caution, because a vulnerability in the Dockerfile processing logic could result in a privileges being granted on the host node.

See: https://docs.openshift.com/container-platform/4.16/cicd/builds/securing-builds-by-strategy.html

The docker strategy / the image used during the build has a vulnerability, which allows an attacker to override files inside the privileged build container with the help of the spec.source.secrets.secret.destinationDir attribute of the BuildConfig definition. After overriding the binary, execution of this overriden file can be triggered with another secret and the malicious code is executed in the privileged container.

As stated above, running code in a privileged container allows an attacker to escalate their permissions on the cluster and host nodes. As an example the host filesystem of the worker node can be mounted and a new SSH key can be added to user core of the Red Hat Enterprise Linux CoreOS (RHCOS).

Affected Software

1 affected component
Red Hat OpenShift Container Platform

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Ensure the custom build strategy is disabled (custom builds are not safe because they can execute arbitrary code in a privileged build container).

    OpenShift build component custom build strategy = disabled
  2. Configuration

    Grant docker build permissions with caution; restrict who can create Docker builds via RBAC to trusted administrators only.

    OpenShift build component docker build permission = restricted to trusted users
  3. Configuration

    Disallow or restrict use of spec.source.secrets.secret.destinationDir in BuildConfig so secrets cannot be used to overwrite files inside the privileged build container.

    OpenShift BuildConfig spec.source.secrets[].destinationDir = not allowed / do not use
  4. Configuration

    Configure build pods and SecurityContextConstraints so builds do not run in privileged containers to reduce the risk of host/node escalation from build-time code execution.

    OpenShift builds privileged = false / do not run privileged builds
  5. Operational

    If exploitation is suspected, inspect worker nodes for compromise (for example mounted host filesystem or added SSH keys to the core user on RHCOS), remove unauthorized keys, and rotate any potentially exposed credentials.

Event History

Aug 1, 2024
Data Sourced
via Red Hat·03:25 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of REDHAT-BUG-2302259?

The severity of REDHAT-BUG-2302259 is classified as high due to potential risks in image creation and build strategies.

2

How do I fix REDHAT-BUG-2302259?

To fix REDHAT-BUG-2302259, update Red Hat OpenShift to the latest version that addresses this vulnerability.

3

What are the affected components of REDHAT-BUG-2302259?

The affected component of REDHAT-BUG-2302259 is the OpenShift build component responsible for creating images.

4

Is REDHAT-BUG-2302259 under active exploitation?

There is currently no evidence to suggest that REDHAT-BUG-2302259 is under active exploitation.

5

What can be done to mitigate risks associated with REDHAT-BUG-2302259?

To mitigate risks associated with REDHAT-BUG-2302259, implement strict access controls and auditing on build strategies.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203