Vulnerabilities in pkg:golang/github.com/opencontainers/umoci
PACKAGECVE-2021-29136 is a MODERATE (CVSS 5.5) improper input validation vulnerability (CWE-20: Improper Input Validation) affecting Github.com/opencontainers/umoci libraries in the Go ecosystem. The issue involves improper input validation in umoci. Remediation is available by upgrading affected packages to version 0.4.7.
pkg:golang/github.com/opencontainers/umoci
Vulnerability advisories affecting package pkg:golang/github.com/opencontainers/umoci. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-9m95-8hx6-7p9v | CVE-2021-29136 | MODERATE | Improper input validation in umoci |
CVE-2021-29136 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2021-29136
To remediate this vulnerability, upgrade all affected Github.com/opencontainers/umoci 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/opencontainers/umoci to 0.4.7
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/opencontainers/umoci
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-29136, inspect your project dependencies for Github.com/opencontainers/umoci:
inspect dependencies for github.com/opencontainers/umoci
Analyze the terminal output to locate any version of Github.com/opencontainers/umoci in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.7), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/opencontainers/umoci, 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-2021-29136 Affected Github.com/opencontainers/umoci Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/opencontainers/umoci
|
Go |
< 0.4.7
|
0.4.7
|
References
Frequently Asked Questions
What is CVE-2021-29136?
Which Github.com/opencontainers/umoci versions are affected?
What version fixes CVE-2021-29136?
Is github.com/opencontainers/umoci affected?
What is the CVSS score of CVE-2021-29136?
What CWE is associated with CVE-2021-29136?
How can I check Go dependencies for CVE-2021-29136?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9m95-8hx6-7p9v",
"modified" : "2022-03-15T21:39:42Z",
"published" : "2022-02-15T01:17:37Z",
"aliases" : [ "CVE-2021-29136" ],
"summary" : "Improper input validation in umoci",
"details" : "### Impact\n\numoci 0.4.6 and earlier can be tricked into modifying host files by\ncreating a malicious layer that has a symlink with the name \".\" (or\n\"/\"). Because umoci deletes inodes if they change types, this results in\nthe rootfs directory being replaced with an attacker-controlled symlink.\nSubsequent image layers will then be applied on top of the target of the\nsymlink (which could be any directory on the host filesystem the user\nrunning umoci has access to).\n\nWhile umoci does have defences against symlink-based attacks, they are\nall implemented by resolving things relative to the rootfs directory --\nif the rootfs itself is a symlink, umoci resolves it first.\n\nThis vulnerability affects both \"umoci unpack\" and \"umoci raw unpack\".\n\n### Patches\nThis issue has been patched in umoci 0.4.7, see the references section\nfor the specific commit which fixed this vulnerability.\n\n### Workarounds\nNote that if you use umoci as an unprivileged user (using the --rootless\nflag) then umoci will not be able to overwrite any files that your user\ndoesn't have access to. Other possible mitigations are to run umoci\nunder an LSM profile such as AppArmor or SELinux to restrict the level\nof access it has outside of container image directories.\n\n### References\n* [oss-security public disclosure](https://www.openwall.com/lists/oss-security/2021/04/06/2)\n* [patch](https://github.com/opencontainers/umoci/commit/d9efc31daf2206f7d3fdb839863cf7a576a2eb57)\n\n### Credits\nThanks to Robin Peraglie from Cure53 for discovering and reporting this\nvulnerability.\n\n### For more information\n\nIf you have any questions or comments about this advisory\n* Open an issue in <https://github.com/opencontainers/umoci>.\n* Email us at <security@opencontainers.org>.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/opencontainers/umoci"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.7"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/opencontainers/umoci/security/advisories/GHSA-9m95-8hx6-7p9v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29136"
}, {
"type" : "WEB",
"url" : "https://github.com/opencontainers/umoci/commit/d9efc31daf2206f7d3fdb839863cf7a576a2eb57"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2021/04/06/2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-20T20:13:37Z",
"nvd_published_at" : null
}
}