# CVE-2026-63317: Apache OpenNLP: Arbitrary Class Instantiation in GeneratorFactory via Feature Descriptor XML

> Attackers can trigger arbitrary class instantiation via crafted model archives or format names, potentially leading to code execution if vulnerable classes are on the classpath.

- **Severity:** Medium 5.6 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Jul 2026
- **Updated:** 24 Jul 2026
- **Also known as:** DEBIAN-CVE-2026-63317, GHSA-ccq5-x868-5p6x, RHLW-2026-2aebdb8547d9b041, UBUNTU-CVE-2026-63317, openSUSE-SU-2026:11369-1

## What is CVE-2026-63317?

CVE-2026-63317 is a medium-severity unsafe deserialization vulnerability in Apache OpenNLP, published on 24 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-470 (Use of Externally-Controlled Input to Select Classes or Code)

## Which versions are affected by CVE-2026-63317?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `opennlp` | openSUSE:Tumbleweed | All versions | 1.9.5-2.1 |

Products: Apache Opennlp.

## How do I fix CVE-2026-63317?

Upgrade to a fixed version.

## Is CVE-2026-63317 being exploited?

There is no known exploitation of CVE-2026-63317 in the wild and no public exploit code.

## Other vulnerabilities in Apache OpenNLP

- [CVE-2026-82617](https://insights.sbomify.com/CVE-2026-82617/): Apache OpenNLP, Apache OpenNLP: ReDoS / stack exhaustion in RegexNameFinderFactory built-in EMAIL and URL patterns (critical 10.0)
- [CVE-2026-42027](https://insights.sbomify.com/CVE-2026-42027/): Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader (critical 9.8)
- [CVE-2017-12620](https://insights.sbomify.com/CVE-2017-12620/): Improper Restriction of XML External Entity Reference in Apache OpenNLP (critical 9.8)
- [CVE-2026-40682](https://insights.sbomify.com/CVE-2026-40682/): Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor (critical 9.1)
- [CVE-2026-67211](https://insights.sbomify.com/CVE-2026-67211/): Apache OpenNLP: OOM DoS via Unbounded Array Allocation in SymSpellModelSerializer (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-63317 and fix it if it is affected.

What it is: CVE-2026-63317 is a medium-severity unsafe deserialization vulnerability in Apache OpenNLP, published on 24 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-63317 in the wild and no public exploit code.

Affected product: Apache OpenNLP. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-63317/ (Markdown: https://insights.sbomify.com/CVE-2026-63317/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-63317
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-63317
- OSV: https://osv.dev/vulnerability/CVE-2026-63317

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-63317/
Summaries are generated and may contain mistakes; the official description above is the record.
