CVE-2021-3602: chroot isolation: environment value leakage to intermediate processes in github.com/containers/buildah

Summary

19/07/2021
Yes i
Moderate
5.5

CVE-2021-3602: Buildah processes using chroot isolation may leak environment values to intermediate processes. Affects github.com/containers/buildah across 4 version ranges.

< 1.16.8 >= 1.17.0, < 1.17.2 >= 1.18.0, < 1.19.9 >= 1.20.0, < 1.21.3

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-3602 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

github.com/containers/buildah is a Go package that provides a command-line interface for building and managing OCI (Open Container Initiative) images. It is commonly used in CI/CD environments and unprivileged containers. The package utilizes chroot isolation to run processes securely. However, a vulnerability has been discovered that allows the process being run to examine the environment variables of its immediate parent and grandparent processes.

Vulnerability Detail

The vulnerability (CVE-2021-3602) in github.com/containers/buildah's chroot isolation can lead to the leakage of sensitive information. When the original buildah process receives sensitive information through its environment, this information unintentionally gets shared with child processes started during the handling of RUN instructions or buildah run. These child processes can read the exposed information if they choose to do so. This vulnerability has a CVSS score of 5.5, indicating a moderate severity level.

How To Fix

Latest published version: v1.43.5 as of 22 Oct 2026

go get github.com/containers/buildah@v1.43.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.16.8 1.16.8
    go get github.com/containers/buildah@v1.16.8
  • >= 1.17.0, < 1.17.2 1.17.2
    go get github.com/containers/buildah@v1.17.2
  • >= 1.18.0, < 1.19.9 1.19.9
    go get github.com/containers/buildah@v1.19.9
  • >= 1.20.0, < 1.21.3 1.21.3
    go get github.com/containers/buildah@v1.21.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a workaround, users can invoke buildah in a container under env -i to start it with a reinitialized environment. This prevents the leakage of sensitive information.

Conclusion

The vulnerability in github.com/containers/buildah's chroot isolation can lead to the leakage of sensitive information to intermediate processes. It is recommended to upgrade to version 1.21.3 or later to fix this vulnerability. Alternatively, the workaround of starting buildah with a reinitialized environment can be used. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/containers/buildah →

Share this vulnerability

FAQ

The vulnerability allows processes running in chroot isolation to access the environment variables of their immediate parent and grandparent processes. This can lead to the exposure of sensitive information.

To fix this vulnerability, upgrade your packages or images to include version 1.21.3 or later of github.com/containers/buildah.

Yes, you can use the workaround of invoking buildah in a container under env -i to start it with a reinitialized environment.

No, this vulnerability affects any usage of buildah in unprivileged containers utilizing chroot isolation.

For more information, you can open an issue in the buildah GitHub repository or email the buildah general mailing list or the podman security mailing list.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/containers/buildah.

How To Fix

Latest published version: v1.43.5 as of 22 Oct 2026

go get github.com/containers/buildah@v1.43.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.16.8 1.16.8
    go get github.com/containers/buildah@v1.16.8
  • >= 1.17.0, < 1.17.2 1.17.2
    go get github.com/containers/buildah@v1.17.2
  • >= 1.18.0, < 1.19.9 1.19.9
    go get github.com/containers/buildah@v1.19.9
  • >= 1.20.0, < 1.21.3 1.21.3
    go get github.com/containers/buildah@v1.21.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback