All the vulnerabilites related to rust-lang - cargo
cve-2022-36113
Vulnerability from cvelistv5
Published
2022-09-14 00:00
Modified
2024-08-03 09:52
Severity ?
EPSS score ?
Summary
Extracting malicious crates can corrupt arbitrary files
References
▼ | URL | Tags |
---|---|---|
https://github.com/rust-lang/cargo/security/advisories/GHSA-rfj2-q3h3-hm5j | x_refsource_CONFIRM | |
https://github.com/rust-lang/cargo/commit/97b80919e404b0768ea31ae329c3b4da54bed05a | x_refsource_MISC |
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-03T09:52:00.553Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-rfj2-q3h3-hm5j", "tags": [ "x_refsource_CONFIRM", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-rfj2-q3h3-hm5j" }, { "name": "https://github.com/rust-lang/cargo/commit/97b80919e404b0768ea31ae329c3b4da54bed05a", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/commit/97b80919e404b0768ea31ae329c3b4da54bed05a" } ], "title": "CVE Program Container" } ], "cna": { "affected": [ { "product": "cargo", "vendor": "rust-lang", "versions": [ { "status": "affected", "version": "\u003c 0.65.0" }, { "status": "affected", "version": "= 0.66.0" } ] } ], "descriptions": [ { "lang": "en", "value": "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\u0027s 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.\nMitigations 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." } ], "metrics": [ { "cvssV3_1": { "attackComplexity": "HIGH", "attackVector": "NETWORK", "availabilityImpact": "LOW", "baseScore": 4.6, "baseSeverity": "MEDIUM", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "privilegesRequired": "LOW", "scope": "UNCHANGED", "userInteraction": "REQUIRED", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L", "version": "3.1" } } ], "problemTypes": [ { "descriptions": [ { "cweId": "CWE-22", "description": "CWE-22: Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027)", "lang": "en", "type": "CWE" } ] } ], "providerMetadata": { "dateUpdated": "2023-08-14T16:16:10.762Z", "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "shortName": "GitHub_M" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-rfj2-q3h3-hm5j", "tags": [ "x_refsource_CONFIRM" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-rfj2-q3h3-hm5j" }, { "name": "https://github.com/rust-lang/cargo/commit/97b80919e404b0768ea31ae329c3b4da54bed05a", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/cargo/commit/97b80919e404b0768ea31ae329c3b4da54bed05a" } ], "source": { "advisory": "GHSA-rfj2-q3h3-hm5j", "discovery": "UNKNOWN" }, "title": "Extracting malicious crates can corrupt arbitrary files" } }, "cveMetadata": { "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "assignerShortName": "GitHub_M", "cveId": "CVE-2022-36113", "datePublished": "2022-09-14T00:00:00", "dateReserved": "2022-07-15T00:00:00", "dateUpdated": "2024-08-03T09:52:00.553Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1" }
cve-2023-38497
Vulnerability from cvelistv5
Published
2023-08-04 15:51
Modified
2024-10-08 18:06
Severity ?
EPSS score ?
Summary
Cargo not respecting umask when extracting crate archives
References
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-02T17:46:55.143Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87", "tags": [ "x_refsource_CONFIRM", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87" }, { "name": "https://github.com/rust-lang/cargo/pull/12443", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/pull/12443" }, { "name": "https://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff" }, { "name": "https://en.wikipedia.org/wiki/Umask", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://en.wikipedia.org/wiki/Umask" }, { "name": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497" }, { "name": "https://www.rust-lang.org/policies/security", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://www.rust-lang.org/policies/security" }, { "tags": [ "x_transferred" ], "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4/" }, { "tags": [ "x_transferred" ], "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4/" } ], "title": "CVE Program Container" }, { "affected": [ { "cpes": [ "cpe:2.3:a:rust-lang:cargo:*:*:*:*:*:rust:*:*" ], "defaultStatus": "unknown", "product": "cargo", "vendor": "rust-lang", "versions": [ { "lessThan": "0.72.2", "status": "affected", "version": "0", "versionType": "custom" } ] } ], "metrics": [ { "other": { "content": { "id": "CVE-2023-38497", "options": [ { "Exploitation": "none" }, { "Automatable": "no" }, { "Technical Impact": "total" } ], "role": "CISA Coordinator", "timestamp": "2024-10-08T18:02:25.711058Z", "version": "2.0.3" }, "type": "ssvc" } } ], "providerMetadata": { "dateUpdated": "2024-10-08T18:06:00.736Z", "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP" }, "title": "CISA ADP Vulnrichment" } ], "cna": { "affected": [ { "product": "cargo", "vendor": "rust-lang", "versions": [ { "status": "affected", "version": "\u003c 0.72.2" } ] } ], "descriptions": [ { "lang": "en", "value": "Cargo downloads the Rust project\u2019s dependencies and compiles the project. Cargo prior to version 0.72.2, bundled with Rust prior to version 1.71.1, did not respect the umask when extracting crate archives on UNIX-like systems. If the user downloaded a crate containing files writeable by any local user, another local user could exploit this to change the source code compiled and executed by the current user. To prevent existing cached extractions from being exploitable, the Cargo binary version 0.72.2 included in Rust 1.71.1 or later will purge caches generated by older Cargo versions automatically. As a workaround, configure one\u0027s system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`." } ], "metrics": [ { "cvssV3_1": { "attackComplexity": "LOW", "attackVector": "LOCAL", "availabilityImpact": "NONE", "baseScore": 7.8, "baseSeverity": "HIGH", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "LOW", "scope": "CHANGED", "userInteraction": "REQUIRED", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N", "version": "3.1" } } ], "problemTypes": [ { "descriptions": [ { "cweId": "CWE-278", "description": "CWE-278: Insecure Preserved Inherited Permissions", "lang": "en", "type": "CWE" } ] } ], "providerMetadata": { "dateUpdated": "2023-08-04T15:51:44.878Z", "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "shortName": "GitHub_M" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87", "tags": [ "x_refsource_CONFIRM" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87" }, { "name": "https://github.com/rust-lang/cargo/pull/12443", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/cargo/pull/12443" }, { "name": "https://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff" }, { "name": "https://en.wikipedia.org/wiki/Umask", "tags": [ "x_refsource_MISC" ], "url": "https://en.wikipedia.org/wiki/Umask" }, { "name": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497" }, { "name": "https://www.rust-lang.org/policies/security", "tags": [ "x_refsource_MISC" ], "url": "https://www.rust-lang.org/policies/security" }, { "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4/" }, { "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4/" } ], "source": { "advisory": "GHSA-j3xp-wfr4-hx87", "discovery": "UNKNOWN" }, "title": "Cargo not respecting umask when extracting crate archives" } }, "cveMetadata": { "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "assignerShortName": "GitHub_M", "cveId": "CVE-2023-38497", "datePublished": "2023-08-04T15:51:44.878Z", "dateReserved": "2023-07-18T16:28:12.076Z", "dateUpdated": "2024-10-08T18:06:00.736Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1" }
cve-2022-46176
Vulnerability from cvelistv5
Published
2023-01-11 20:07
Modified
2024-08-03 14:24
Severity ?
EPSS score ?
Summary
Cargo did not verify SSH host keys
References
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-03T14:24:03.428Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j", "tags": [ "x_refsource_CONFIRM", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j" }, { "name": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176" }, { "tags": [ "x_transferred" ], "url": "http://www.openwall.com/lists/oss-security/2023/11/05/6" }, { "tags": [ "x_transferred" ], "url": "http://www.openwall.com/lists/oss-security/2023/11/06/5" } ], "title": "CVE Program Container" } ], "cna": { "affected": [ { "product": "cargo", "vendor": "rust-lang", "versions": [ { "status": "affected", "version": "\u003c= 0.67.0" } ] } ], "descriptions": [ { "lang": "en", "value": "Cargo is a Rust package manager. The Rust Security Response WG was notified that Cargo did not perform SSH host key verification when cloning indexes and dependencies via SSH. An attacker could exploit this to perform man-in-the-middle (MITM) attacks. This vulnerability has been assigned CVE-2022-46176. All Rust versions containing Cargo before 1.66.1 are vulnerable. Note that even if you don\u0027t explicitly use SSH for alternate registry indexes or crate dependencies, you might be affected by this vulnerability if you have configured git to replace HTTPS connections to GitHub with SSH (through git\u0027s [`url.\u003cbase\u003e.insteadOf`][1] setting), as that\u0027d cause you to clone the crates.io index through SSH. Rust 1.66.1 will ensure Cargo checks the SSH host key and abort the connection if the server\u0027s public key is not already trusted. We recommend everyone to upgrade as soon as possible. " } ], "metrics": [ { "cvssV3_1": { "attackComplexity": "HIGH", "attackVector": "NETWORK", "availabilityImpact": "NONE", "baseScore": 5.3, "baseSeverity": "MEDIUM", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "privilegesRequired": "NONE", "scope": "UNCHANGED", "userInteraction": "REQUIRED", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N", "version": "3.1" } } ], "problemTypes": [ { "descriptions": [ { "cweId": "CWE-347", "description": "CWE-347: Improper Verification of Cryptographic Signature", "lang": "en", "type": "CWE" } ] } ], "providerMetadata": { "dateUpdated": "2023-01-11T20:07:12.847Z", "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "shortName": "GitHub_M" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j", "tags": [ "x_refsource_CONFIRM" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j" }, { "name": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176" }, { "url": "http://www.openwall.com/lists/oss-security/2023/11/05/6" }, { "url": "http://www.openwall.com/lists/oss-security/2023/11/06/5" } ], "source": { "advisory": "GHSA-r5w3-xm58-jv6j", "discovery": "UNKNOWN" }, "title": "Cargo did not verify SSH host keys" } }, "cveMetadata": { "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "assignerShortName": "GitHub_M", "cveId": "CVE-2022-46176", "datePublished": "2023-01-11T20:07:12.847Z", "dateReserved": "2022-11-28T17:27:19.999Z", "dateUpdated": "2024-08-03T14:24:03.428Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1" }
cve-2023-40030
Vulnerability from cvelistv5
Published
2023-08-24 22:56
Modified
2024-09-30 19:09
Severity ?
EPSS score ?
Summary
Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports
References
▼ | URL | Tags |
---|---|---|
https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p | x_refsource_CONFIRM | |
https://github.com/rust-lang/cargo/pull/12291 | x_refsource_MISC | |
https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33 | x_refsource_MISC | |
https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365 | x_refsource_MISC |
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-02T18:24:54.788Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p", "tags": [ "x_refsource_CONFIRM", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p" }, { "name": "https://github.com/rust-lang/cargo/pull/12291", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/pull/12291" }, { "name": "https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33" }, { "name": "https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365" } ], "title": "CVE Program Container" }, { "metrics": [ { "other": { "content": { "id": "CVE-2023-40030", "options": [ { "Exploitation": "none" }, { "Automatable": "no" }, { "Technical Impact": "partial" } ], "role": "CISA Coordinator", "timestamp": "2024-09-30T19:08:43.006051Z", "version": "2.0.3" }, "type": "ssvc" } } ], "providerMetadata": { "dateUpdated": "2024-09-30T19:09:34.361Z", "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP" }, "title": "CISA ADP Vulnrichment" } ], "cna": { "affected": [ { "product": "cargo", "vendor": "rust-lang", "versions": [ { "status": "affected", "version": "\u003e= 1.60.0, \u003c 1.72" } ] } ], "descriptions": [ { "lang": "en", "value": "Cargo downloads a Rust project\u2019s dependencies and compiles the project. Starting in Rust 1.60.0 and prior to 1.72, Cargo did not escape Cargo feature names when including them in the report generated by `cargo build --timings`. A malicious package included as a dependency may inject nearly arbitrary HTML here, potentially leading to cross-site scripting if the report is subsequently uploaded somewhere. The vulnerability affects users relying on dependencies from git, local paths, or alternative registries. Users who solely depend on crates.io are unaffected.\n\nRust 1.60.0 introduced `cargo build --timings`, which produces a report of how long the different steps of the build process took. It includes lists of Cargo features for each crate. Prior to Rust 1.72, Cargo feature names were allowed to contain almost any characters (with some exceptions as used by the feature syntax), but it would produce a future incompatibility warning about them since Rust 1.49. crates.io is far more stringent about what it considers a valid feature name and has not allowed such feature names. As the feature names were included unescaped in the timings report, they could be used to inject Javascript into the page, for example with a feature name like `features = [\"\u003cimg src=\u0027\u0027 onerror=alert(0)\"]`. If this report were subsequently uploaded to a domain that uses credentials, the injected Javascript could access resources from the website visitor.\n\nThis issue was fixed in Rust 1.72 by turning the future incompatibility warning into an error. Users should still 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 has server-side checks preventing this attack, and there are no packages on crates.io exploiting these vulnerabilities. crates.io users still need to excercise care in choosing their dependencies though, as remote code execution is allowed by design there as well." } ], "metrics": [ { "cvssV3_1": { "attackComplexity": "LOW", "attackVector": "NETWORK", "availabilityImpact": "NONE", "baseScore": 6.1, "baseSeverity": "MEDIUM", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "privilegesRequired": "NONE", "scope": "CHANGED", "userInteraction": "REQUIRED", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "version": "3.1" } } ], "problemTypes": [ { "descriptions": [ { "cweId": "CWE-79", "description": "CWE-79: Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)", "lang": "en", "type": "CWE" } ] } ], "providerMetadata": { "dateUpdated": "2023-08-24T22:56:41.085Z", "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "shortName": "GitHub_M" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p", "tags": [ "x_refsource_CONFIRM" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p" }, { "name": "https://github.com/rust-lang/cargo/pull/12291", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/cargo/pull/12291" }, { "name": "https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33" }, { "name": "https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365" } ], "source": { "advisory": "GHSA-wrrj-h57r-vx9p", "discovery": "UNKNOWN" }, "title": "Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports" } }, "cveMetadata": { "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "assignerShortName": "GitHub_M", "cveId": "CVE-2023-40030", "datePublished": "2023-08-24T22:56:41.085Z", "dateReserved": "2023-08-08T13:46:25.244Z", "dateUpdated": "2024-09-30T19:09:34.361Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1" }
cve-2022-36114
Vulnerability from cvelistv5
Published
2022-09-14 00:00
Modified
2024-08-03 09:52
Severity ?
EPSS score ?
Summary
Extracting malicious crates can fill the file system
References
▼ | URL | Tags |
---|---|---|
https://github.com/rust-lang/cargo/security/advisories/GHSA-2hvr-h6gw-qrxp | x_refsource_CONFIRM | |
https://github.com/rust-lang/cargo/commit/d1f9553c825f6d7481453be8d58d0e7f117988a7 | x_refsource_MISC |
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-03T09:52:00.594Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-2hvr-h6gw-qrxp", "tags": [ "x_refsource_CONFIRM", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-2hvr-h6gw-qrxp" }, { "name": "https://github.com/rust-lang/cargo/commit/d1f9553c825f6d7481453be8d58d0e7f117988a7", "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "https://github.com/rust-lang/cargo/commit/d1f9553c825f6d7481453be8d58d0e7f117988a7" } ], "title": "CVE Program Container" } ], "cna": { "affected": [ { "product": "cargo", "vendor": "rust-lang", "versions": [ { "status": "affected", "version": "\u003c 0.65.0" }, { "status": "affected", "version": "= 0.66.0" } ] } ], "descriptions": [ { "lang": "en", "value": "Cargo is a package manager for the rust programming language. It was discovered that Cargo did not limit the amount of data extracted from compressed archives. An attacker could upload to an alternate registry a specially crafted package that extracts way more data than its size (also known as a \"zip bomb\"), exhausting the disk space on the machine using Cargo to download 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\u0027s 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. We recommend users of alternate registries to excercise 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 excercise care in choosing their dependencies though, as the same concerns about build scripts and procedural macros apply here." } ], "metrics": [ { "cvssV3_1": { "attackComplexity": "HIGH", "attackVector": "NETWORK", "availabilityImpact": "HIGH", "baseScore": 4.8, "baseSeverity": "MEDIUM", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "privilegesRequired": "LOW", "scope": "UNCHANGED", "userInteraction": "REQUIRED", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H", "version": "3.1" } } ], "problemTypes": [ { "descriptions": [ { "cweId": "CWE-400", "description": "CWE-400: Uncontrolled Resource Consumption", "lang": "en", "type": "CWE" } ] } ], "providerMetadata": { "dateUpdated": "2023-08-14T16:17:41.758Z", "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "shortName": "GitHub_M" }, "references": [ { "name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-2hvr-h6gw-qrxp", "tags": [ "x_refsource_CONFIRM" ], "url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-2hvr-h6gw-qrxp" }, { "name": "https://github.com/rust-lang/cargo/commit/d1f9553c825f6d7481453be8d58d0e7f117988a7", "tags": [ "x_refsource_MISC" ], "url": "https://github.com/rust-lang/cargo/commit/d1f9553c825f6d7481453be8d58d0e7f117988a7" } ], "source": { "advisory": "GHSA-2hvr-h6gw-qrxp", "discovery": "UNKNOWN" }, "title": "Extracting malicious crates can fill the file system" } }, "cveMetadata": { "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa", "assignerShortName": "GitHub_M", "cveId": "CVE-2022-36114", "datePublished": "2022-09-14T00:00:00", "dateReserved": "2022-07-15T00:00:00", "dateUpdated": "2024-08-03T09:52:00.594Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1" }