zerocopy-derive is vulnerable to Incorrect Type Conversion
55
Medium Risk
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.
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.
zerocopy-derive is vulnerable to Incorrect Type Conversion in versions 0.8.0 - 0.8.57.
Upgrade the zerocopy-derive library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

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.