CVE-2021-38196
Remote code execution in better-macro
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
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.
- Record
CVE-2021-38196- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-94
- Updated
- 2026-11-02
CVE List No score
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.
- Record
CVE-2021-38196- Updated
- 2026-11-02
EUVDEUVD-2021-1616 No score
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.
- Record
EUVD-2021-1616- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-79wf-qcqv-r22r
9.8
Remote code execution in better-macro
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.
- Record
GHSA-79wf-qcqv-r22r- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-78, CWE-94
- Updated
- 2026-11-02
OSVGHSA-79wf-qcqv-r22r
9.8
Remote code execution in better-macro
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.
- Record
GHSA-79wf-qcqv-r22r- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-78, CWE-94
- Updated
- 2026-11-02
OSVRUSTSEC-2021-0077 No score
`better-macro` has deliberate RCE to prove a point
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.
- Record
RUSTSEC-2021-0077- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
better-macrocrates.io |
through 1.0.4 | None known |
better-macrocrates.io |
0.0.0-0 and later | None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-38196 is a critical vulnerability (CVSS 9.8) in Better-macro Project Better-macro, published July 22, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.57%, the 85th percentile. No source names a fixed version.
References
rustsec.org/advisories/RUSTSEC-2021-0077.html
raw.githubusercontent.com/rustsec/advisory-db/main/crates/better-macro/RUSTSEC-2021-0077.md
nvd.nist.gov/vuln/detail/CVE-2021-38196
github.com/raycar5/better-macro/blob/24ff1702397b9c19bbfa4c660e2316cd77d3b900/src/lib.rs
github.com/advisories/GHSA-79wf-qcqv-r22r
github.com/raycar5/better-macro
crates.io/crates/better-macro