# GHSA-f7qj-v3vp-4856: libafl has unsound usages of `core::slice::from_raw_parts_mut`

- Severity: Medium (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-12-19T12:00:00.000Z
- Modified: 2025-10-28T06:29:24.276Z
- Also known as: RUSTSEC-2024-0424

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

(As written by GitHub Advisory Database.)

## Affected

- libafl (crates.io): before 0.11.2; from 0.0.0-0 before 0.11.2

## References

- <https://github.com/AFLplusplus/LibAFL/issues/1526> (report, web)
- <https://github.com/AFLplusplus/LibAFL/pull/1530> (web)
- <https://github.com/AFLplusplus/LibAFL/pull/1530/commits/5a60cb31ef587d71d09d534bba39bd3973c4b35d> (web)
- <https://github.com/AFLplusplus/LibAFL/commit/f70a16a09a8096d3c50159dd8a912a75c2af157c> (web)
- <https://github.com/AFLplusplus/LibAFL> (package)
- <https://rustsec.org/advisories/RUSTSEC-2024-0424.html> (advisory, web)
- <https://crates.io/crates/libafl> (package)

## Sources

- GitHub Advisory Database: [GHSA-f7qj-v3vp-4856](https://github.com/advisories/GHSA-f7qj-v3vp-4856), CC-BY-4.0, modified 2025-10-28
- RustSec Advisory Database: [RUSTSEC-2024-0424](https://rustsec.org/advisories/RUSTSEC-2024-0424.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-f7qj-v3vp-4856 · Whole record: https://cve.day/GHSA-f7qj-v3vp-4856.json · Rebuilt by cve.day 2026-11-25T22:56:43.231Z
