Skip to main content
Vulnerability Database/CVE-2026-105251

CVE-2026-105251: vgmstream VAG File Handler RCE Vulnerability

CVE-2026-105251 is a remote code execution vulnerability in vgmstream VAG File Handler affecting versions up to r2117. The flaw allows attackers to exploit out-of-bounds read conditions remotely. This article covers technical details, affected versions, security impact, and available patches.

Published:

CVE-2026-105251 Overview

CVE-2026-105251 is an out-of-bounds read vulnerability [CWE-119] in vgmstream through revision r2117. The flaw resides in the ps_find_padding function within src/coding/psx_decoder.c, part of the VAG File Handler component. An attacker can trigger the condition by supplying a malformed VAG audio file that causes the decoder to read beyond the intended buffer boundary. The issue is addressed in commit 4b8316652a30d40f99ad43310bed273fd1f8a7a3. Because vgmstream is embedded in numerous audio players and foobar2000 plugins, the attack surface extends to any application that loads untrusted VAG files.

Critical Impact

Processing a crafted VAG file triggers an out-of-bounds read in the PlayStation ADPCM decoder, which can leak memory contents or crash the host application.

Affected Products

  • vgmstream up to and including revision r2117
  • vgmstream CLI, foobar2000 component, and Winamp/XMPlay plugins built from affected revisions
  • Downstream applications bundling the vulnerable psx_decoder.c component

Discovery Timeline

  • 2026-10-05 - CVE-2026-105251 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-105251

Vulnerability Analysis

The vulnerability affects ps_find_padding, a helper routine in the PlayStation ADPCM (PS-ADPCM) decoder. The function scans PS-ADPCM frames to detect padding regions used by VAG container files. When processing attacker-controlled input, the loop that walks frame-aligned data fails to validate that a full frame was actually returned by read_streamfile. A short read at end-of-file leaves buf_pos pointing past the valid data region, and the subsequent buf_pos -= frame_size arithmetic followed by frame access reads outside the stack buffer.

The condition is remotely reachable because vgmstream is routinely used to decode audio files downloaded from untrusted sources. Exploitation requires user interaction, specifically opening or scanning a malicious VAG file.

Root Cause

The root cause is missing length validation after read_streamfile. The decoder assumes that reads return at least one full frame_size worth of data, but truncated or malformed files can cause bytes to be less than frame_size. Without a bounds check, the computed buf_pos is used to index into the stack buffer buf, producing an out-of-bounds read of adjacent stack memory.

Attack Vector

An attacker crafts a VAG file with a truncated final frame and delivers it through a channel the victim trusts, such as a music archive, game asset bundle, or shared playlist. When the victim opens the file in an application linked against vulnerable vgmstream, ps_find_padding reads uninitialized stack memory. The impact ranges from process crash to limited information disclosure depending on the host application and compiler mitigations.

c
// Patch from commit 4b8316652a30d40f99ad43310bed273fd1f8a7a3
// src/coding/psx_decoder.c - ps_find_padding
            read_offset = 0; //?
        bytes = read_streamfile(buf, read_offset, sizeof(buf), sf);
        buf_pos = (bytes / frame_size * frame_size);
+       if (bytes < (int)frame_size) break;    /* not enough data for a full frame */
    }

    buf_pos -= frame_size;
// Source: https://github.com/vgmstream/vgmstream/commit/4b8316652a30d40f99ad43310bed273fd1f8a7a3

The added guard exits the loop when the stream returns fewer bytes than a complete frame, preventing the subsequent out-of-bounds arithmetic.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-105251

Indicators of Compromise

  • Unexpected crashes or segmentation faults in processes that load vgmstream, foobar2000, Winamp, or XMPlay when opening .vag files
  • VAG files with truncated final PS-ADPCM frames or sizes not aligned to the 16-byte frame boundary
  • Application telemetry showing exceptions originating from psx_decoder.c or ps_find_padding

Detection Strategies

  • Scan file repositories and user downloads for .vag files whose byte length is not a multiple of the PS-ADPCM frame size
  • Enable AddressSanitizer or similar instrumentation on test builds of vgmstream to catch out-of-bounds reads during triage
  • Correlate media-player crash dumps with recently opened untrusted audio assets

Monitoring Recommendations

  • Monitor endpoints for repeated crashes of audio-player processes, which may indicate attempted exploitation or file corruption
  • Track installation of outdated vgmstream builds and foobar2000 components across managed workstations
  • Alert on untrusted archive extractions that drop .vag or .vgmstream compatible files into user directories

How to Mitigate CVE-2026-105251

Immediate Actions Required

  • Update vgmstream to a revision that includes commit 4b8316652a30d40f99ad43310bed273fd1f8a7a3 or later
  • Rebuild and redeploy any downstream products or plugins that statically link vgmstream
  • Instruct users to avoid opening VAG files from untrusted sources until the patch is applied

Patch Information

The fix is published in the vgmstream patch commit 4b83166, merged via pull request #2001 and tracked in issue #2000. Users building from source should pull the latest master branch from the vgmstream repository. Additional context is available in the VulDB entry for CVE-2026-105251.

Workarounds

  • Restrict vgmstream usage to trusted VAG files sourced from internal or verified repositories
  • Run media players that depend on vgmstream inside a sandbox or low-privilege account to contain potential memory disclosure
  • Pre-validate VAG files by rejecting those with sizes not aligned to the PS-ADPCM frame boundary
bash
# Rebuild vgmstream from a patched source tree
git clone https://github.com/vgmstream/vgmstream.git
cd vgmstream
git log --oneline | grep 4b83166   # verify patch is present
mkdir build && cd build
cmake .. && make -j"$(nproc)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.