Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 fixed, 2 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-502.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Apache | Apache OpenNLP | 2.0 to before 2.5.9; 3.0.0-M1 to before 3.0.0-M3; before 1.9.5 | 2.5.9, 3.0.0-M3, 1.9.5 | Patch available | CNA |
| — | org.apache.opennlp:opennlp-tools (Maven) | 2.0.0 to before 2.5.9 | 2.5.9 | Patch available | GHSA-cx4m-2p55-rw7j |
| — | org.apache.opennlp:opennlp-tools (Maven) | 3.0.0-M1 to before 3.0.0-M3 | 3.0.0-M3 | Patch available | GHSA-cx4m-2p55-rw7j |
| — | org.apache.opennlp:opennlp-tools (Maven) | before 1.9.5 | 1.9.5 | Patch available | GHSA-cx4m-2p55-rw7j |
- Apache OpenNLP VendorApache Affected 2.0 to before 2.5.9; 3.0.0-M1 to before 3.0.0-M3; before 1.9.5 Fixed in 2.5.9, 3.0.0-M3, 1.9.5 Patch available CNA
- org.apache.opennlp:opennlp-tools (Maven) Vendor— Affected 2.0.0 to before 2.5.9 Fixed in 2.5.9 Patch available GHSA-cx4m-2p55-rw7j
- org.apache.opennlp:opennlp-tools (Maven) Vendor— Affected 3.0.0-M1 to before 3.0.0-M3 Fixed in 3.0.0-M3 Patch available GHSA-cx4m-2p55-rw7j
- org.apache.opennlp:opennlp-tools (Maven) Vendor— Affected before 1.9.5 Fixed in 1.9.5 Patch available GHSA-cx4m-2p55-rw7j
Remediation
- Fix · CNA Apache OpenNLP (Apache Software Foundation) Fixed in 2.5.9, 3.0.0-M3, 1.9.5
- Fix · GHSA-cx4m-2p55-rw7j org.apache.opennlp:opennlp-tools (Maven) Fixed in 2.5.9 Advisory →
- Fix · GHSA-cx4m-2p55-rw7j org.apache.opennlp:opennlp-tools (Maven) Fixed in 3.0.0-M3 Advisory →
- Fix · GHSA-cx4m-2p55-rw7j org.apache.opennlp:opennlp-tools (Maven) Fixed in 1.9.5 Advisory →
Red Hat 1 advisory
- RHSA-2026:65126 Released 2026-09-08 · Red Hat rating ImportantRHOAI 2.25.11 - Red Hat OpenShift AI
- Red Hat OpenShift AI 2.25 registry.redhat.io/rhoai/odh-built-in-detector-rhel9, registry.redhat.io/rhoai/odh-caikit-tgis-serving-rhel9, registry.redhat.io/rhoai/odh-dashboard-rhel9 +47
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
Apache OpenNLP 1.9.5, 2.5.9, 3.0.0-M3
3 records Highest priority Priority MEDIUM 3 MEDIUM
Other records, highest priority first
- TI-2026-29367 Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistorPriority MEDIUM 48
- TI-2026-30730 Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReaderPriority MEDIUM 40
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Fuse 7 | Affected | No fix planned: Will not fix |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix planned: Will not fix |
| Red Hat OpenShift AI 2.25 | Fixed | RHSA-2026:65126 |
Not affected: 6 products
- Red Hat Data Grid 8
- Red Hat JBoss Enterprise Application Platform 8
- Red Hat JBoss Enterprise Application Platform Expansion Pack
- Red Hat OpenShift AI (RHOAI)
- Red Hat OpenShift AI 2.25
- Red Hat build of Apache Camel for Spring Boot 4
Timeline
- 2026-10-02 Threatist record created from CVE-2026-42027
- 2026-10-03 Alias added: GHSA-cx4m-2p55-rw7j
- 2026-10-13 Affected versions changed · Red Hat
References
Advisory 3
More Apache Opennlp vulnerabilities
- TI-2026-31914 Apache OpenNLP :: Core :: ML :: LibSVM: Unsafe Java Deserialization in SvmDoccatModel CVSS 3.1HIGH 7.3
- TI-2026-56958 Apache OpenNLP, Apache OpenNLP: ReDoS / stack exhaustion in RegexNameFinderFactory built-in EMAIL and URL patterns CVSS 4.0CRITICAL 10.0
- TI-2026-29367 Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor CVSS 3.1CRITICAL 9.1
- TI-2017-09345 XML external entity injection in Apache OpenNLP CVSS 3.0CRITICAL 9.8
- TI-2026-47528 Apache OpenNLP: OOM DoS via Unbounded Array Allocation in SymSpellModelSerializer CVSS 3.1HIGH 7.5
- TI-2026-30730 Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReader CVSS 3.1HIGH 7.5
Sources
- CVE-2026-42027 · CVE Program
- CVE-2026-42027 · NVD
- FIRST EPSS
- GHSA-cx4m-2p55-rw7j · GitHub Advisory Database · CC BY 4.0
- CVE-2026-42027 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences