Cyber Resilience

CVE-2026-42027

RCE in Apache Opennlp ≤ 2.5.9

Published
04 May 2026
Modified
15 July 2026
Patch / advisory
CVSS Score v3.1 9.8
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0067 49th percentile
Risk Priority 72 floored blend · peak EPSS

Summary

CVE-2026-42027 is a critical-severity Unsafe Reflection (CWE-470) vulnerability in Apache Opennlp. Its CVSS base score is 9.8 (Critical).

Operationally, exploitation aligns with the MITRE ATT&CK technique Reflective Code Loading (T1620); ranked at the 49th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

This vulnerability is AI-related — categorised as NLP Libraries; in the Supply Chain and Deployment risk domain.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2026-42027 is an arbitrary class instantiation vulnerability in the ExtensionLoader component of Apache OpenNLP, stemming from the ExtensionLoader.instantiateExtension(Class, String) method. This method loads a class by its fully-qualified name using Class.forName() and invokes its no-arg constructor, with the class name sourced from the manifest.properties entry in a model archive. The subsequent isAssignableFrom check for subtypes of BaseToolFactory or ArtifactSerializer occurs after Class.forName() has already executed the target's static initializer. Versions affected include those before 2.5.9 in the 2.x series and before 3.0.0-M3 in the 3.x series.

An attacker can exploit this by supplying a crafted model archive containing a malicious class name in the manifest.properties file. During model loading, Class.forName() triggers the static initializer of any class on the classpath, enabling side effects such as JNDI lookups, outbound network I/O, or filesystem access if an exploitable class is present. This requires unauthenticated network access (AV:N/AC:L/PR:N) but is not a drop-in remote code execution, as it depends on the victim's classpath containing suitable classes; exploitation risk increases with third-party model distribution from untrusted sources like community repositories. A narrower vector allows forcing the no-arg constructor of legitimate BaseToolFactory or ArtifactSerializer subclasses with side-effecting behavior.

Apache advisories recommend upgrading to version 2.5.9 for 2.x users or 3.0.0-M3 for 3.x users, where the fix introduces a package-prefix allowlist checked before Class.forName() to prevent execution of disallowed classes' static initializers; opennlp.* packages are permitted by default, with opt-in for others via ExtensionLoader.registerAllowedPackage(String) or the OPENNLP_EXT_ALLOWED_PACKAGES system property. Users unable to upgrade should source model files only from trusted origins and audit the classpath for classes with side-effecting static initializers or constructors, especially those involving JNDI, network requests, or filesystem operations. The vulnerability carries a CVSS v3.1 score of 9.8 and is linked to CWE-470 (Unsafe Reflection). Additional details are available in the Apache announcement at https://lists.apache.org/thread/ltlo4powjfc0w2w2yyl1o5tc7q1gcb2y and oss-security mailing list at http://www.openwall.com/lists/oss-security/2026/05/01/20.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

AI Security AnalysisAI

AI Category
NLP Libraries
Risk Domain
Supply Chain and Deployment
OWASP Top 10 for LLMs 2025
None mapped
Classification Reason
Matched keywords: hugging face

Related Threats

MITRE ATT&CK Enterprise Techniques

T1620 Reflective Code Loading Stealth
Adversaries may reflectively load code into a process in order to conceal the execution of malicious payloads.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1203 Exploitation for Client Execution Execution
Adversaries may exploit software vulnerabilities in client applications to execute code.
T1210 Exploitation of Remote Services Lateral Movement
Adversaries may exploit remote services to gain unauthorized access to internal systems once inside of a network.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-43825Same product: Apache Opennlp
CVE-2026-40682Same product: Apache Opennlp
CVE-2026-42440Same product: Apache Opennlp
CVE-2021-29200Same vendor: Apache
CVE-2023-37895Same vendor: Apache
CVE-2023-39410Same vendor: Apache
CVE-2026-42779Same vendor: Apache
CVE-2026-61484Same vendor: Apache
CVE-2026-40860Same vendor: Apache
CVE-2025-27819Same vendor: Apache

Affected Assets

apache
opennlp
3.0.0 · ≤ 2.5.9

Mitigating Controls

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation can uncover deserialization flaws before deployment.

Input validation directly stops externally supplied class or method names from selecting improper code via reflection.

Enforces authorization checks on the code or classes ultimately invoked, blocking unauthorized selections even if reflection is used.

Limits privileges of any code reached through unsafe reflection, reducing blast radius without stopping the selection itself.

Engineering principles such as safe deserialization and input sanitization structurally prevent the weakness from being introduced.

Integrity verification tools can detect malformed or tampered serialized data after the fact.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly avoid introducing externally controlled class selection via reflection.

ID.RA-01 partial match
prevents

Vulnerability identification processes can discover unsafe reflection during code review or scanning.

PR.PS-05 partial match
prevents

Preventing execution of unauthorized code can block exploitation of unsafe reflection at runtime.

PR.PS-02 none match
prevents

PR.PS-02 addresses only post-deployment updates/patching and cannot prevent introduction of unsafe deserialization code, yet it can remediate some instances when the flaw exists in outdated libraries or components.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

prevents

Secure coding standards directly forbid unsafe reflection and require whitelisting or static alternatives.

finds

Security testing can detect and block unsafe reflection patterns before release.

prevents

Secure development lifecycle mandates input validation and design reviews that reduce unsafe reflection risks.

prevents

Application security requirements can explicitly prohibit or constrain reflection based on untrusted input.

prevents

Secure architecture principles discourage dynamic class loading from external data sources.

finds

Regular scanning of third-party libraries and timely patching reduce the likelihood that unsafe deserialization vulnerabilities remain active.

References