cargo package report

Is wasapi safe?

1 known vulnerability.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so cargo packages are not covered.


      cvss
      not scored

      severity out of 10

      epss
      not scored

      chance of exploitation in 30 days

      xyz score
      not scored

      CyberXYZ composite out of 10

      fig. 01 — RUSTSEC-2026-0332, the advisory selected below

      // 1 advisories

      RUSTSEC-2026-0332

      UNKNOWN

      WaveFormat::parse is a safe function that takes a &WAVEFORMATEX, which is only valid for reads of sizeof::() (18) bytes. When the header has wFormatTag == WAVEFORMATEXTENSIBLE and cbSize >= 22, the function reinterprets the reference as a WAVEFORMATEXTENSIBLE and reads 40 bytes. Nothing in the signature guarantees that the header sits at the start of a larger buffer, so safe code can trigger an out-of-bounds read:

      use wasapi::WaveFormat;
      use windows::Win32::Media::Audio::WAVEFORMATEX;
      use windows::Win32::Media::KernelStreaming::WAVE_FORMAT_EXTENSIBLE;
      
      let header = WAVEFORMATEX {
          wFormatTag: WAVE_FORMAT_EXTENSIBLE as u16,
          nChannels: 2,
          nSamplesPerSec: 48000,
          nAvgBytesPerSec: 384000,
          nBlockAlign: 8,
          wBitsPerSample: 32,
          cbSize: 22,
      };
      // Reads 22 bytes past the end of `header`.
      let _ = WaveFormat::parse(&header);

      A more likely way to hit this is to copy the header out of a format pointer returned by WASAPI (let fmt = unsafe { ptr };) and pass &fmt. The copy keeps cbSize, but not the 22 bytes that follow it. The bytes read past the end are returned as the channel mask and subformat of the parsed format.

      The flaw was corrected in commit 2562db7, released in 0.25.0. parse is now an unsafe fn that takes a const WAVEFORMATEX, and the caller must guarantee that the pointer is valid for reads of sizeof::() + cbSize bytes. WaveFormat::parsefromblobbytes (available since 0.23.0) is the safe alternative and checks the slice length against cbSize.


      Checked 2026-10-08 at 19:29 UTC. The most recent advisory here was published 2026-09-08. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.