CVE-2022-27651 is a medium-severity (CVSS 6.8) Incorrect Default Permissions vulnerability in github.com/containers/buildah. A fix is available for github.com/containers/buildah — see the affected versions and patch details below.
Non-empty default inheritable capabilities for linux container in Buildah
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
github.com/containers/buildahReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
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
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/containers/buildah | all versions | 1.25.0go get github.com/containers/buildah@v1.25.0 |
Affected Products
buildahbuildah_projectfedorafedoraprojectenterprise linuxredhatDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/containers/buildah, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/containers/buildah to 1.25.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-27651 is resolved across your whole dependency graph.
Workarounds
Close the privilege gap rather than the entry point: audit which accounts, roles and service identities can reach the affected operation, drop the component to the least privilege it actually needs, and review file and directory permissions created by earlier installs — a default left in place is what makes this reachable.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This issue is related to the general vulnerability found in Moby (Docker Engine), which has been assigned CVE-2022-24769. The impact for OpenShift Container Platform is set to LOW as Buildah was shipped but is not being used. No update is planned at this time.
The entry point of a container can be modified to use a utility like capsh(1) to drop inheritable capabilities prior to the primary process starting.Source: Red Hat security advisory for CVE-2022-27651 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Enterprise Linux 8 | container-tools:3.0-8050020220411083214.e34216c9 | RHSA-2022:1565 |
| Red Hat Enterprise Linux 8 | container-tools:2.0-8050020220411114323.e34216c9 | RHSA-2022:1566 |
| Red Hat Enterprise Linux 8 | container-tools:rhel8-8060020220401155929.2e213529 | RHSA-2022:1762 |
| Red Hat Enterprise Linux 8.2 Extended Update Support | container-tools:2.0-8020020220420173758.28c38760 | RHSA-2022:4651 |
| Red Hat Enterprise Linux 8.4 Extended Update Support | container-tools:2.0-8040020220411112506.c0c392d5 | RHSA-2022:1407 |
| Red Hat Enterprise Linux 8.4 Extended Update Support | container-tools:3.0-8040020220419093313.c0c392d5 | RHSA-2022:4816 |
Frequently Asked Questions
Is CVE-2022-27651 in your dependencies?
Find it across Go, including transitive dependencies.