CVE-2022-4318: Github.com/cri o/cri o CRI-O Vulnerable To /etc/passwd Tampering Vulnerability
MODERATECVE-2022-4318 is a MODERATE (CVSS 6.1) cri-o vulnerable to /etc/passwd tampering vulnerability (CWE-913: Improper Control of Dynamically-Managed Code Resources) affecting Github.com/cri o/cri o libraries in the Go ecosystem. The issue involves cri-o vulnerable to /etc/passwd tampering resulting in privilege escalation. Remediation is available by upgrading affected packages to version 1.26.0.
CVE-2022-4318 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N).
How to Fix CVE-2022-4318
To remediate this vulnerability, upgrade all affected Github.com/cri o/cri o dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/cri-o/cri-o to 1.26.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/cri-o/cri-o
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-4318, inspect your project dependencies for Github.com/cri o/cri o:
inspect dependencies for github.com/cri-o/cri-o
Analyze the terminal output to locate any version of Github.com/cri o/cri o in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.26.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-913: Improper Control of Dynamically-Managed Code Resources, where the product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. In Github.com/cri o/cri o, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-4318 Affected Github.com/cri o/cri o Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/cri-o/cri-o
|
Go |
< 1.26.0
|
1.26.0
|
References
Frequently Asked Questions
What is CVE-2022-4318?
Which Github.com/cri o/cri o versions are affected?
What version fixes CVE-2022-4318?
Is github.com/cri-o/cri-o affected?
What is the CVSS score of CVE-2022-4318?
What CWE is associated with CVE-2022-4318?
How can I check Go dependencies for CVE-2022-4318?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cm9x-c3rh-7rc4",
"modified" : "2022-12-29T01:49:47Z",
"published" : "2022-12-29T01:49:47Z",
"aliases" : [ "CVE-2022-4318" ],
"summary" : "CRI-O vulnerable to /etc/passwd tampering resulting in Privilege Escalation",
"details" : "### Impact\nIt 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.\n\nNote: 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.\n\n### Patches\n1.26.0 will have the fix. More patches will be posted as they're available.\n\n### Workarounds\nAdditional 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 \n\n### References\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/cri-o/cri-o"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.26.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cri-o/cri-o/security/advisories/GHSA-cm9x-c3rh-7rc4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-4318"
}, {
"type" : "WEB",
"url" : "https://github.com/cri-o/cri-o/pull/6450"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHSA-2023:1033"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHSA-2023:1503"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/security/cve/CVE-2022-4318"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2152703"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cri-o/cri-o"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-538", "CWE-913" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-29T01:49:47Z",
"nvd_published_at" : "2023-09-25T20:15:10Z"
}
}