zerocopy-derive is vulnerable to Incorrect Type Conversion
55
CVE Score
Medium
Incorrect Type Conversion
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.
Upgrade the zerocopy-derive library to the patch version.
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.
0.8.0 - 0.8.57
Fixed in 0.8.58zerocopy-derive is vulnerable to Incorrect Type Conversion in versions 0.8.0 - 0.8.57.
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.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.