Every CVE Search/ Get API key

CVE-2021-38196

Remote code execution in better-macro

9.8 Critical

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

2.57%Up 1.2 points since Aug 8, 2021
90%50%10%1%

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 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
7.5 HighAV: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 CriticalCVSS: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 CriticalCVSS: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

Affected packages
PackageAffectedFixed
better-macro
crates.io
through 1.0.4 None known
better-macro
crates.io
0.0.0-0 and later None known

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE 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

MoveEnter Open