IT Security 2 months ago

CVE‑2026‑67211 – Apache OpenNLP SymSpell Out‑of‑Memory DoS

A crafted SymSpell model file can trigger an OutOfMemoryError in Apache OpenNLP 3.0.0‑M4/M5, causing denial‑of‑service. Upgrade to 3.0.0‑M6 or validate inputs before deserialization. A crafted SymSpell model file can trigger an OutOfMemoryError in Apache OpenNLP 3.0.0‑M4/M5, causing denial‑of‑service. Upgrade to 3.0.0‑M6 or validate inputs before deserialization.

IT Security

Executive summary

A newly disclosed CVE‑2026‑67211 allows an attacker to cause an OutOfMemoryError in Apache OpenNLP versions 3.0.0‑M4 and 3.0.0‑M5. The flaw resides in the SymSpellModelSerializer, where attacker‑controlled size fields are used to pre‑size a LinkedHashMap without an upper bound, leading to heap exhaustion and a denial‑of‑service condition.

What is affected

  • Apache OpenNLP 3.0.0‑M4 and 3.0.0‑M5 (the opennlp‑spellcheck extension introduced in 3.0.0‑M4).
  • The SymSpellModelSerializer class and any code path that deserializes a SymSpell model, such as:
  • SymSpellModels.deserialize(InputStream)
  • SymSpellModels.fromBytes(byte[])
  • SymSpellModelResolver.resolveByLanguage(String)
  • The CorrectTextTool command‑line utility
  • Model‑archive loading via the registered ArtifactSerializer

Severity and evidence

The vulnerability results in an OutOfMemoryError when a maliciously crafted .bin model file sets either unigramCount or bigramCount to a very large value (e.g., Integer.MAX_VALUE). The map is pre‑sized for 2^30 entries, allocating 4–8 GB on the first insertion and crashing the JVM. The attack requires a file well under 100 bytes, making exploitation trivial when model files are sourced from untrusted or semi‑trusted locations.

Business or operational impact

Affected applications that load SymSpell models will terminate abruptly, causing service interruption, loss of availability, and potential downstream cascade failures. The impact is limited to denial‑of‑service; no code execution or data disclosure is reported.

Detection considerations

  • Monitor application logs for OutOfMemoryError or java.lang.OutOfMemoryError: Java heap space occurring during model loading.
  • Alert on crashes of processes that invoke CorrectTextTool or any OpenNLP component that reads SymSpell .bin files.
  • Track inbound .bin model files from external sources; unexpected size fields may indicate exploitation attempts.

Recommended defensive actions

  1. Upgrade to Apache OpenNLP 3.0.0‑M6 or later, which adds upper‑bound validation on the count fields and throws an IOException instead of allocating massive memory.
  2. Validate the provenance of SymSpell model files before deserialization. Use checksums or digital signatures where possible.
  3. Configure the OPENNLP_MAX_ENTRIES system property to enforce a sensible limit (default is 10,000,000). Example: -DOPENNLP_MAX_ENTRIES=5000000.
  4. Apply runtime hardening: set JVM heap limits and enable OOM‑killer alerts to contain the impact.

Workarounds or mitigations, if supported

  • If upgrading is not immediately possible, treat all SymSpell .bin files as untrusted input. Reject or sandbox model loading from external users or third‑party repositories.
  • Reduce the default OPENNLP_MAX_ENTRIES by setting a lower value via the system property to further limit potential allocations.

Patch or remediation status

The fix is available in Apache OpenNLP 3.0.0‑M6. No additional patches are mentioned in the source. Users of earlier 3.x releases should plan to upgrade promptly.

References

  • NVD entry: https://nvd.nist.gov/vuln/detail/CVE-2026-67211
  • Apache OpenNLP release notes for 3.0.0‑M6 (contains the upper‑bound fix)

Publication date and last checked date

  • Publication date: 2026‑09‑16
  • Last checked: 2026‑09‑17

← Back to IT Security