CVE-2021-38196
Rust vulnerability analysis and mitigation

Overview

An issue was discovered in the better-macro crate through 2021-07-22 for Rust. The crate intentionally demonstrates that remote attackers can execute arbitrary code via proc-macros, and otherwise has no legitimate purpose. The vulnerability is tracked as CVE-2021-38196 with a CVSS v3.1 base score of 9.8 (CRITICAL) (NVD).

Technical details

The vulnerability exists in the better-macro crate's println function for versions >1.0.0. The crate was created specifically to demonstrate that proc-macros can be used to execute arbitrary code. It opens a URL (https://github.com/raycar5/better-macro/blob/master/doc/hi.md) which, while not currently malicious, could potentially be changed to serve malicious content (RustSec Advisory).

Impact

The vulnerability allows remote attackers to execute arbitrary code through proc-macros. While the current implementation only opens a non-malicious URL, the potential impact is critical as it could be modified to execute malicious code (RustSec Advisory).

Mitigation and workarounds

There are no patches available for this vulnerability. The only mitigation is to avoid using the better-macro crate entirely, as it has no legitimate purpose or functionality (RustSec Advisory).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-2fjw-whxm-9v4qCRITICAL9.3
  • RustRust
  • nftnl
NoYesNov 25, 2025
CVE-2025-66017HIGH8.2
  • RustRust
  • cggmp21
NoYesNov 25, 2025
GHSA-mj73-j457-8x9qLOW2.7
  • RustRust
  • maxminddb
NoYesDec 02, 2025
GHSA-pq5v-rwp8-p7gmLOW2.7
  • RustRust
  • rtvm-interpreter
NoNoDec 02, 2025
RUSTSEC-2025-0132N/AN/A
  • RustRust
  • maxminddb
NoYesNov 28, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management