Intel

AIKIDO-2026-381234

zerocopy-derive is vulnerable to Incorrect Type Conversion

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Oct 13, 2026
October 13, 2026

55

CVE Score

Medium

Incorrect Type Conversion

Are you affected? Scan for Free

TL;DR

The zerocopy-derive macros parse #[repr(...)] attributes and field invariants to decide whether a type's FromBytes, FromZeros, and related trait implementations are sound. A representation attribute written with a raw identifier, such as #[r#repr(...)], fails that comparison, so the macros record the wrong layout and emit an unsafe trait implementation. Downstream code can then build or read a value from a byte buffer that does not match the type's real layout or validity rules, which is undefined behavior when that value is used. The fix matches raw identifiers and ordinary spellings as the same name before those representation checks.

How do I fix this?

Upgrade the zerocopy-derive library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you derive FromBytes, IntoBytes, TryFromBytes, or KnownLayout on a type whose #[repr(...)] attribute uses a raw identifier.

Versions

0.8.0 - 0.8.57

Fixed in 0.8.58

Background info

zerocopy-derive is vulnerable to Incorrect Type Conversion in versions 0.8.0 - 0.8.57.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea