Summary
Workarounds
Ensure that only trusted images are used and that only trusted users have permissions to import images.
Credits
The containerd project would like to thank Benjamin Koltermann and emxll for responsibly disclosing this issue in accordance with the containerd security policy.
References
For more information
If you have any questions or comments about this advisory:
- Open an issue in containerd
- Email us at [email protected]
To report a security issue in containerd:
- Report a new vulnerability
- Email us at [email protected]
Impact
A bug was found in containerd where containers launched with a User set as a UID:GID larger than the maximum 32-bit signed integer can cause an overflow condition where the container ultimately runs as root (UID 0). This could cause unexpected behavior for environments that require containers to run as a non-root user.
An arithmetic operation produces a value that exceeds the integer type's maximum, causing it to wrap to an unexpected small value. Typical impact: incorrect size calculations leading to heap overflows or logic errors.
CVE-2024-40635 has a CVSS score of 4.6 (Medium). The vector is requires local access, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.0.4, 1.7.27, 1.6.38); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
This bug has been fixed in the following containerd versions:
- 2.0.4 (Fixed in https://github.com/containerd/containerd/commit/1a43cb6a1035441f9aca8f5666a9b3ef9e70ab20)
- 1.7.27 (Fixed in https://github.com/containerd/containerd/commit/05044ec0a9a75232cad458027ca83437aae3f4da)
- 1.6.38 (Fixed in https://github.com/containerd/containerd/commit/cf158e884cfe4812a6c371b59e4ea9bc4c46e51a)
Users should update to these versions to resolve the issue.
Frequently Asked Questions
- What is CVE-2024-40635? CVE-2024-40635 is a medium-severity integer overflow or wraparound vulnerability in github.com/containerd/containerd/v2 (go), affecting versions < 2.0.4. It is fixed in 2.0.4, 1.7.27, 1.6.38. An arithmetic operation produces a value that exceeds the integer type's maximum, causing it to wrap to an unexpected small value.
- How severe is CVE-2024-40635? CVE-2024-40635 has a CVSS score of 4.6 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2024-40635?
github.com/containerd/containerd/v2(go) (versions < 2.0.4)github.com/containerd/containerd(go) (versions >= 1.7.0-beta.0, < 1.7.27)
- Is there a fix for CVE-2024-40635? Yes. CVE-2024-40635 is fixed in 2.0.4, 1.7.27, 1.6.38. Upgrade to this version or later.
- Is CVE-2024-40635 exploitable, and should I be worried? Whether CVE-2024-40635 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-40635 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-40635?
- Upgrade
github.com/containerd/containerd/v2to 2.0.4 or later - Upgrade
github.com/containerd/containerdto 1.7.27 or later - Upgrade
github.com/containerd/containerdto 1.6.38 or later
- Upgrade