# CVE-2026-42027: Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.27% (percentile 70, 2026-11-28)
- **CWE:** CWE-470
- **Aliases:** GHSA-cx4m-2p55-rw7j
- **Published:** 2026-05-04T16:43:12.583Z
- **Modified:** 2026-10-26T19:10:00.163Z

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

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

- Maven `org.apache.opennlp:opennlp-tools`: affected \>= 2.0.0, \< 2.5.9; fixed 2.5.9, 3.0.0-M3, 1.9.5 (osv)
- Apache Software Foundation Apache OpenNLP: \>= 2.0, \< 2.5.9; \>= 3.0.0-M1, \< 3.0.0-M3; \< 1.9.5 (cvelist)

## 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).

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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-28).

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

## References

- vendor: <https://lists.apache.org/thread/ltlo4powjfc0w2w2yyl1o5tc7q1gcb2y>
- vendor: <https://access.redhat.com/errata/RHSA-2026:65126>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-42027>
- other: <http://www.openwall.com/lists/oss-security/2026/05/01/20>
- other: <https://access.redhat.com/security/cve/CVE-2026-42027>
- other: <https://bugzilla.redhat.com/show_bug.cgi?id=2466527>
- other: <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42027.json>
- other: <https://github.com/apache/opennlp>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-42027>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-cx4m-2p55-rw7j> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-42027> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-42027>
