CVE-2026-63317: CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') in Apache Software Foundation Apache OpenNLP
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.
AI Analysis
Technical Summary
Apache OpenNLP versions prior to 2.5.10 and 3.0.0-M5 contain unsafe reflection vulnerabilities (CWE-470) in three code paths that instantiate classes by fully-qualified names supplied via untrusted inputs without validation. These paths include the GeneratorFactory parsing XML feature generator descriptors embedded in model archives, StreamFactoryRegistry interpreting unregistered format names as class names, and StringInterners instantiating classes named by a system property. An attacker controlling model archives or format names can cause arbitrary class instantiation if malicious classes with side-effecting constructors or static initializers exist on the classpath. The fix introduced a package-prefix allowlist checked before class loading to prevent unauthorized classes from being instantiated.
Potential Impact
The vulnerability allows an attacker who can supply crafted model archives or untrusted format names to cause the application to instantiate arbitrary classes. This could lead to side effects such as JNDI lookups, outbound network connections, or filesystem access if malicious classes are present on the classpath. However, this is not direct remote code execution since exploitation depends on the presence of attacker-controlled classes. Confidentiality, integrity, and availability impacts are rated low to medium based on the CVSS score of 5.6.
Mitigation Recommendations
A fixed release is available starting from Apache OpenNLP version 2.5.10 and 3.0.0-M5 that enforces a package-prefix allowlist before class instantiation. Users should upgrade to these or later versions to fully mitigate the vulnerability. Until upgrading, users must ensure all model files and format names come from trusted sources and audit their classpath for classes with side-effecting static initializers or constructors. Deployments loading classes outside the opennlp.* package must explicitly allow those packages via ExtensionLoader.registerAllowedPackage or the OPENNLP_EXT_ALLOWED_PACKAGES system property.
CVE-2026-63317: CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') in Apache Software Foundation 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
Affected software
pkg:maven/Apache Software Foundation/org.apache.opennlp:opennlp-toolsRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Apache OpenNLP versions prior to 2.5.10 and 3.0.0-M5 contain unsafe reflection vulnerabilities (CWE-470) in three code paths that instantiate classes by fully-qualified names supplied via untrusted inputs without validation. These paths include the GeneratorFactory parsing XML feature generator descriptors embedded in model archives, StreamFactoryRegistry interpreting unregistered format names as class names, and StringInterners instantiating classes named by a system property. An attacker controlling model archives or format names can cause arbitrary class instantiation if malicious classes with side-effecting constructors or static initializers exist on the classpath. The fix introduced a package-prefix allowlist checked before class loading to prevent unauthorized classes from being instantiated.
Potential Impact
The vulnerability allows an attacker who can supply crafted model archives or untrusted format names to cause the application to instantiate arbitrary classes. This could lead to side effects such as JNDI lookups, outbound network connections, or filesystem access if malicious classes are present on the classpath. However, this is not direct remote code execution since exploitation depends on the presence of attacker-controlled classes. Confidentiality, integrity, and availability impacts are rated low to medium based on the CVSS score of 5.6.
Mitigation Recommendations
A fixed release is available starting from Apache OpenNLP version 2.5.10 and 3.0.0-M5 that enforces a package-prefix allowlist before class instantiation. Users should upgrade to these or later versions to fully mitigate the vulnerability. Until upgrading, users must ensure all model files and format names come from trusted sources and audit their classpath for classes with side-effecting static initializers or constructors. Deployments loading classes outside the opennlp.* package must explicitly allow those packages via ExtensionLoader.registerAllowedPackage or the OPENNLP_EXT_ALLOWED_PACKAGES system property.
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/31/2026, 15:12:44 UTC
Last updated: 09/07/2026, 10:52:10 UTC
Views: 115
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.