Miggo Logo

CVE-2021-43816:
Unprivileged pod using `hostPath` can side-step active LSM when it is SELinux

8.1

CVSS Score
3.1

Basic Information

EPSS Score
0.37093%
Published
1/6/2022
Updated
2/3/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/containerd/containerdgo>= 1.5.0, < 1.5.91.5.9

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability arises from improper SELinux labeling of hostPath-mounted files. The commit a731039 introduced WithRelabeledContainerMounts to explicitly relabel /etc/hosts, /etc/hostname, and /etc/resolv.conf. Before this fix, the WithMounts function (spec_linux.go) handled mount creation without this relabeling, and the containerSpec function (container_create_linux.go) did not include the relabeling step in the specOpts chain. These omissions allowed containers to relabel host files via hostPath mounts, leading to privilege escalation. The high confidence stems from the patch directly addressing these two code paths by adding the missing relabeling logic.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t *ont*in*rs l*un**** t*rou** *ont*in*r*’s *RI impl*m*nt*tion on Linux syst*ms w*i** us* t** S*Linux s**urity mo*ul* *n* *ont*in*r* v*rsions sin** v*.*.* **n **us* *r*itr*ry *il*s *n* *ir**tori*s on t** *ost to ** r*l***l** to m*t** t** *on

Reasoning

T** vuln*r**ility *ris*s *rom improp*r S*Linux l***lin* o* *ostP*t*-mount** *il*s. T** *ommit ******* intro*u*** Wit*R*l***l***ont*in*rMounts to *xpli*itly r*l***l /*t*/*osts, /*t*/*ostn*m*, *n* /*t*/r*solv.*on*. ***or* t*is *ix, t** Wit*Mounts *un*t