Lucene search

K
githubGitHub Advisory DatabaseGHSA-9M95-8HX6-7P9V
HistoryFeb 15, 2022 - 1:17 a.m.

Improper input validation in umoci

2022-02-1501:17:37
CWE-20
GitHub Advisory Database
github.com
27
umoci
symlink attack
vulnerability
patch
workaround
lsm profile
apparmor
selinux
oss-security
opencontainers
cve-2021-29988

CVSS2

2.1

Attack Vector

LOCAL

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:L/AC:L/Au:N/C:N/I:P/A:N

CVSS3

5.5

Attack Vector

LOCAL

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

EPSS

0.001

Percentile

17.2%

Impact

umoci 0.4.6 and earlier can be tricked into modifying host files by
creating a malicious layer that has a symlink with the name “.” (or
“/”). Because umoci deletes inodes if they change types, this results in
the rootfs directory being replaced with an attacker-controlled symlink.
Subsequent image layers will then be applied on top of the target of the
symlink (which could be any directory on the host filesystem the user
running umoci has access to).

While umoci does have defences against symlink-based attacks, they are
all implemented by resolving things relative to the rootfs directory –
if the rootfs itself is a symlink, umoci resolves it first.

This vulnerability affects both “umoci unpack” and “umoci raw unpack”.

Patches

This issue has been patched in umoci 0.4.7, see the references section
for the specific commit which fixed this vulnerability.

Workarounds

Note that if you use umoci as an unprivileged user (using the --rootless
flag) then umoci will not be able to overwrite any files that your user
doesn’t have access to. Other possible mitigations are to run umoci
under an LSM profile such as AppArmor or SELinux to restrict the level
of access it has outside of container image directories.

References

Credits

Thanks to Robin Peraglie from Cure53 for discovering and reporting this
vulnerability.

For more information

If you have any questions or comments about this advisory

Affected configurations

Vulners
Node
opencontainersumociRange<0.4.7
VendorProductVersionCPE
opencontainersumoci*cpe:2.3:a:opencontainers:umoci:*:*:*:*:*:*:*:*

CVSS2

2.1

Attack Vector

LOCAL

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:L/AC:L/Au:N/C:N/I:P/A:N

CVSS3

5.5

Attack Vector

LOCAL

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

EPSS

0.001

Percentile

17.2%