CVE-2022-4318 is a medium-severity (CVSS 6.1) CWE-538 vulnerability in github.com/cri-o/cri-o. A fix is available for github.com/cri-o/cri-o — see the affected versions and patch details below.
CRI-O vulnerable to /etc/passwd tampering resulting in Privilege Escalation
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-4318.
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/cri-o/cri-oReal-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
Impact
It is possible to craft an environment variable with newlines to add entries to a container's /etc/passwd. It is possible to circumvent admission validation of username/UID by adding such an entry.
Note: because the pod author is in control of the container's /etc/passwd, this is not considered a new risk factor. However, this advisory is being opened for transparency and as a way of tracking fixes.
Patches
1.26.0 will have the fix. More patches will be posted as they're available.
Workarounds
Additional security controls like SELinux should prevent any damage a container is able to do with root on the host. Using SELinux is recommended because this class of attack is already possible by manually editing the container's /etc/passwd
References
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/cri-o/cri-o | all versions | 1.26.0go get github.com/cri-o/cri-o@v1.26.0 |
Affected Products
extra packages for enterprise linuxfedoraprojectfedorafedoraprojectcri-okubernetesopenshift container platform for arm64redhatopenshift container platform for linuxoneredhatopenshift container platform for powerredhatDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/cri-o/cri-o, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/cri-o/cri-o to 1.26.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-4318 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
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.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift Container Platform 4.11 | cri-o-0:1.24.4-10.rhaos4.11.git1ed5ac5.el8 | RHSA-2023:1503 |
| Red Hat OpenShift Container Platform 4.12 | cri-o-0:1.25.2-10.rhaos4.12.git0a083f9.el8 | RHSA-2023:1033 |
Frequently Asked Questions
Is CVE-2022-4318 in your dependencies?
Find it across Go, including transitive dependencies.