{"id":"CVE-2021-29136","aliases":["GHSA-9m95-8hx6-7p9v","GO-2022-0815"],"title":"Improper input validation in umoci","summary":"Improper input validation in umoci","severity":"medium","cvss":5.5,"cvssVector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","vendor":"opencontainers","product":"github.com/opencontainers/umoci","ecosystem":"go","affected":["github.com/opencontainers/umoci < 0.4.7"],"patched":["github.com/opencontainers/umoci 0.4.7"],"published":"2022-02-15","updated":"2026-07-08","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-9m95-8hx6-7p9v","references":[{"url":"https://github.com/opencontainers/umoci/security/advisories/GHSA-9m95-8hx6-7p9v"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29136"},{"url":"https://github.com/opencontainers/umoci/commit/d9efc31daf2206f7d3fdb839863cf7a576a2eb57"},{"url":"http://www.openwall.com/lists/oss-security/2021/04/06/2"}],"tags":["osv","go"],"epss":0.00344,"epssPercentile":0.27913,"ingestedAt":"2026-07-09T18:56:36.285Z","slug":"CVE-2021-29136","body":"## Overview\n\n### 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>.\n\n## Affected packages\n\n- `github.com/opencontainers/umoci < 0.4.7`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `github.com/opencontainers/umoci 0.4.7`","depth":"sunlit","depthScore":30,"depthScoreParts":{"impact":30.3,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}