{"id":"GHSA-7638-r9r3-rmjj","summary":"Buildah processes using chroot isolation may leak environment values to intermediate processes","details":"### Impact\nWhen 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.\n\n### Patches\nUsers should upgrade packages, or images which contain packages, to include version 1.21.3 or later.\n\n### Workarounds\nAs a workaround, invoking `buildah` in a container under `env -i` to have it started with a reinitialized environment should prevent the leakage.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [buildah](https://github.com/containers/buildah/issues)\n* Email us at [the buildah general mailing list](mailto:buildah@lists.buildah.io), or [the podman security mailing list](mailto:security@lists.podman.io) if it's sensitive.","aliases":["CVE-2021-3602","GO-2022-0345"],"modified":"2026-07-17T21:17:29.466278697Z","published":"2021-07-19T15:19:09Z","database_specific":{"cwe_ids":["CWE-200","CWE-212"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2021-07-15T20:26:57Z","nvd_published_at":"2022-03-03T19:15:00Z"},"references":[{"type":"WEB","url":"https://github.com/containers/buildah/security/advisories/GHSA-7638-r9r3-rmjj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-3602"},{"type":"WEB","url":"https://github.com/containers/buildah/commit/a468ce0ffd347035d53ee0e26c205ef604097fb0"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=1969264"},{"type":"PACKAGE","url":"https://github.com/containers/buildah"},{"type":"WEB","url":"https://pkg.go.dev/vuln/GO-2022-0345"},{"type":"WEB","url":"https://ubuntu.com/security/CVE-2021-3602"}],"affected":[{"package":{"name":"github.com/containers/buildah","ecosystem":"Go","purl":"pkg:golang/github.com/containers/buildah"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.16.8"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 1.16.7","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/07/GHSA-7638-r9r3-rmjj/GHSA-7638-r9r3-rmjj.json"}},{"package":{"name":"github.com/containers/buildah","ecosystem":"Go","purl":"pkg:golang/github.com/containers/buildah"},"ranges":[{"type":"SEMVER","events":[{"introduced":"1.17.0"},{"fixed":"1.17.2"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 1.17.1","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/07/GHSA-7638-r9r3-rmjj/GHSA-7638-r9r3-rmjj.json"}},{"package":{"name":"github.com/containers/buildah","ecosystem":"Go","purl":"pkg:golang/github.com/containers/buildah"},"ranges":[{"type":"SEMVER","events":[{"introduced":"1.18.0"},{"fixed":"1.19.9"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 1.19.8","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/07/GHSA-7638-r9r3-rmjj/GHSA-7638-r9r3-rmjj.json"}},{"package":{"name":"github.com/containers/buildah","ecosystem":"Go","purl":"pkg:golang/github.com/containers/buildah"},"ranges":[{"type":"SEMVER","events":[{"introduced":"1.20.0"},{"fixed":"1.21.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/07/GHSA-7638-r9r3-rmjj/GHSA-7638-r9r3-rmjj.json","last_known_affected_version_range":"\u003c= 1.21.2"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"}]}