Skip to main content
Vulnerability Database/CVE-2026-103658

CVE-2026-103658: GNU Aspell Buffer Overflow Vulnerability

CVE-2026-103658 is a heap-based buffer overflow in GNU Aspell 0.60.8.2 that allows attackers to corrupt heap memory via malicious dictionaries. This post explains its technical details, affected versions, impact, and mitigation steps.

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-2026-103658 Overview

CVE-2026-103658 is a heap-based buffer overflow write ([CWE-122]) in GNU Aspell 0.60.8.2 affecting the read-only dictionary loader. The flaw resides in String::reserve() within common/string.hpp, where a signed integer cast causes a capacity check to wrap negative when the requested size reaches 0x7FFFFFFF. The backing heap buffer is never grown, allowing attacker-controlled data from a crafted .rws dictionary file to be written past the allocation. An attacker who convinces a victim to load a malicious dictionary, for example through aspell dump master <file>, can corrupt heap memory. The outcome ranges from denial of service to potential code execution.

Critical Impact

A crafted .rws dictionary file triggers an out-of-bounds heap write in Aspell, enabling memory corruption and potential arbitrary code execution in the context of the invoking user.

Affected Products

  • GNU Aspell 0.60.8.2
  • Earlier GNU Aspell versions (first vulnerable version not identified)
  • Applications and distributions bundling vulnerable Aspell releases

Discovery Timeline

  • 2026-10-12 - CVE-2026-103658 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-103658

Vulnerability Analysis

The vulnerability arises in Aspell's string allocation helper, String::reserve(), in common/string.hpp. The function computes its growth check using a signed int expression of the form (int)s + 1. When a caller requests a reservation of 0x7FFFFFFF bytes, the addition overflows into a negative value. The negative comparison result causes the function to skip reallocation, leaving the backing buffer at its original undersized capacity.

ReadOnlyDict::load() in modules/speller/default/readonly_ws.cpp consumes 32-bit size fields directly from a .rws dictionary header without validation. These fields, including lang_name_size, flow into the vulnerable reservation path. Subsequent copy operations write attacker-controlled dictionary bytes past the heap allocation boundary.

Exploitation requires a victim to load the malicious dictionary locally. Invocation through aspell dump master <file> or any workflow that opens an attacker-supplied .rws file triggers the condition. Heap corruption of this type can be shaped into control-flow hijacking depending on allocator state and surrounding objects.

Root Cause

The root cause is an integer sign error in String::reserve(). Casting an unsigned size to a signed int before the capacity comparison allows large values to wrap negative, bypassing the growth check. Compounding this, ReadOnlyDict::load() trusts the dictionary header's size fields without bounds validation.

Attack Vector

An attacker crafts a .rws file containing a valid endian marker (12345678) and an oversized length field such as lang_name_size = 0x7FFFFFFF. The attacker delivers the file to a target system and induces loading through Aspell command-line tools or any application that uses libaspell for dictionary processing. Attack complexity is low, no privileges are required, and no user interaction beyond opening the dictionary is needed. The attack vector is local.

See the GitHub Security Advisory GHSA-p35p-2mw5-fj5j for the full technical write-up.

Detection Methods for CVE-2026-103658

Indicators of Compromise

  • .rws dictionary files from untrusted sources, especially those with header size fields approaching 0x7FFFFFFF
  • Unexpected aspell process crashes or SIGSEGV events during dictionary loading
  • Shell history or process telemetry showing aspell dump master invoked against user-writable paths

Detection Strategies

  • Scan filesystems for .rws files outside standard Aspell dictionary directories and inspect their header size fields
  • Monitor process execution logs for aspell subcommands operating on files in /tmp, user downloads, or email attachment paths
  • Correlate libaspell-linked application crashes with recent dictionary file changes

Monitoring Recommendations

  • Enable core dump collection for Aspell and dependent applications to capture evidence of heap corruption
  • Audit package inventories to track installed Aspell versions across Linux and macOS endpoints
  • Alert on invocations of spell-check tooling by non-interactive accounts or service processes

How to Mitigate CVE-2026-103658

Immediate Actions Required

  • Upgrade GNU Aspell to version 0.60.8.3 or later once released, which incorporates commit b830b6e
  • Apply distribution-provided backports of the fix as they become available
  • Restrict Aspell to loading dictionaries only from trusted, system-managed paths

Patch Information

The upstream fix is committed as b830b6e in the GNU Aspell repository and will ship in release 0.60.8.3. The patch corrects the signed integer handling in String::reserve() and adds validation of size fields parsed by ReadOnlyDict::load(). Reference the GitHub Security Advisory for commit details and distribution tracking.

Workarounds

  • Do not open .rws dictionary files received from untrusted senders or downloaded from unverified sources
  • Remove or restrict execute permissions on aspell binaries for accounts that do not require spell-checking functionality
  • Isolate workflows that process user-supplied dictionaries inside sandboxed environments or containers
bash
# Verify installed Aspell version and locate dictionary paths
aspell --version
aspell dump config | grep -E 'dict-dir|data-dir'

# Restrict dictionary loading to the system directory only
chmod 755 /usr/lib/aspell
find /home -name '*.rws' -type f -ls

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.