
CVE catalog
CVE-2022-36113
cargo: CVE-2022-36113
- Severity
- Medium · CVSS 5.4
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:L - Published
- Source
- [NVD] · [CVE record]
- EPSS
- 1.21% · Oct 25, 2026
Cargo is a package manager for the rust programming language. After a package is downloaded, Cargo extracts its source code in the ~/.cargo folder on disk, making it available to the Rust projects it builds. To record when an extraction is successful, Cargo writes "ok" to the .cargo-ok file at the root of the extracted source code once it extracted all the files. It was discovered that Cargo allowed packages to contain a .cargo-ok symbolic link, which Cargo would extract. Then, when Cargo attempted to write "ok" into .cargo-ok, it would actually replace the first two bytes of the file the symlink pointed to with ok. This would allow an attacker to corrupt one file on the machine using Cargo to extract the package. Note that by design Cargo allows code execution at build time, due to build scripts and procedural macros. The vulnerabilities in this advisory allow performing a subset of the possible damage in a harder to track down way. Your dependencies must still be trusted if you want to be protected from attacks, as it's possible to perform the same attacks with build scripts and procedural macros. The vulnerability is present in all versions of Cargo. Rust 1.64, to be released on September 22nd, will include a fix for it. Since the vulnerability is just a more limited way to accomplish what a malicious build scripts or procedural macros can do, we decided not to publish Rust point releases backporting the security fix. Patch files are available for Rust 1.63.0 are available in the wg-security-response repository for people building their own toolchain. Mitigations We recommend users of alternate registries to exercise care in which package they download, by only including trusted dependencies in their projects. Please note that even with these vulnerabilities fixed, by design Cargo allows arbitrary code execution at build time thanks to build scripts and procedural macros: a malicious dependency will be able to cause damage regardless of these vulnerabilities. crates.io implemented server-side checks to reject these kinds of packages years ago, and there are no packages on crates.io exploiting these vulnerabilities. crates.io users still need to exercise care in choosing their dependencies though, as remote code execution is allowed by design there as well.
Vulnerable and fixed packages
Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | cargo | bookworm | 0.66.0+ds1-1 | fixed |
| Debian | rust-cargo | sid | 0.99.0-1 | fixed |
| Debian | rust-cargo | forky | 0.99.0-1 | fixed |
| Debian | rust-cargo | trixie | 0.86.0-2 | fixed |
| Debian | rust-cargo | bookworm | 0.66.0-1 | fixed |
| Opensuse | rust1.62 | tumbleweed | 1.62.1-3.1 | fixed |
| Ubuntu | cargo | pro | 0.19.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.22.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.22.0-0ubuntu2 | vulnerable |
| Ubuntu | cargo | pro | 0.23.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.24.0-1ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.25.0-1ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.26.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.26.0-0ubuntu2 | vulnerable |
| Ubuntu | cargo | pro | 0.29.0-1ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.31.0-3ubuntu1~18.04.4 | vulnerable |
| Ubuntu | cargo | pro | 0.32.0-1~exp1ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.33.0-1ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.35.0-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.36.0-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.37.0-3ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.38.0-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.40.0-3ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.42.0-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.44.1-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.47.0-1~exp1ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.52.0-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.54.0-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.58.0-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.60.0ubuntu1-0ubuntu1~18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.62.0ubuntu0libgit2-0ubuntu0.18.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04 | vulnerable |
| Ubuntu | cargo | pro | 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.37.0-3ubuntu2 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.38.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.39.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.39.0+really0.38.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.39.0+really0.39.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.40.0-3ubuntu1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.40.0-3ubuntu2 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.41.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.42.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.44.1-0ubuntu1~20.04.1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.47.0-1~exp1ubuntu1~20.04.1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.52.0-0ubuntu1~20.04.1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.54.0-0ubuntu1~20.04.1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.58.0-0ubuntu1~20.04.1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.60.0ubuntu1-0ubuntu1~20.04.1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.62.0ubuntu0libgit2-0ubuntu0.20.04.1 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.20.04 | vulnerable |
| Ubuntu | cargo | 20.04 | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2 | fixed |
| Ubuntu | cargo | 22.04 | 0.52.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.53.0-0ubuntu2 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.54.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.54.0-0ubuntu2 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.57.0+ubuntu-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.58.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.60.0ubuntu1-0ubuntu1~22.04.1 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.62.0ubuntu0libgit2-0ubuntu0.22.04.1 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.22.04 | vulnerable |
| Ubuntu | cargo | 22.04 | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2 | fixed |
| Opensuse | rust1.63 | tumbleweed | 1.63.0-3.1 | fixed |
| Suse | rust1.62 | linux enterprise module for development tools 15 sp3 | 1.62.1-150300.7.7.1 | fixed |
| Suse | rust1.62 | linux enterprise module for development tools 15 sp4 | 1.62.1-150300.7.7.1 | fixed |
| Opensuse | rust1.62 | leap 15.3 | 1.62.1-150300.7.7.1 | fixed |
| Opensuse | rust1.62 | leap 15.4 | 1.62.1-150300.7.7.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | cargo | source | bookworm | 0.63.1-1 | not yet assigned | Not reported | [1021142] |
| Debian | rust-cargo | source | sid | 0.66.0-1 | not yet assigned | Not reported | [1021143] |
| Debian | rust-cargo | source | forky | 0.66.0-1 | not yet assigned | Not reported | [1021143] |
| Debian | rust-cargo | source | trixie | 0.66.0-1 | not yet assigned | Not reported | [1021143] |
| Debian | rust-cargo | source | bookworm | 0.66.0-1 | not yet assigned | Not reported | [1021143] |
| Opensuse | rust1.62 | rpm | tumbleweed | 1.62.1-3.1 | Not reported | OPENSUSE-SU-2024:12343-1 | Not reported |
| Ubuntu | cargo | deb | 20.04 | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2 | Not reported | UBUNTU-CVE-2022-36113 | Not reported |
| Ubuntu | cargo | deb | 22.04 | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2 | Not reported | UBUNTU-CVE-2022-36113 | Not reported |
| Opensuse | rust1.63 | rpm | tumbleweed | 1.63.0-3.1 | Not reported | OPENSUSE-SU-2024:12344-1 | Not reported |
| Suse | rust1.62 | rpm | linux enterprise module for development tools 15 sp3 | 1.62.1-150300.7.7.1 | Not reported | SUSE-SU-2022:3451-1 | Not reported |
| Suse | rust1.62 | rpm | linux enterprise module for development tools 15 sp4 | 1.62.1-150300.7.7.1 | Not reported | SUSE-SU-2022:3451-1 | Not reported |
| Opensuse | rust1.62 | rpm | leap 15.3 | 1.62.1-150300.7.7.1 | Not reported | SUSE-SU-2022:3451-1 | Not reported |
| Opensuse | rust1.62 | rpm | leap 15.4 | 1.62.1-150300.7.7.1 | Not reported | SUSE-SU-2022:3451-1 | Not reported |
OpenFactory catalog packages
[Debian 12 (Bookworm)]
- [cargo]Fixed
Details (2)
0.66.0+ds1-1· amd64 · bookwormFixed · Fixed:
0.63.1-1dsa · cargo · debian · bookworm
0.66.0+ds1-1· arm64 · bookwormFixed · Fixed:
0.63.1-1dsa · cargo · debian · bookworm
- [cargo-doc]Fixed
Source package: [cargo]
Details (2)
0.66.0+ds1-1· all · bookwormFixed · Fixed:
0.63.1-1dsa · cargo · debian · bookworm
0.66.0+ds1-1· all · bookwormFixed · Fixed:
0.63.1-1dsa · cargo · debian · bookworm
- [librust-cargo-dev]Fixed
Source package: [rust-cargo]
Details (2)
0.66.0-1· amd64 · bookwormFixed · Fixed:
0.66.0-1dsa · rust-cargo · debian · bookworm
0.66.0-1· arm64 · bookwormFixed · Fixed:
0.66.0-1dsa · rust-cargo · debian · bookworm
Observed:
References
- [https://ftp.suse.com/pub/projects/security/csaf/suse-su-2022_3451-1.json]
- [https://osv.dev/vulnerability/SUSE-SU-2022:3451-1]
- [https://osv.dev/vulnerability/UBUNTU-CVE-2022-36113]
- [https://osv.dev/vulnerability/openSUSE-SU-2024:12343-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2024:12344-1]
- [https://security-tracker.debian.org/tracker/CVE-2022-36113]
- [https://wid.cert-bund.de/.well-known/csaf/white/2023/wid-sec-w-2023-1424.json]
[CERT-Bund public advisories] · [Debian Security Tracker] · [FIRST EPSS] · [OSV Package Vulnerability Database] · [SUSE security advisories and VEX]