Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2026-42027

CRITICAL 9.8EPSS 70%

Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader

Also known as GHSA-cx4m-2p55-rw7j

Mitigation

  • Upgrade org.apache.opennlp:opennlp-tools to one of 2.5.9, 3.0.0-M3, 1.9.5 (or later in the same release line).

Who should check

  • Projects that depend on Maven package org.apache.opennlp:opennlp-tools (>= 2.0.0, < 2.5.9)
  • Anyone running Apache Software Foundation Apache OpenNLP >= 2.0, < 2.5.9; >= 3.0.0-M1, < 3.0.0-M3; < 1.9.5

Vulnerability facts

Affected
org.apache.opennlp:opennlp-tools >= 2.0.0, < 2.5.9
Fixed in
2.5.9, 3.0.0-M3, 1.9.5
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.8 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
1.27% chance of exploitation in 30 days (percentile 70, 2026-11-26)
CWE
CWE-470
Published
Modified

Description

Arbitrary Class Instantiation via Model Manifest in Apache OpenNLP ExtensionLoader Versions Affected: before 1.9.5, before 2.5.9, before 3.0.0-M3 Description:  The ExtensionLoader.instantiateExtension(Class, String) method loads a class by its fully-qualified name via Class.forName() and invokes its no-arg constructor, with the class name sourced from the manifest.properties entry of a model archive. The existing isAssignableFrom check correctly rejects classes that are not subtypes of the expected extension interface (BaseToolFactory for factory=, ArtifactSerializer for serializer-class-*), but the check runs after Class.forName() has already loaded and initialized the named class. Class.forName() with default initialization semantics executes the target class's static initializer before returning, so an attacker who can supply a crafted model archive can cause the static initializer of any class on the classpath to run during model loading, regardless of whether that class passes the subsequent type check. Exploitation requires a class with attacker-useful side effects in its static initializer (for example, JNDI lookup, outbound network I/O, or filesystem access) to be present on the classpath, so this is not a drop-in remote code execution; however, the attack surface grows as third-party model distribution becomes more common (community model repositories, Hugging Face-style sharing), where users routinely load model files from origins they do not control. A secondary, narrower vector affects deployments that ship legitimate BaseToolFactory or ArtifactSerializer subclasses with side-effecting no-arg constructors: a malicious manifest can name such a class and force its constructor to run during model load. Mitigation:  * 2.x users should upgrade to 2.5.9. * 3.x users should upgrade to 3.0.0-M3. Note: The fix introduces a package-prefix allowlist that is consulted before Class.forName() is invoked, so the static initializer of a disallowed class is never executed. Classes under the opennlp. prefix remain permitted by default. Deployments that load models referencing factories or serializers outside opennlp.* must opt those packages in, either programmatically via ExtensionLoader.registerAllowedPackage(String) before the first model load, or by setting the OPENNLP_EXT_ALLOWED_PACKAGES system property to a comma-separated list of allowed package prefixes. Users who cannot upgrade immediately should ensure that all model files are sourced from trusted origins and should audit their classpath for classes with side-effecting static initializers or constructors, particularly any that perform JNDI lookups, network requests, or filesystem operations during class initialization.

Affected and fixed versions

Package / productAffectedFixedSource
Maven org.apache.opennlp:opennlp-tools>= 2.0.0, < 2.5.92.5.9, 3.0.0-M3, 1.9.5osv
Apache Software Foundation Apache OpenNLP>= 2.0, < 2.5.9; >= 3.0.0-M1, < 3.0.0-M3; < 1.9.5—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-42027. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-42027.md
Affected: org.apache.opennlp:opennlp-tools >= 2.0.0, < 2.5.9
Fixed in: 2.5.9, 3.0.0-M3, 1.9.5

Steps:
1. Search this machine and project for org.apache.opennlp:opennlp-tools (Maven), Apache Software Foundation Apache OpenNLP: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2026-42027 being exploited?

There is no confirmed exploitation: CVE-2026-42027 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.27% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-42027?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2026-42027?

org.apache.opennlp:opennlp-tools >= 2.0.0, < 2.5.9.

Is there a fix for CVE-2026-42027?

Yes. Fixed in 2.5.9, 3.0.0-M3, 1.9.5. Upgrade org.apache.opennlp:opennlp-tools to one of 2.5.9, 3.0.0-M3, 1.9.5 (or later in the same release line).

How do I check if I'm affected by CVE-2026-42027?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors