Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.2%top 90%

CVE-2026-63317: CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') in Apache Software Foundation Apache OpenNLP

0
Medium
VulnerabilityCVE-2026-63317cvecve-2026-63317cwe-470
Published: 07/24/2026 (07/24/2026, 08:07:57 UTC)
Source: CVE Database V5
Vendor/Project: Apache Software Foundation
Product: Apache OpenNLP

Description

Arbitrary Class Instantiation via XML Feature Generator Descriptor and Format Name in Apache OpenNLP Versions Affected: - before 2.5.10 - before 3.0.0-M5 Description: Three code paths in Apache OpenNLP load a class by its fully-qualified name via Class.forName() and invoke its no-arg constructor without any prior validation of the class name or its type.  The affected paths are: (1) GeneratorFactory, which reads the class attribute of generator elements in an XML feature generator descriptor; such descriptors are embedded as artifacts in model archives (e.g. TokenNameFinder and POSTagger models) and are parsed during model loading, so an attacker who can supply a crafted model archive controls the class name directly. (2) StreamFactoryRegistry.getFactory(Class, String), which falls back to interpreting an unregistered format name as the fully-qualified class name of an ObjectStreamFactory; this is exploitable in applications that pass untrusted format names (e.g. exposing the -format parameter of the command-line tooling to external input). (3) StringInterners, which instantiates the interner implementation named by the opennlp.interner.class system property; this value is normally deployer-controlled, so it is hardened as defense in depth rather than being independently attacker-reachable. Exploitation requires a class with attacker-useful side effects in its static initializer or no-arg constructor (JNDI lookup, outbound network I/O, filesystem access) to be present on the classpath, so this is not drop-in remote code execution. T Mitigation: Upgrade to a fixed release. The fix routes all three paths through ExtensionLoader.instantiateExtension(...), which consults a package-prefix allowlist before Class.forName() is invoked, so a disallowed class is never loaded, initialized, or constructed. Classes under the opennlp. prefix remain permitted by default. Deployments that load models referencing feature generator factories, object stream factories, or string interners 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 all model files and format names are sourced from trusted origins and should audit their classpath for classes with side-effecting static initializers or constructors.

CVSS v3.1

Score 5.6medium

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

Affected software

Apache Software Foundation/org.apache.opennlp:opennlp-tools
pkg:maven/Apache Software Foundation/org.apache.opennlp:opennlp-tools
Affected versions
<2.5.11

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/24/2026, 08:37:11 UTC

Technical Analysis

Apache OpenNLP versions before 2.5.10 and 3.0.0-M5 contain an unsafe reflection vulnerability (CWE-470) where three code paths instantiate classes by fully-qualified names without validation: (1) GeneratorFactory loading classes from XML feature generator descriptors embedded in model archives, (2) StreamFactoryRegistry interpreting unregistered format names as class names, and (3) StringInterners instantiating classes named by a system property. Exploitation requires attacker-controlled classes with side-effecting static initializers or constructors on the classpath, so this is not direct remote code execution. The vulnerability is mitigated in fixed releases by routing class loading through an ExtensionLoader that enforces a package-prefix allowlist, permitting only classes under the opennlp.* namespace by default. Deployments using external packages must explicitly allow those packages.

Potential Impact

An attacker who can supply crafted model archives or untrusted format names can cause the application to instantiate arbitrary classes on the classpath without validation. This could lead to execution of code with side effects such as network calls or filesystem access if such classes exist. However, exploitation requires the presence of attacker-useful classes on the classpath and is not direct remote code execution. The vulnerability could be leveraged in environments where untrusted inputs control model archives or format names.

Mitigation Recommendations

Upgrade to Apache OpenNLP version 2.5.10 or later, or 3.0.0-M5 or later, where the vulnerability is fixed by enforcing a package-prefix allowlist for class loading. If immediate upgrade is not possible, ensure that all model files and format names are sourced from trusted origins and audit the classpath for classes with side-effecting static initializers or constructors. For deployments using classes outside the opennlp.* namespace, explicitly register allowed packages via ExtensionLoader.registerAllowedPackage(String) or the OPENNLP_EXT_ALLOWED_PACKAGES system property.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
apache
Date Reserved
2026-07-16T13:23:13.170Z
Cvss Version
null
State
PUBLISHED
Remediation Level
null

Threat ID: 6a6320db9c2644c7f8989bae

Added to database: 07/24/2026, 08:22:51 UTC

Last enriched: 07/24/2026, 08:37:11 UTC

Last updated: 07/24/2026, 21:21:47 UTC

Views: 31

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses