CVE-2022-27651
Description
A flaw was found in buildah where containers were incorrectly started with non-empty default permissions. A bug was found in Moby (Docker Engine) where containers were incorrectly started with non-empty inheritable Linux process capabilities, enabling an attacker with access to programs with inheritable file capabilities to elevate those capabilities to the permitted set when execve(2) runs. This has the potential to impact confidentiality and integrity.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/containers/buildahGo | < 1.25.0 | 1.25.0 |
Affected products
1- Range: Affects buildah v1.24.0 and prior, Fixed in - v1.25.0
Patches
290b3254c7404Add a test for CVE-2022-27651
1 file changed · +14 −0
tests/run.bats+14 −0 modified@@ -786,9 +786,23 @@ _EOF if test "$DBUS_SESSION_BUS_ADDRESS" = ""; then skip "${1:-test does not work when \$BUILDAH_ISOLATION = chroot}" fi + _prefetch alpine run_buildah from --quiet --pull=false --signature-policy ${TESTSDIR}/policy.json alpine cid=$output run_buildah run --cgroupns=host $cid cat /proc/self/cgroup expect_output --substring "/user.slice/" } + +@test "run-inheritable-capabilities" { + skip_if_no_runtime + + _prefetch alpine + + run_buildah from --quiet --pull=false --signature-policy ${TESTSDIR}/policy.json alpine + cid=$output + run_buildah run $cid grep ^CapInh: /proc/self/status + expect_output "CapInh: 0000000000000000" + run_buildah run --cap-add=ALL $cid grep ^CapInh: /proc/self/status + expect_output "CapInh: 0000000000000000" +}
e7e55c988c05do not set the inheritable capabilities
2 files changed · +1 −7
chroot/run.go+1 −1 modified@@ -897,7 +897,7 @@ func setCapabilities(spec *specs.Spec, keepCaps ...string) error { capMap := map[capability.CapType][]string{ capability.BOUNDING: spec.Process.Capabilities.Bounding, capability.EFFECTIVE: spec.Process.Capabilities.Effective, - capability.INHERITABLE: spec.Process.Capabilities.Inheritable, + capability.INHERITABLE: []string{}, capability.PERMITTED: spec.Process.Capabilities.Permitted, capability.AMBIENT: spec.Process.Capabilities.Ambient, }
run_linux.go+0 −6 modified@@ -1964,9 +1964,6 @@ func setupCapAdd(g *generate.Generator, caps ...string) error { if err := g.AddProcessCapabilityEffective(cap); err != nil { return errors.Wrapf(err, "error adding %q to the effective capability set", cap) } - if err := g.AddProcessCapabilityInheritable(cap); err != nil { - return errors.Wrapf(err, "error adding %q to the inheritable capability set", cap) - } if err := g.AddProcessCapabilityPermitted(cap); err != nil { return errors.Wrapf(err, "error adding %q to the permitted capability set", cap) } @@ -1985,9 +1982,6 @@ func setupCapDrop(g *generate.Generator, caps ...string) error { if err := g.DropProcessCapabilityEffective(cap); err != nil { return errors.Wrapf(err, "error removing %q from the effective capability set", cap) } - if err := g.DropProcessCapabilityInheritable(cap); err != nil { - return errors.Wrapf(err, "error removing %q from the inheritable capability set", cap) - } if err := g.DropProcessCapabilityPermitted(cap); err != nil { return errors.Wrapf(err, "error removing %q from the permitted capability set", cap) }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
14- github.com/advisories/GHSA-c3g4-w6cv-6v7hghsaADVISORY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/25YI27MENCEPZTTGRVU6BQD5V53FNI52/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2VWH6X6HOFPO6HTESF42HIJZEPXSWVIO/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7NETC7I6RTMMBRJJQVJOJUPDK4W4PQSJ/mitrevendor-advisoryx_refsource_FEDORA
- nvd.nist.gov/vuln/detail/CVE-2022-27651ghsaADVISORY
- bugzilla.redhat.com/show_bug.cgighsax_refsource_MISCWEB
- github.com/containers/buildah/commit/90b3254c7404039c1c786999ac189654228f6e0eghsaWEB
- github.com/containers/buildah/commit/e7e55c988c05dd74005184ceb64f097a0cfe645bghsax_refsource_MISCWEB
- github.com/containers/buildah/pull/3855ghsaWEB
- github.com/containers/buildah/security/advisories/GHSA-c3g4-w6cv-6v7hghsax_refsource_MISCWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/25YI27MENCEPZTTGRVU6BQD5V53FNI52ghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2VWH6X6HOFPO6HTESF42HIJZEPXSWVIOghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7NETC7I6RTMMBRJJQVJOJUPDK4W4PQSJghsaWEB
- pkg.go.dev/vuln/GO-2022-0417ghsaWEB
News mentions
0No linked articles in our index yet.