Every CVESearch/Get API key

RUSTSEC-2026-0332

`WaveFormat::parse` reads past the end of a `&WAVEFORMATEX`

No scoreFix available

WaveFormat::parse is a safe function that takes a &WAVEFORMATEX, which is only valid for reads of size_of::<WAVEFORMATEX>() (18) bytes. When the header has wFormatTag == WAVE_FORMAT_EXTENSIBLE 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 size_of::<WAVEFORMATEX>() + cbSize bytes. WaveFormat::parse_from_blob_bytes (available since 0.23.0) is the safe alternative and checks the slice length against cbSize.

What each source reports

OSVNo score

`WaveFormat::parse` reads past the end of a `&WAVEFORMATEX`

WaveFormat::parse is a safe function that takes a &WAVEFORMATEX, which is only valid for reads of size_of::<WAVEFORMATEX>() (18) bytes. When the header has wFormatTag == WAVE_FORMAT_EXTENSIBLE 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 size_of::<WAVEFORMATEX>() + cbSize bytes. WaveFormat::parse_from_blob_bytes (available since 0.23.0) is the safe alternative and checks the slice length against cbSize.

Record
RUSTSEC-2026-0332
Updated
2026-11-02

Affected packages

Affected packages
PackageAffectedFixed
wasapi
crates.io
0.20.0 up to 0.25.0
0.25.0

History

History
RecordedChangedSources
first indexedOSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

RUSTSEC-2026-0332 is a vulnerability with no CVSS score yet in wasapi, published September 8, 2026. No source lists public exploit code. Fixed in wasapi 0.25.0.

References

MoveEnter Open