REDHAT-BUG-2550001: Buffer Overflow
GNU Aspell through 0.60.8.2 contains a heap-based buffer overflow write (CWE-122) in its read-only dictionary loader. String::reserve() in common/string.hpp computes its capacity check with a signed int ((int)s + 1), so a requested size of 0x7FFFFFFF wraps negative and the backing buffer is never grown. ReadOnlyDict::load() in modules/speller/default/readonlyws.cpp passes the unvalidated 32-bit size fields from a .rws dictionary header into this path, so a crafted .rws file with a valid endian marker (12345678) and an oversized length field (e.g. langnamesize = 0x7FFFFFFF) causes attacker-controlled data to be written out of bounds past an undersized heap allocation. An attacker who induces a victim to load a malicious dictionary — for example via aspell dump master <file> — can corrupt heap memory, resulting in denial of service and potentially code execution. Fixed in 0.60.8.3.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
GNU Aspellto a version that resolves this vulnerability.Fixed in 0.60.8.3
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Systems are exposed when GNU Aspell loads an attacker-controlled or otherwise untrusted .rws dictionary file. This can occur through workflows that pass such a file to commands such as "aspell dump master <file>".
What must an attacker provide to trigger the overflow?
The attacker needs a crafted .rws dictionary with a valid endian marker of 12345678 and an oversized unvalidated 32-bit header length field, such as lang_name_size set to 0x7FFFFFFF. Loading that dictionary reaches the vulnerable allocation and write path.
Are normal default dictionary configurations affected?
The issue is triggered by loading a malicious .rws dictionary; the provided information does not indicate that bundled or ordinary trusted dictionaries trigger it. Risk is therefore primarily tied to acceptance or processing of untrusted dictionary files.
What can be done before upgrading?
Do not load .rws dictionaries from untrusted sources, and restrict who can supply dictionary files to Aspell-processing workflows. The issue is fixed in GNU Aspell 0.60.8.3.