# CVE-2021-38196: Remote code execution in better-macro

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.57%, higher than 85% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-07-22T12:00:00.000Z
- Modified: 2026-11-29T18:32:32.000Z
- Also known as: GHSA-79wf-qcqv-r22r, RUSTSEC-2021-0077
- Weaknesses: CWE-78, CWE-94
- Assigned by: mitre

## 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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- better-macro (crates.io): up to 1.0.4; from 0.0.0-0
- better-macro_project better-macro: up to 2021-07-22

## Every score

- GitHub: CVSS:3.1 9.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: 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`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://rustsec.org/advisories/RUSTSEC-2021-0077.html> (exploit, advisory, 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

- CVE List: [CVE-2021-38196](https://www.cve.org/CVERecord?id=CVE-2021-38196), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-79wf-qcqv-r22r](https://github.com/advisories/GHSA-79wf-qcqv-r22r), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2021-0077](https://rustsec.org/advisories/RUSTSEC-2021-0077.html), CC0-1.0, modified 2026-11-29
- NVD: [CVE-2021-38196](https://nvd.nist.gov/vuln/detail/CVE-2021-38196), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-38196 · Whole record: https://cve.day/CVE-2021-38196.json · Rebuilt by cve.day 2026-11-29T19:07:10.799Z
