Executive brief
PocketSphinx, a speech recognition library, is vulnerable to memory corruption when loading specially crafted language or acoustic model files. If an attacker can place a malicious file in the directory where the software looks for these models, they could potentially crash the application or gain unauthorized control. This risk is particularly high if the application is configured to load files from a directory that untrusted users can write to.
Technical details
PocketSphinx contains multiple memory safety vulnerabilities in its model loading code. The trie language model code fails to validate boundary conditions when reading headers from ARPA, DMP, and binary format files, leading to stack and heap buffer overflows. Additionally, the acoustic model loading code utilizes 'sscanf' with unbounded string fields, which can be exploited to cause stack overflows. An attacker can trigger these vulnerabilities by providing malicious model files. The attack vector is considered network-reachable in the CVSS metrics, though the advisory notes that local file system access to the POCKETSPHINX_PATH directory is a primary exploitation method. The issues are resolved in version 5.1.1.
Affected products
- cmusphinx pocketsphinx < 5.1.1
Timeline
- 2026-06-06: disclosed: Initial disclosure by reporter
- 2026-07-17: advisory: GitHub Advisory published
- 2026-07-17: patched: Version 5.1.1 released