# GHSA-gw5w-5j7f-jmjj: Unsound usages of `std::slice::from_raw_parts`

- Severity: Low (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-12-04T12:00:00.000Z
- Modified: 2026-09-10T03:50:21.593Z
- Also known as: RUSTSEC-2024-0408

## Description

The library breaks the safety assumptions when using unsafe API `std::slice::from_raw_parts`. First, when using the API in iterator implementation (`TempFdArrayIterator.next`), generic type could be any type, which would create and pass a misaligned pointer to the unsafe API. Second, when validating the address, the code passed the type `c_void`, which could also be any type, leading to potential uninitialized memory exposure.  

Two unsound usages here highlight the necessity for developers to perform type checks before doing type conversion with unsafe API.  

The panic caused by the misalignment causes several downstream applications (e.g., `greptimedb`) to crash when using `pprof::report::ReportBuilder::build`.  

This was patched in 0.14.0.  

The developer also suggested moving to [pprof2](https://crates.io/crates/pprof2).

(As written by GitHub Advisory Database.)

## Affected

- pprof (crates.io): before 0.14.0; from 0.0.0-0 before 0.14.0

## References

- <https://github.com/tikv/pprof-rs/issues/232> (report, web)
- <https://github.com/tikv/pprof-rs> (package)
- <https://rustsec.org/advisories/RUSTSEC-2024-0408.html> (advisory, web)
- <https://crates.io/crates/pprof> (package)
- <https://github.com/tikv/pprof-rs/pull/255> (web)

## Sources

- GitHub Advisory Database: [GHSA-gw5w-5j7f-jmjj](https://github.com/advisories/GHSA-gw5w-5j7f-jmjj), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2024-0408](https://rustsec.org/advisories/RUSTSEC-2024-0408.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-gw5w-5j7f-jmjj · Whole record: https://cve.day/GHSA-gw5w-5j7f-jmjj.json · Rebuilt by cve.day 2026-11-25T22:56:43.226Z
