Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. pprof
  4. ›
  5. GHSA-gw5w-5j7f-jmjj

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

December 5, 2024

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.

References

  • github.com/advisories/GHSA-gw5w-5j7f-jmjj
  • github.com/tikv/pprof-rs
  • github.com/tikv/pprof-rs/issues/232
  • rustsec.org/advisories/RUSTSEC-2024-0408.html

Code Behaviors & Features

Detect and mitigate GHSA-gw5w-5j7f-jmjj with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.14.0

Fixed versions

  • 0.14.0

Solution

Upgrade to version 0.14.0 or above.

Source file

cargo/pprof/GHSA-gw5w-5j7f-jmjj.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:38 +0000.