Miggo Logo

CVE-2022-4318: CRI-O vulnerable to /etc/passwd tampering resulting in Privilege Escalation

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.12096%
Published
12/29/2022
Updated
5/3/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/cri-o/cri-ogo< 1.26.01.26.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t It is possi*l* to *r**t *n *nvironm*nt v*ri**l* wit* n*wlin*s to *** *ntri*s to * *ont*in*r's /*t*/p*ssw*. It is possi*l* to *ir*umv*nt **mission v*li**tion o* us*rn*m*/UI* *y ***in* su** *n *ntry. Not*: ****us* t** po* *ut*or is in *ontr

Reasoning

T** vuln*r**ility st*ms *rom improp*r v*li**tion o* t** *OM* *nvironm*nt v*ri**l* in *RI-O's *ont*in*r *r**tion pro**ss. T** *it*u* pull r*qu*st #**** *xpli*itly s*ows t** *ix w*s impl*m*nt** in `s*rv*r/*ont*in*r_*r**t*.*o` *y ***in* * ****k *or n*wl