---
id: CVE-2026-75904
title: >-
  libmodplug through 0.8.9.1 contains an out-of-bounds read in pat_smplooped in
  src/load_pat.cpp
summary: >-
  libmodplug through 0.8.9.1 contains an out-of-bounds read in pat_smplooped in
  src/load_pat.cpp. The function validates only the upper bound of its sample
  index against MAXSMP and then subtracts one before indexing the 191-byte
  static arr…
severity: low
cvss: 3.3
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N'
cwe:
  - CWE-125
published: '2026-08-18'
updated: '2026-09-08'
sourceUpdated: '2026-09-08T20:32:39.347'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-75904'
references:
  - url: 'https://github.com/Konstanty/libmodplug'
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/Konstanty/libmodplug/blob/d1b97ed0020bc620a059d3675d1854b40bd2608d/src/load_mid.cpp#L829
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/Konstanty/libmodplug/blob/d1b97ed0020bc620a059d3675d1854b40bd2608d/src/load_pat.cpp#L213-L217
    label: disclosure@vulncheck.com
  - url: 'https://github.com/Konstanty/libmodplug/issues/103'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/libmodplug-out-of-bounds-read-in-pat-smplooped-via-crafted-midi-file
    label: disclosure@vulncheck.com
  - url: 'https://github.com/Konstanty/libmodplug/issues/103'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
tags:
  - nvd
  - cve.org
  - exploit-available
epss: 0.0017
epssPercentile: 0.05536
ingestedAt: '2026-09-08T21:11:12.281Z'
vendor: Konstanty Bialkowski
product: libmodplug
affected:
  - libmodplug <= 0.8.9.1
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-08-18T15:35:53.142035Z'
---

## Overview

libmodplug through 0.8.9.1 contains an out-of-bounds read in pat_smplooped in src/load_pat.cpp. The function validates only the upper bound of its sample index against MAXSMP and then subtracts one before indexing the 191-byte static array pat_loops, so an index of zero reads pat_loops[-1], one byte before the array. The index is the smpno field of a parsed MIDI event, which is initialised to zero and only later overwritten from a program-change parameter, so an event reaching the note test before an instrument is assigned carries zero. A 32-byte MIDI file supplied to the library's public ModPlug_Load entry point drives the path through CSoundFile::Create, CSoundFile::ReadMID, and MID_ReadPatterns to the read. The byte read out of bounds determines whether a note event is treated as looping, so adjacent static storage influences playback state.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
