# CVE-2026-42027: opennlp-tools RCE — Fixed in 2.5.9

☕

☕ Maven

Not in CISA KEV

CRITICAL severity

# CVE-2026-42027 — opennlp-tools

CRITICAL 

CVE-2026-42027 is a critical-severity (CVSS 9.8) CWE-470 vulnerability in org.apache.opennlp:opennlp-tools. A fix is available for org.apache.opennlp:opennlp-tools — see the affected versions and patch details below.

Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader

Also known as[GHSA-cx4m-2p55-rw7j](/vulnerability/GHSA-cx4m-2p55-rw7j)

Published

May 4, 2026

Updated

Oct 28, 2026

Affected

3 pkgs

Patched

3 / 3

Exploits

None indexed

Exploitation data as of Nov 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

## Exploitation Status

### No confirmed exploitation observed yet

-   CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
-   A successful exploit gives an attacker total control of the affected component, not partial access.
-   CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-42027.

## EPSS Exploitation Probability

[via FIRST.org ↗](https://www.first.org/epss/)

0.7%probability of exploitation in next 30 days

Lower Risk\-0.56%

Lower risk than most CVEs54th percentile — riskier than 54% of all scored CVEsHighest risk

0.17%0.70%1.24%1.77%0.7%0.7%1.3%0.7%Aug 26Oct 26Nov 26

Probability of exploitation in the next 30 days, from [FIRST.org EPSS](https://www.first.org/epss/).

## How urgent is this, really

## Where this sits among everything scored

## Real-World Exposure

3 pkgs affected

☕`org.apache.opennlp:opennlp-tools`☕`org.apache.opennlp:opennlp-tools`☕`org.apache.opennlp:opennlp-tools`

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.

## 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 Packages

3 total 3 fixed

Ecosystem

Package

Vulnerable range

Fix

☕Maven

`org.apache.opennlp:opennlp-tools` 

≥ 2.0.0&&< 2.5.9

2.5.9`org.apache.opennlp:opennlp-tools:2.5.9`

☕Maven

`org.apache.opennlp:opennlp-tools` 

≥ 3.0.0-M1&&< 3.0.0-M3

3.0.0-M3`org.apache.opennlp:opennlp-tools:3.0.0-M3`

☕Maven

`org.apache.opennlp:opennlp-tools` 

all versions

1.9.5`org.apache.opennlp:opennlp-tools:1.9.5`

## Affected Products

1 product · 3 configurations

Application

`opennlp`apache

< 2.5.9

1 version

3.0.0

## Detection & mitigation playbook

Open-source dependency

1.  ### Detect
    
    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.apache.opennlp:opennlp-tools, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
    
2.  ### Fix
    
    Update org.apache.opennlp:opennlp-tools to 2.5.9 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-42027 is resolved across your whole dependency graph.
    
3.  ### Workarounds
    
    Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
    

## Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

Product

Fixed in

Advisory

Red Hat OpenShift AI 2.25

`rhoai/odh-trustyai-service-rhel9:1788198681`

[RHSA-2026:65126](https://access.redhat.com/errata/RHSA-2026:65126)

## Frequently Asked Questions

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-

O3 Security · Impact-Aware SCA

### Is CVE-2026-42027 in your dependencies?

Find it across Maven, including transitive dependencies.

[Scan my dependencies](/book-demo) [How O3 SCA works](/impact-aware-sca)