# CVE-2024-40635: containerd has an integer overflow in User ID handling

> An integer overflow in containerd allows containers to run as root instead of a specified non-root user, enabling privilege escalation.

- **Severity:** Medium 4.6 (`CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Mar 2025
- **Updated:** 4 May 2025
- **Also known as:** AZL-58844, AZL-58845, AZL-58867, AZL-60893, AZL-60897, BELL-CVE-2024-40635, CLEANSTART-2026-OH61175, CLEANSTART-2026-PU63408, CLEANSTART-2026-YJ28693, DEBIAN-CVE-2024-40635, DLA-4153-1, GHSA-265r-hfxg-fhmg, GO-2025-3528, MGASA-2025-0130, MINI-223v-gm7g-jh83, MINI-22xj-7w64-cqgc, MINI-26gq-j42q-2vxw, MINI-2cvc-crfx-jh2g, MINI-332w-9vfc-c43w, MINI-33vc-hgpm-26ww, MINI-34hj-7p2x-jqcr, MINI-368j-fh4g-f47m, MINI-373g-qm5h-mc2c, MINI-428x-v43v-pjg6, MINI-498j-gj78-chc2, MINI-4qhq-hvjv-7q9m, MINI-4wrw-6824-473w, MINI-5295-3q95-q2ph, MINI-5694-2mcc-qf86, MINI-5cwr-c587-cc4c, MINI-5rcg-jvvq-xrhp, MINI-5v52-p4hf-5v9g, MINI-6xvc-gq2v-g9g9, MINI-775p-2j3c-jmcf, MINI-7cf2-p352-w6c3, MINI-7p7c-m5mv-fcrg, MINI-88rv-j8rh-cp8g, MINI-89v2-2hpm-7j46, MINI-8ffx-2m52-8g97, MINI-8fx4-r259-r2rh, MINI-8gp7-4f2r-w78p, MINI-8hvx-p4pv-h957, MINI-8pjg-3624-gg63, MINI-953w-g9gm-jcjp, MINI-99j6-9p8r-x9r6, MINI-c4qf-r22h-cffw, MINI-cwh9-h676-w3w9, MINI-cxfw-vrrq-h522, MINI-f235-vrgm-mh53, MINI-f4x8-5vvv-cjwc, MINI-f5m3-7c87-m7c6, MINI-f6mx-qvwc-36fw, MINI-f6qp-hchq-5hq9, MINI-f6rv-9cpx-x83x, MINI-fc59-ff28-f594, MINI-fgv8-8hp7-4v33, MINI-fmfj-wr5r-c4rh, MINI-g265-gvf7-fx8r, MINI-g4m2-8hfp-fqh3, MINI-gm3c-884j-h6rv, MINI-gqpf-4fwx-jgpq, MINI-grfc-947w-v943, MINI-gv7p-9854-5q8p, MINI-gx5w-gh29-gqq7, MINI-gxhh-x4c6-m2j4, MINI-gxpj-xcwg-xh5r, MINI-gxv7-v366-8qvr, MINI-j53g-259c-3p6f, MINI-jf44-c76x-vwxq, MINI-jf79-wxpm-37j6, MINI-jp8q-c47w-8c53, MINI-m24w-mpwr-ghgj, MINI-m35f-mxv6-g9rr, MINI-m7mq-5hvx-89qw, MINI-m7qf-8g53-j3fr, MINI-mq8f-g3h6-cmcr, MINI-p4fq-p4xw-9cvf, MINI-p8gc-pvqf-cppx, MINI-q2fg-c2pv-4222, MINI-q5w8-fgx4-gjcv, MINI-qmpp-c7xf-7f5w, MINI-qx5h-c2xg-4fx4, MINI-w8wq-638q-2x57, MINI-wmwf-69jr-gqjq, MINI-wpq5-r274-jhxw, MINI-wqhf-2m3v-h5hr, MINI-wr4x-wrrw-4w32, MINI-x297-jq8f-35g9, MINI-x75h-g73m-664j, MINI-xx77-6fx6-7q4w, OESA-2025-1324, OESA-2025-1325, OESA-2025-1348, OESA-2025-1349, OESA-2025-1350, ROOT-APP-GOBINARY-CVE-2024-40635, SUSE-SU-2025:1345-1, SUSE-SU-2025:1346-1, SUSE-SU-2025:20216-1, SUSE-SU-2025:20459-1, UBUNTU-CVE-2024-40635, USN-7374-1, openSUSE-SU-2025:15039-1, openSUSE-SU-2025:15169-1

## What is CVE-2024-40635?

CVE-2024-40635 is a medium-severity vulnerability in Debian Debian Linux, published on 17 Mar 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

containerd is an open-source container runtime. A bug was found in containerd prior to versions 1.6.38, 1.7.27, and 2.0.4 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. This bug has been fixed in containerd 1.6.38, 1.7.27, and 2.04. As a workaround, ensure that only trusted images are used and that only trusted users have permissions to import images.

Weakness: CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2024-40635?

8 open source packages ship an affected version, including github.com/containerd/containerd and github.com/containerd/containerd/v2. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/containerd/containerd` | Go | All versions | 1.6.38, 1.7.27 |
| `github.com/containerd/containerd` | Go | All versions | 1.6.38 |
| `github.com/containerd/containerd` | Go | All versions | 1.6.38 |
| `github.com/containerd/containerd` | Go | From 1.7.0-beta.0 | 1.7.27 |
| `github.com/containerd/containerd` | Go | From 1.7.0-beta.0 | 1.7.27 |
| `github.com/containerd/containerd/v2` | Go | All versions | 2.0.4 |
| `github.com/containerd/containerd/v2` | Go | All versions | 2.0.4 |
| `github.com/containerd/containerd/v2` | Go | All versions | 2.0.4 |
| `containerd` | SUSE:Linux Enterprise Micro 5.1 | All versions | 1.7.27-150000.123.1 |
| `containerd` | SUSE:Linux Enterprise Micro 5.2 | All versions | 1.7.27-150000.123.1 |
| `containerd` | SUSE:Linux Enterprise Micro 5.3 | All versions | 1.7.27-150000.123.1 |
| `containerd` | SUSE:Linux Enterprise Micro 5.4 | All versions | 1.7.27-150000.123.1 |
| `containerd` | SUSE:Linux Enterprise Micro 5.5 | All versions | 1.7.27-150000.123.1 |
| `containerd` | SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.7.27-150000.123.1 |
| `containerd` | SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | All versions | 1.7.27-16.100.1 |
| `containerd` | SUSE:Linux Micro 6.0 | All versions | 1.7.27-1.1 |
| `containerd` | SUSE:Linux Micro 6.1 | All versions | 1.7.27-slfo.1.1_1.1 |
| `containerd` | openSUSE:Leap 15.6 | All versions | 1.7.27-150000.123.1 |
| `cmctl` | openSUSE:Tumbleweed | All versions | 2.2.0-1.1 |
| `containerd` | openSUSE:Tumbleweed | All versions | 1.7.27-1.1 |

Products: Debian Debian Linux, Linuxfoundation Containerd.

## How do I fix CVE-2024-40635?

Upgrade github.com/containerd/containerd to a fixed version for your release line: 1.6.38 or 1.7.27.

## Is CVE-2024-40635 being exploited?

There is no known exploitation of CVE-2024-40635 in the wild and no public exploit code.

Public exploit code:

- Proof of Concept code for proving CVE-2024-40635 vulnerability  (github_poc): https://github.com/yen5004/CVE-2024-40635_POC

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-40635 and fix it if it is affected.

What it is: CVE-2024-40635 is a medium-severity vulnerability in Debian Debian Linux, published on 17 Mar 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-40635 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/containerd/containerd (Go): affected all versions; fixed in 1.6.38, 1.7.27
- github.com/containerd/containerd (Go): affected all versions; fixed in 1.6.38
- github.com/containerd/containerd (Go): affected all versions; fixed in 1.6.38
- github.com/containerd/containerd (Go): affected from 1.7.0-beta.0; fixed in 1.7.27
- github.com/containerd/containerd (Go): affected from 1.7.0-beta.0; fixed in 1.7.27
- github.com/containerd/containerd/v2 (Go): affected all versions; fixed in 2.0.4
- github.com/containerd/containerd/v2 (Go): affected all versions; fixed in 2.0.4
- github.com/containerd/containerd/v2 (Go): affected all versions; fixed in 2.0.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-40635/ (Markdown: https://insights.sbomify.com/CVE-2024-40635/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-40635
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-40635
- OSV: https://osv.dev/vulnerability/CVE-2024-40635

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-40635/
Summaries are generated and may contain mistakes; the official description above is the record.
