CVE-2022-4318: CRI-O vulnerable to /etc/passwd tampering resulting in Privilege Escalation
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.12096%
CWE
Published
12/29/2022
Updated
5/3/2024
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/cri-o/cri-o | go | < 1.26.0 | 1.26.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper validation of the HOME environment variable in CRI-O's container creation process. The GitHub pull request #6450 explicitly shows the fix was implemented in server/container_create.go by adding a check for newline characters (\n) in the HOME variable. The vulnerable versions lacked this validation, enabling the injection of arbitrary entries into /etc/passwd. The setupContainerUser function is directly responsible for handling environment variables and user setup, making it the clear vulnerable component.