# RUSTSEC-2024-0424: Unsound usages of core::slice::from\_raw\_parts\_mut

- Database: RustSec
- Published: 2024-12-19
- Modified: 2025-10-28

## Also published as

- [GHSA-F7QJ-V3VP-4856](https://cve.now/GHSA-F7QJ-V3VP-4856.md) (GitHub)

## Affected versions

- libafl (crates.io): fixed in 0.11.2

## 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).

## References

- https://crates.io/crates/libafl
- https://rustsec.org/advisories/RUSTSEC-2024-0424.html
- https://github.com/AFLplusplus/LibAFL/issues/1526
- https://github.com/AFLplusplus/LibAFL/pull/1530

Page: https://cve.now/RUSTSEC-2024-0424

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
