Skip to main content
Vulnerability Database/CVE-2025-47256

CVE-2025-47256: Libxmp Stack Buffer Overflow Vulnerability

CVE-2025-47256 is a stack-based buffer overflow in Libxmp through version 4.6.2 affecting the depack_pha function when processing malformed Pha format tracker modules. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-47256 Overview

CVE-2025-47256 is a stack-based buffer overflow in Libxmp through version 4.6.2. The flaw resides in the depack_pha function in loaders/prowizard/pha.c. A malformed Pha format tracker module delivered inside a .mod file triggers the overflow during parsing. Libxmp is a widely embedded library for rendering module music files, used by audio players, media frameworks, and games across Linux, BSD, and other platforms. The weakness is categorized under [CWE-191] Integer Underflow, which drives the out-of-bounds write on the stack during Pha depacking.

Critical Impact

A local attacker who convinces a user to open a crafted .mod file can corrupt stack memory in processes that link against Libxmp, leading to limited confidentiality, integrity, and availability impact with potential scope change to adjacent components.

Affected Products

  • Libxmp versions up to and including 4.6.2
  • Applications and media players that bundle or dynamically link Libxmp
  • Distributions that ship Libxmp as a system package

Discovery Timeline

  • 2025-05-06 - CVE-2025-47256 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-47256

Vulnerability Analysis

The vulnerability lives in depack_pha, the Pha format depacker inside Libxmp's ProWizard loader subsystem. ProWizard loaders convert legacy tracker formats into the generic MOD representation Libxmp handles natively. During this conversion, depack_pha reads length and offset fields directly from attacker-controlled file data without sufficient validation. A specially crafted Pha header produces an integer underflow that is subsequently used as a size or index when writing to a fixed-size stack buffer. The result is a classic stack-based buffer overflow that corrupts return addresses, saved registers, and adjacent stack frames.

Successful exploitation requires local file access and user interaction with a vulnerable client. Exploitation complexity is high because the attacker must shape the malformed Pha structure to pass preliminary checks while still triggering the underflow path.

Root Cause

The root cause is an integer underflow [CWE-191] in size or offset arithmetic in depack_pha at loaders/prowizard/pha.c. When a header field is smaller than an expected constant, the subtraction wraps around to a very large unsigned value. That value is then trusted by the subsequent copy loop, which writes past the end of a fixed stack buffer.

Attack Vector

An attacker crafts a .mod file containing a malformed Pha-format tracker module. The victim opens the file in any application that uses Libxmp through 4.6.2 to parse module music. During the ProWizard depack stage, the stack buffer is overrun. See the GitHub PoC Repository for CVE-2025-47256 and the GitHub Code Reference for PHA Loader for the specific code path, and the GitHub Issue Discussion #847 for maintainer context.

Detection Methods for CVE-2025-47256

Indicators of Compromise

  • Crashes or segmentation faults in processes that load .mod files through Libxmp, especially during ProWizard depacking.
  • Presence of .mod files with Pha-format signatures from untrusted sources in download folders, email attachments, or shared drives.
  • Unexpected child processes or memory region changes in audio players and media frameworks after opening a module file.

Detection Strategies

  • Inventory binaries and packages that link libxmp.so or statically embed Libxmp, and flag versions at or below 4.6.2.
  • Enable AddressSanitizer or stack-protector telemetry in test builds to catch overflow triggers against sample .mod corpora.
  • Alert on process termination with stack smashing or SIGSEGV events originating from Libxmp symbols such as depack_pha.

Monitoring Recommendations

  • Collect endpoint crash reports and core dumps from media applications and correlate backtraces that include Libxmp frames.
  • Monitor software bill of materials feeds for Libxmp version data and track remediation across managed hosts.
  • Watch for anomalous file writes or process spawns following module file opens by desktop users.

How to Mitigate CVE-2025-47256

Immediate Actions Required

  • Identify all systems and applications shipping Libxmp through 4.6.2 and schedule upgrades to a fixed release once available.
  • Restrict opening of untrusted .mod files, particularly those obtained from email, chat, or unknown download sources.
  • Run media and audio applications under least-privilege user accounts to limit the blast radius of a stack corruption.

Patch Information

Refer to the upstream project for fix status and release notes via the GitHub Issue Discussion #847 and the GitHub Code Reference for PHA Loader. Downstream Linux and BSD distributions should rebuild packages against the patched source once released and roll updates through standard package management channels.

Workarounds

  • Disable or remove ProWizard loader support in applications that permit build-time configuration of Libxmp features.
  • Sandbox media players using mechanisms such as seccomp, AppArmor, SELinux, or Firejail to contain exploitation attempts.
  • Block ingestion of .mod files at the email gateway or web proxy for user populations that do not need legacy tracker formats.
bash
# Configuration example: identify Libxmp usage on Linux hosts
dpkg -l | grep -i libxmp
rpm -qa | grep -i libxmp
ldconfig -p | grep libxmp
find / -name 'libxmp*' -type f 2>/dev/null

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

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.