CVE-2024-11218: Podman: buildah: container breakout by using --jobs=2 and a race condition when building a malicious containerfile

Published Nov 14, 2024
·
Updated

Impact With careful use of the --mount flag in RUN instructions in Containerfiles, and by using either multi-stage builds with use of concurrently-executing build stages (e.g., using the --jobs CLI flag) or multiple separate but concurrently-executing builds, a malicious Containerfile can be used to expose content from the build host to the command being run using the RUN instruction. This can be used to read or write contents using the privileges of the process which is performing the build. When that process is a root-owned podman system service which is provided for use by unprivileged users, this includes the ability to read and write contents which the client should not be allowed to read and write, including setuid executables in locations where they can be later accessed by unprivileged users.

Patches Patches have been merged to the main branch, and will be added to upcoming releases on the release-1.38, release-1.37, release-1.35, and release-1.33 branches.

This addressed a number of Jira cards, but primarily https://issues.redhat.com/browse/RHEL-67616 and https://issues.redhat.com/browse/RHEL-67618, which were then vendored into Podman and backported into olde rbranches.

Workarounds Mandatory access controls should limit the access of the process performing the build, on systems where they are enabled.

Other sources

A vulnerability was found in podman build and buildah. This issue occurs in a container breakout by using --jobs=2 and a race condition when building a malicious Containerfile. SELinux might mitigate it, but even with SELinux on, it still allows the enumeration of files and directories on the host.

NVD

A vulnerability was found in podman build and buildah. Container breakout by using --jobs=2 and race condition when building a malicious Containerfile. It might be mitigated by SELinux, but even with SELinux on it still allows enumeration of files and directories on the host.

Red Hat

Affected Software

4 affected componentsFixes available
go/github.com/containers/buildah<1.33.12
1.33.12
go/github.com/containers/buildah>=1.35.0<1.35.5
1.35.5
go/github.com/containers/buildah>=1.37.0<1.37.6
1.37.6
go/github.com/containers/buildah>=1.38.0<1.38.1
1.38.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/containers/buildah to a version that resolves this vulnerability.

    Fixed in 1.33.12
  2. Upgrade

    Upgrade go/github.com/containers/buildah to a version that resolves this vulnerability.

    Fixed in 1.35.5
  3. Upgrade

    Upgrade go/github.com/containers/buildah to a version that resolves this vulnerability.

    Fixed in 1.37.6
  4. Upgrade

    Upgrade go/github.com/containers/buildah to a version that resolves this vulnerability.

    Fixed in 1.38.1
  5. Compensating control

    Ensure Mandatory Access Controls limit the access of the process performing the container build (e.g., rely on SELinux confinement and other MAC controls on systems where they are enabled).

  6. Compensating control

    Avoid using --jobs=2 (and otherwise concurrently executing build stages/builds), since the container breakout relies on a race condition with --jobs=2 when building a malicious Containerfile.

Event History

Nov 14, 2024
Data Sourced
via Red Hat·01:12 PM
DescriptionSeverityAffected Software
Jan 21, 2025
Advisory Published
via GitHub·09:22 PM
Data Sourced
via GitHub·09:22 PM
DescriptionSeverityWeaknessAffected Software
Jan 22, 2025
CVE Published
via MITRE·04:55 AM
Data Sourced
via MITRE·04:55 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 AM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-11218?

CVE-2024-11218 is a vulnerability that has moderate severity due to its potential impact on container build processes.

2

How do I fix CVE-2024-11218?

To resolve CVE-2024-11218, upgrade to Buildah versions 1.33.12, 1.35.5, 1.37.6, or 1.38.1.

3

What is CVE-2024-11218?

CVE-2024-11218 involves a vulnerability in the handling of the `--mount` flag in Containerfiles that affects security during multi-stage builds.

4

Which software is affected by CVE-2024-11218?

CVE-2024-11218 affects specific versions of Buildah from the GitHub containers repository.

5

What type of attack does CVE-2024-11218 enable?

CVE-2024-11218 could enable a malicious container to exploit vulnerabilities in concurrent builds, which could compromise the integrity of the build process.

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