Skip to content
OpenAdvisories
Medium GHSA-f7qj-v3vp-4856 RUSTSEC-2024-0424

libafl has unsound usages of `core::slice::from_raw_parts_mut`

Published Dec 23, 2024 · Updated Oct 28, 2025 · Assigned by GHSA

Description

The library breaks the safety assumptions when using unsafe API `slice::from_raw_parts_mut`. The pointer passed to `from_raw_parts_mut` is misaligned by casting `u8` to `u16` raw pointer directly, which is unsound. The bug is patched by using `align_offset`, which could make sure the memory address is aligned to 2 bytes for `u16`.

This was patched in 0.11.2 in the [commit](https://github.com/AFLplusplus/LibAFL/pull/1530/commits/5a60cb31ef587d71d09d534bba39bd3973c4b35d).

Affected packages

EcosystemPackageAffectedFixedRecord
crates.io libafl < 0.11.2 0.11.2 GHSA-f7qj-v3vp-4856
crates.io libafl >= 0.0.0-0, < 0.11.2 0.11.2 RUSTSEC-2024-0424

References