Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. scratchpad
  4. ›
  5. GHSA-77h3-w9rx-hj3q

GHSA-77h3-w9rx-hj3q: User-defined implementations of the safe trait scratchpad::Tracking can cause heap buffer overflows

August 14, 2025

The get and set methods of the public trait scratchpad::Tracking interact with unsafe code regions in the crate, and they influence the computation of addresses returned as raw pointers. However, the trait itself is not marked as unsafe, meaning users may provide custom implementations under the assumption that the crate upholds all safety guarantees.

This becomes problematic because even safe implementations of get and set-written without using any unsafe code-can still result in ill-formed raw pointers. These pointers may later be dereferenced within safe APIs of the crate (e.g., marker::MarkerBack::allocate_slice_copy), potentially leading to arbitrary memory access or heap buffer overflows.

According to the penultimate commit, the crate is in maintenance mode awaiting a cleanup that will reduce the area of unsafe code. Note that the last commits to the repository are from 4 years ago.

References

  • github.com/advisories/GHSA-77h3-w9rx-hj3q
  • github.com/okready/scratchpad
  • github.com/okready/scratchpad/issues/2
  • rustsec.org/advisories/RUSTSEC-2025-0049.html

Code Behaviors & Features

Detect and mitigate GHSA-77h3-w9rx-hj3q 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 up to 1.3.1

Solution

Unfortunately, there is no solution available yet.

Weakness

  • CWE-122: Heap-based Buffer Overflow

Source file

cargo/scratchpad/GHSA-77h3-w9rx-hj3q.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Tue, 19 Aug 2025 12:18:56 +0000.