DevilutionX 1.4.0 through 1.5.5 Heap Buffer Overflow via libmpq__archive_dup
Impact
DevilutionX 1.4.0 through 1.5.5 contains a heap buffer overflow vulnerability in the bundled libmpq libmpq__archive_dup routine when opening crafted MPQ archives. Attackers can supply an MPQ archive whose block table count exceeds its hash table count, causing memcpy to overflow the heap during startup and crash the game.
Source excerpt · VulnCheckAffected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
diasurgical · DevilutionX
Other versions: unaffected
| Version / range | Source status |
|---|---|
| 1.4.0 through 1.5.5 (inclusive) | affected |
Original source description
DevilutionX 1.4.0 through 1.5.5 contains a heap buffer overflow vulnerability in the bundled libmpq libmpq__archive_dup routine when opening crafted MPQ archives. Attackers can supply an MPQ archive whose block table count exceeds its hash table count, causing memcpy to overflow the heap during startup and crash the game.
References
- Source reference github.com/diasurgical/DevilutionX/issues/8758
- Patch github.com/diasurgical/DevilutionX/pull/8482
- Source reference github.com/diasurgical/libmpq/blob/b78d66c6fee6a501cc9b95d8556a129c68841b05/libmpq/mpq.c
- Source reference github.com/diasurgical/DevilutionX/blob/7223eeac9e8274fbf665b4de86fda26d3b22c52f/3rdParty/libmpq/CMakeLists.txt
- Source reference hackmd.io/@haindpwn/devilutionx-libmpq-hash-block-table-oob
- Security advisory www.vulncheck.com/advisories/devilutionx-1.4.0-through-1.5.5-heap-buffer-overflow-via-libmpq-archive-dup