Skip to main content

Apache OpenNLP EUVDEUVD-2026-27005

| CVE-2026-42027 CRITICAL
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') (CWE-470)
2026-05-04 apache GHSA-cx4m-2p55-rw7j
9.8
CVSS 3.1 · Vendor: apache
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious model archive
  2. Delivery
    Embed gadget class name in manifest
  3. Exploit
    Social engineer target to load model
  4. Execution
    Class.forName() executes static initializer
  5. Persist
    Side effect triggers (JNDI/HTTP/filesystem)
  6. Impact
    Achieve code execution or data exfiltration

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V15 - Secure Coding and Architecture Reflection safety, class allowlisting
Exploitation Conditions

Exploitation requires three distinct conditions: (1) the victim application must load an OpenNLP model file supplied by the attacker, either through direct user upload functionality, automated ingestion from public model repositories, or supply-chain compromise where a trusted model source is poisoned; (2) the application's classpath must contain at least one class with exploitable side effects in its static initializer or no-arg constructor-examples include classes performing JNDI lookups (common in logging frameworks pre-log4shell remediation), initiating HTTP requests (telemetry libraries, feature flag clients), writing to filesystem (configuration managers), or executing system commands during initialization; (3) network egress controls must permit outbound connections if the attack relies on JNDI, HTTP callbacks, or DNS exfiltration. The CVSS vector AV:N/AC:L/PR:N/UI:N suggests no special conditions, but this is misleading-the actual attack requires social engineering (convincing targets to load the malicious model) and environmental prerequisites (exploitable gadget classes on classpath). Deployments loading only vendor-supplied or internally developed models from access-controlled repositories face minimal risk. Limiting exploitation: applications with classpath-restricted to core OpenNLP dependencies and no third-party libraries with side-effecting initializers cannot be exploited beyond denial of service; SecurityManager policies blocking network access constrain JNDI/HTTP-based gadgets; organizations that cryptographically sign and verify model files prevent untrusted model injection.

Impact

Real-world risk assessment reveals significant divergence between CVSS 9.8 (Critical) and actual exploitation likelihood. The CVSS vector (AV:N/AC:L/PR:N/UI:N) assumes remote unauthenticated exploitation with low complexity, which is technically accurate for the class-loading mechanism itself but overlooks critical preconditions: attackers must deliver a malicious model file to a victim who then loads it, AND the target classpath must contain exploitable gadget classes with useful static initializer side effects. The EPSS score of 0.29% (52nd percentile) aligns with this nuanced view, reflecting that widespread automated exploitation is improbable. However, three factors elevate strategic risk beyond the EPSS baseline: (1) the growing model-sharing ecosystem (Hugging Face, community repositories) normalizes loading untrusted model files, (2) enterprise Java classpaths commonly include JNDI-capable libraries (log4j remediation notwithstanding), and (3) the vulnerability enables supply-chain attacks where a single poisoned model in a popular repository could affect many downstream users. SSVC decision framework suggests exploitation is possible (demonstrated by vendor patch) but not yet automatable (requires social engineering to convince targets to load malicious models) with moderate technical impact (depends on gadget availability). Priority should be MEDIUM for organizations not loading third-party models, HIGH for ML pipeline environments ingesting community-contributed models. No CISA KEV listing or public POC indicates this remains a theoretical risk requiring specific environmental conditions rather than an active widespread threat.

Exploit ScenarioDerived

An attacker publishes a sentiment-analysis model to a community repository with a manifest.properties entry factory=org.example.LogConfigLoader, where LogConfigLoader exists on typical enterprise classpaths and performs a JNDI lookup in its static initializer (similar to log4j patterns). A data science team downloads the model for evaluation in their OpenNLP-based text processing pipeline. When their application invokes model loading, Class.forName() executes LogConfigLoader's static initializer, triggering an outbound JNDI request to an attacker-controlled LDAP server that returns a malicious serialized object, achieving remote code execution in the application context. Alternatively, the attacker names a class whose static initializer exfiltrates environment variables or AWS credentials via HTTP POST, enabling credential theft without full RCE.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 05, 2026

Apache OpenNLP's model loading mechanism executes arbitrary static initializers through crafted manifest entries, enabling attackers to trigger side effects in any classpath class before type validation occurs. Affects OpenNLP versions before 2.5.9 and 3.0.0-M3. While not direct RCE, exploitation becomes viable when third-party models from untrusted sources (community repositories, model-sharing platforms) are loaded in environments containing classes with JNDI lookups, network I/O, or filesystem operations in static initializers. EPSS score of 0.29% suggests low widespread exploitation probability despite CVSS 9.8, though attack surface grows with model-sharing ecosystem adoption. No public exploit identified at time of analysis; vendor-released patches available.

RemediationAI

Upgrade to Apache OpenNLP 2.5.9 for 2.x deployments or 3.0.0-M3 for 3.x deployments, both available from the Apache OpenNLP project page and Maven Central. The patched versions implement a package-prefix allowlist that is enforced before Class.forName() execution, preventing static initializer invocation for disallowed classes. By default, only the opennlp.* package namespace remains permitted. Organizations using custom BaseToolFactory or ArtifactSerializer implementations outside the opennlp package must explicitly allowlist those packages via ExtensionLoader.registerAllowedPackage(String) API calls before model loading, or by setting the OPENNLP_EXT_ALLOWED_PACKAGES system property to a comma-separated list of approved package prefixes. For deployments unable to upgrade immediately, implement strict model provenance controls: (1) accept models only from cryptographically signed sources with verified publisher identities, (2) audit the application classpath for classes with side-effecting static initializers, particularly those performing JNDI lookups (javax.naming.InitialContext in static blocks), network operations (java.net.URL, HTTP clients), or filesystem writes, (3) consider running model loading in a sandboxed JVM with SecurityManager policies restricting network and filesystem access, though note that SecurityManager is deprecated in Java 17+ and this mitigation adds operational complexity. The workaround approach trades convenience for security-strict provenance validation may break workflows dependent on community model repositories.

Affected VersionsENISA

Apache OpenNLP 0 <2.5.9
Apache OpenNLP 3.0 <3.0.0-M3

Affected Packages

maven org.apache.opennlp:opennlp-tools fix: 1.9.5, 2.5.9, 3.0.0-M3
euvd apache_opennlp fix: 2.5.9, 3.0.0-M3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in maven, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Apache OpenNLP is a natural language processing library that loads trained models from archive files containing manifest.properties. The ExtensionLoader.instantiateExtension() method reads fully-qualified class names from model manifests (factory= and serializer-class-* entries) and invokes Class.forName() with default initialization semantics to load BaseToolFactory or ArtifactSerializer implementations. Java's Class.forName() executes the target class's static initializer block before returning the Class object. The vulnerability (CWE-470: Use of Externally-Controlled Input to Select Classes or Code) arises because type validation via isAssignableFrom() occurs after class initialization has already executed, allowing attackers to trigger static initializers of arbitrary classpath classes by naming them in a malicious model manifest. The attack leverages Java's class loading order: static initializers run during the linking phase, before any explicit constructor invocation or type checking. Classes with side-effecting static initializers become exploitation gadgets similar to Java deserialization chains, though the attack surface here depends on classpath composition rather than serialization libraries.

Know when Apache Opennlp gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (apache) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
SUSE CRITICAL
Red Hat 7.5 HIGH

Primary rating from Vendor (apache).

CVSS VectorVendor: apache

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
CVSS changed
May 05, 2026 - 16:22 NVD
9.8 (CRITICAL)
Patch available
May 04, 2026 - 18:32 EUVD
Patch released
May 04, 2026 - 18:16 nvd
Patch available
CVE Published
May 04, 2026 - 16:43 nvd
N/A

DescriptionCVE.org

Arbitrary Class Instantiation via Model Manifest in Apache OpenNLP ExtensionLoader

Versions Affected: 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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 27 maven packages depend on org.apache.opennlp:opennlp-tools (10 direct, 17 indirect)

Ecosystem-wide dependent count for version 2.0.0.

Executive ViewAI

Why It Matters

Apache OpenNLP versions before 2.5.9 and 3.0.0-M3 contain a critical vulnerability in model loading that allows execution of arbitrary static initializers through crafted manifest entries, creating a supply-chain risk for organizations using third-party models from community repositories or model-sharing platforms. While no active exploitation has been confirmed, the vulnerability poses significant risk to production environments where OpenNLP processes untrusted model files, potentially enabling attackers to execute malicious code during model loading.

Business Impact: High
Compensating Controls

Vendor-released patch: Apache OpenNLP 2.5.9 or 3.0.0-M3. Until patched: (1) restrict model loading to internally-built or cryptographically-signed models only; (2) implement air-gap or network segmentation for systems processing external models; (3) disable static initializer execution where possible through Java security policies; (4) monitor classpath for untrusted model resources before OpenNLP initialization.

Threat Intelligence Overview

EPSS Score
0.3%
Top 48% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Vendor StatusVendor

SUSE

Severity: Critical

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy