Skip to content

Buildah processes using chroot isolation may leak environment values to intermediate processes

Moderate severity GitHub Reviewed Published Jul 15, 2021 in containers/buildah • Updated Aug 29, 2023

Package

gomod github.com/containers/buildah (Go)

Affected versions

<= 1.16.7
>= 1.17.0, <= 1.17.1
>= 1.18.0, <= 1.19.8
>= 1.20.0, <= 1.21.2

Patched versions

1.16.8
1.17.2
1.19.9
1.21.3

Description

Impact

When running processes using "chroot" isolation, the process being run can examine the environment variables of its immediate parent and grandparent processes (CVE-2021-3602). This isolation type is often used when running buildah in unprivileged containers, and it is often used to do so in CI/CD environments. If sensitive information is exposed to the original buildah process through its environment, that information will unintentionally be shared with child processes which it starts as part of handling RUN instructions or during buildah run. The commands that buildah is instructed to run can read that information if they choose to.

Patches

Users should upgrade packages, or images which contain packages, to include version 1.21.3 or later.

Workarounds

As a workaround, invoking buildah in a container under env -i to have it started with a reinitialized environment should prevent the leakage.

For more information

If you have any questions or comments about this advisory:

References

@nalind nalind published to containers/buildah Jul 15, 2021
Reviewed Jul 15, 2021
Published to the GitHub Advisory Database Jul 19, 2021
Published by the National Vulnerability Database Mar 3, 2022
Last updated Aug 29, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

EPSS score

0.045%
(16th percentile)

CVE ID

CVE-2021-3602

GHSA ID

GHSA-7638-r9r3-rmjj

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.