Miggo Logo

CVE-2025-47291:
containerd CRI plugin: Incorrect cgroup hierarchy assignment for containers running in usernamespaced Kubernetes pods.

4.6

CVSS Score
4.0

Basic Information

EPSS Score
0.03544%
Published
5/21/2025
Updated
5/21/2025
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/containerd/containerd/v2go>= 2.0.1, <= 2.0.42.0.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability description states that containerd's CRI implementation incorrectly assigns cgroup hierarchy for containers in user-namespaced Kubernetes pods. This leads to Kubernetes limits not being honored. The fix involves correcting how the cgroup path is determined and applied for such pods.

I was unable to fetch commit details using get_commit_infos for the specific fixing commits (323c7000098791211342117187b0979777510091 or its cherry-pick c9198302594581cf598508e8a39999807998c880). However, by manually reviewing the GitHub Pull Request #10014 (cri: fix cgroup path for userns sandboxes) and its cherry-pick to the release branch #11708, which are cited by the GHSA advisory GHSA-cxfp-7pvr-95ff as the fix, I identified the modified files and functions.

The primary changes are in pkg/cri/server/helpers_linux.go within the applySandboxResources function, and in pkg/cri/server/sandbox_run_linux.go within the (*criService).runPodSandbox method.

  1. applySandboxResources: This function calculates and applies resource configurations, including the cgroup path. The patch modifies the logic to correctly derive the cgroupPath when user namespaces are in use, specifically by using the parent directory of the configured CgroupsPath for user-namespaced pods. This directly addresses the incorrect hierarchy assignment.

  2. (*criService).runPodSandbox: This method is a core part of creating sandboxes. It was modified to conditionally skip the creation of the sandbox's own cgroup directory if user namespaces are enabled (if !usernsPod(...)). This is because, in user-namespaced scenarios, the sandbox itself doesn't get its own dedicated cgroup in the same way; containers within it are managed under the pod-level cgroup.

These two functions are central to how cgroups are handled for sandboxes in the CRI plugin, and the changes directly address the described problem of incorrect cgroup path assignment for user-namespaced pods.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

# Imp**t * *u* w*s *oun* in t** *ont*in*r*'s *RI impl*m*nt*tion w**r* *ont*in*r* *o*sn't put us*rn*m*sp**** *ont*in*rs un**r t** Ku**rn*t*s' **roup *i*r*r**y, t**r**or* som* Ku**rn*t*s limits *r* not *onor**. T*is m*y **us* * **ni*l o* s*rvi** o* t*

Reasoning

T** vuln*r**ility **s*ription st*t*s t**t *ont*in*r*'s *RI impl*m*nt*tion in*orr**tly *ssi*ns **roup *i*r*r**y *or *ont*in*rs in us*r-n*m*sp**** Ku**rn*t*s po*s. T*is l***s to Ku**rn*t*s limits not **in* *onor**. T** *ix involv*s *orr**tin* *ow t** *