9.8critical
Remote code execution in better-macro
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 2.57% (higher than 85% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-79wf-qcqv-r22rRUSTSEC-2021-0077
Description
An issue was discovered in the better-macro crate through 2021-07-22 for Rust. It intentionally demonstrates that remote attackers can execute arbitrary code via proc-macros, and otherwise has no legitimate purpose.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| better-macro (crates.io) | up to 1.0.4, from 0.0.0-0 | GitHub Advisory Database, RustSec Advisory Database |
| better-macro_project better-macro | up to 2021-07-22 | NVD |
All scores
| GitHub | 9.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
An issue was discovered in the better-macro crate through 2021-07-22 for Rust. It intentionally demonstrates that remote attackers can execute arbitrary code via proc-macros, and otherwise has no legitimate purpose.
RustSec Advisory Database
better-macro is a fake crate which is "Proving A Point" that proc-macros can run arbitrary code. This is not a particularly novel or interesting observation.
It currently opens https://github.com/raycar5/better-macro/blob/master/doc/hi.md
which doesn't appear to have any malicious content, but there's no guarantee that
will remain the case.
This crate has no useful functionality, and should not be used.
NVD (es)
Se ha detectado un problema en la crate better-macro versiones hasta 22-07-2021 para Rust. Demuestra intencionalmente que atacantes remotos pueden ejecutar código arbitrario por medio de proc-macros, y por lo demás no presente ningún propósito legítimo
References
| https://rustsec.org/advisories/RUSTSEC-2021-0077.html | advisory, exploit, issue-tracking, patch, third-party-advisory, web | |
| https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/better-macro/RUSTSEC-2021-0077.md | third-party-advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-38196 | advisory | |
| https://github.com/raycar5/better-macro | package | |
| https://github.com/raycar5/better-macro/blob/24ff1702397b9c19bbfa4c660e2316cd77d3b900/src/lib.rs#L36-L38 | web | |
| https://crates.io/crates/better-macro | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-38196 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-79wf-qcqv-r22r changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0077 changed 2026-11-29 | CC0-1.0 |
| NVD | CVE-2021-38196 changed 2026-06-17 | Public domain |