CVE-2026-42027
Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader
Description
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 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.
INFO
Published Date :
May 4, 2026, 5:16 p.m.
Last Modified :
Oct. 26, 2026, 7:10 p.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | CRITICAL | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | ||||
| CVSS 3.1 | HIGH | 0b0ca135-0b70-47e7-9f44-1890c2a1c46c |
Solution
- Upgrade Apache OpenNLP to 2.5.9 or later.
- Upgrade Apache OpenNLP to 3.0.0-M3 or later.
- Register allowed packages programmatically if not upgrading.
- Set system property for allowed packages if not upgrading.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-42027.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-42027 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-42027
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-42027 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-42027 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Oct. 26, 2026
Action Type Old Value New Value Added Translation Title: Apache OpenNLP de Apache Software Foundation, Description: Instanciación Arbitraria de Clases a través del Manifiesto del Modelo en Apache OpenNLP ExtensionLoader Versiones Afectadas: anteriores a 2.5.9, anteriores a 3.0.0-M3 Descripción: El método ExtensionLoader.instantiateExtension(Class, String) carga una clase por su nombre completamente cualificado a través de Class.forName() e invoca su constructor sin argumentos, con el nombre de la clase obtenido de la entrada manifest.properties de un archivo de modelo. La comprobación isAssignableFrom existente rechaza correctamente las clases que no son subtipos de la interfaz de extensión esperada (BaseToolFactory para factory=, ArtifactSerializer para serializer-class-*), pero la comprobación se ejecuta después de que Class.forName() ya haya cargado e inicializado la clase nombrada. Class.forName() con semántica de inicialización predeterminada ejecuta el inicializador estático de la clase objetivo antes de regresar, por lo que un atacante que pueda proporcionar un archivo de modelo manipulado puede hacer que el inicializador estático de cualquier clase en el classpath se ejecute durante la carga del modelo, independientemente de si esa clase pasa la comprobación de tipo posterior. La explotación requiere que una clase con efectos secundarios útiles para el atacante en su inicializador estático (por ejemplo, búsqueda JNDI, E/S de red saliente o acceso al sistema de archivos) esté presente en el classpath, por lo que esto no es una ejecución remota de código directa; sin embargo, la superficie de ataque crece a medida que la distribución de modelos de terceros se vuelve más común (repositorios de modelos comunitarios, compartición al estilo Hugging Face), donde los usuarios cargan rutinariamente archivos de modelo de orígenes que no controlan. Un vector secundario y más limitado afecta a las implementaciones que distribuyen subclases legítimas de BaseToolFactory o ArtifactSerializer con constructores sin argumentos que producen efectos secundarios: un manifiesto malicioso puede nombrar dicha clase y forzar la ejecución de su constructor durante la carga del modelo. Mitigación: * Los usuarios de 2.x deben actualizar a 2.5.9. * Los usuarios de 3.x deben actualizar a 3.0.0-M3. Nota: La corrección introduce una lista blanca de prefijos de paquete que se consulta antes de invocar Class.forName(), por lo que el inicializador estático de una clase no permitida nunca se ejecuta. Las clases bajo el prefijo opennlp. permanecen permitidas por defecto. Las implementaciones que cargan modelos que referencian fábricas o serializadores fuera de opennlp.* deben incluir esos paquetes, ya sea programáticamente a través de ExtensionLoader.registerAllowedPackage(String) antes de la primera carga del modelo, o configurando la propiedad del sistema OPENNLP_EXT_ALLOWED_PACKAGES a una lista de prefijos de paquete permitidos separados por comas. Los usuarios que no puedan actualizar inmediatamente deben asegurarse de que todos los archivos de modelo provengan de orígenes de confianza y deben auditar su classpath en busca de clases con inicializadores estáticos o constructores que produzcan efectos secundarios, particularmente cualquiera que realice búsquedas JNDI, solicitudes de red u operaciones del sistema de archivos durante la inicialización de la clase. -
CVE Modified by 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
Sep. 09, 2026
Action Type Old Value New Value Added Affected Affected value modified. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/42xxx/CVE-2026-42027.json">CVE-2026-42027</a> Added Reference https://access.redhat.com/errata/RHSA-2026:65126 Added Reference https://access.redhat.com/security/cve/CVE-2026-42027 Added Reference https://bugzilla.redhat.com/show_bug.cgi?id=2466527 Added Reference https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42027.json Removed Reference https://access.redhat.com/security/cve/CVE-2026-42027 Removed Reference https://bugzilla.redhat.com/show_bug.cgi?id=2466527 Removed Reference https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42027.json -
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Sep. 09, 2026
Action Type Old Value New Value Added Reference http://www.openwall.com/lists/oss-security/2026/05/01/20 Removed Reference http://www.openwall.com/lists/oss-security/2026/05/01/20 Removed Reference Type http://www.openwall.com/lists/oss-security/2026/05/01/20 Types: Mailing List, Third Party Advisory -
CVE Modified by [email protected]
Sep. 09, 2026
Action Type Old Value New Value Added Reference https://lists.apache.org/thread/ltlo4powjfc0w2w2yyl1o5tc7q1gcb2y Removed Reference https://lists.apache.org/thread/ltlo4powjfc0w2w2yyl1o5tc7q1gcb2y Removed Reference Type https://lists.apache.org/thread/ltlo4powjfc0w2w2yyl1o5tc7q1gcb2y Types: Mailing List, Vendor Advisory -
CVE Modified by 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
Jul. 15, 2026
Action Type Old Value New Value Changed Affected [{'cpes': ['cpe:/a:redhat:jboss_fuse:7'], 'vendor': 'Red Hat', 'product': 'Red Hat Fuse 7', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift_ai'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift AI (RHOAI)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:camel_spring_boot:4'], 'vendor': 'Red Hat', 'product': 'Red Hat build of Apache Camel for Spring Boot 4', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jboss_data_grid:8'], 'vendor': 'Red Hat', 'product': 'Red Hat Data Grid 8', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jboss_enterprise_application_platform:8'], 'vendor': 'Red Hat', 'product': 'Red Hat JBoss Enterprise Application Platform 8', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jbosseapxp'], 'vendor': 'Red Hat', 'product': 'Red Hat JBoss Enterprise Application Platform Expansion Pack', 'defaultStatus': 'unaffected'}] [{'cpes': ['cpe:/a:redhat:camel_spring_boot:4'], 'vendor': 'Red Hat', 'product': 'Red Hat build of Apache Camel for Spring Boot 4', 'packageName': 'opennlp-tools', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jboss_data_grid:8'], 'vendor': 'Red Hat', 'product': 'Red Hat Data Grid 8', 'packageName': 'opennlp-tools', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jboss_fuse:7'], 'vendor': 'Red Hat', 'product': 'Red Hat Fuse 7', 'packageName': 'opennlp-tools', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:jboss_enterprise_application_platform:8'], 'vendor': 'Red Hat', 'product': 'Red Hat JBoss Enterprise Application Platform 8', 'packageName': 'opennlp-tools', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jbosseapxp'], 'vendor': 'Red Hat', 'product': 'Red Hat JBoss Enterprise Application Platform Expansion Pack', 'packageName': 'opennlp-tools', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:openshift_ai'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift AI (RHOAI)', 'packageName': 'rhoai/odh-trustyai-service-rhel8', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:openshift_ai'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift AI (RHOAI)', 'packageName': 'rhoai/odh-trustyai-service-rhel9', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift_ai'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift AI (RHOAI)', 'packageName': 'rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9', 'collectionURL': 'https://access.redhat.com/downloads/content/package-browser/', 'defaultStatus': 'affected'}] -
CVE Modified by [email protected]
Jun. 30, 2026
Action Type Old Value New Value Changed Affected [{'vendor': 'Apache Software Foundation', 'product': 'Apache OpenNLP', 'versions': [{'status': 'affected', 'version': '2.0', 'lessThan': '2.5.9', 'versionType': 'semver'}, {'status': 'affected', 'version': '3.0', 'lessThan': '3.0.0-M3', 'versionType': 'semver'}, {'status': 'affected', 'version': '0', 'lessThan': '1.9.5', 'versionType': 'semver'}], 'packageName': 'org.apache.opennlp:opennlp-tools', 'collectionURL': 'https://repo.maven.apache.org/maven2/', 'defaultStatus': 'unaffected'}] [{'vendor': 'Apache Software Foundation', 'product': 'Apache OpenNLP', 'versions': [{'status': 'affected', 'version': '2.0', 'lessThan': '2.5.9', 'versionType': 'semver'}, {'status': 'affected', 'version': '3.0.0-M1', 'lessThan': '3.0.0-M3', 'versionType': 'semver'}, {'status': 'affected', 'version': '0', 'lessThan': '1.9.5', 'versionType': 'semver'}], 'packageName': 'org.apache.opennlp:opennlp-tools', 'collectionURL': 'https://repo.maven.apache.org/maven2/', 'defaultStatus': 'unaffected'}] -
CVE Modified by 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
Jun. 30, 2026
Action Type Old Value New Value Added Affected [{'cpes': ['cpe:/a:redhat:jboss_fuse:7'], 'vendor': 'Red Hat', 'product': 'Red Hat Fuse 7', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift_ai'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift AI (RHOAI)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:camel_spring_boot:4'], 'vendor': 'Red Hat', 'product': 'Red Hat build of Apache Camel for Spring Boot 4', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jboss_data_grid:8'], 'vendor': 'Red Hat', 'product': 'Red Hat Data Grid 8', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jboss_enterprise_application_platform:8'], 'vendor': 'Red Hat', 'product': 'Red Hat JBoss Enterprise Application Platform 8', 'defaultStatus': 'unaffected'}, {'cpes': ['cpe:/a:redhat:jbosseapxp'], 'vendor': 'Red Hat', 'product': 'Red Hat JBoss Enterprise Application Platform Expansion Pack', 'defaultStatus': 'unaffected'}] Added CVSS V3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H Added CWE CWE-502 Added Reference https://access.redhat.com/security/cve/CVE-2026-42027 Added Reference https://bugzilla.redhat.com/show_bug.cgi?id=2466527 Added Reference https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42027.json -
CVE Modified by [email protected]
Jun. 29, 2026
Action Type Old Value New Value Changed Affected [{'vendor': 'Apache Software Foundation', 'product': 'Apache OpenNLP', 'versions': [{'status': 'affected', 'version': '0', 'lessThan': '2.5.9', 'versionType': 'semver'}, {'status': 'affected', 'version': '3.0', 'lessThan': '3.0.0-M3', 'versionType': 'semver'}], 'packageName': 'org.apache.opennlp:opennlp-tools', 'collectionURL': 'https://repo.maven.apache.org/maven2/', 'defaultStatus': 'unaffected'}] [{'vendor': 'Apache Software Foundation', 'product': 'Apache OpenNLP', 'versions': [{'status': 'affected', 'version': '2.0', 'lessThan': '2.5.9', 'versionType': 'semver'}, {'status': 'affected', 'version': '3.0', 'lessThan': '3.0.0-M3', 'versionType': 'semver'}, {'status': 'affected', 'version': '0', 'lessThan': '1.9.5', 'versionType': 'semver'}], 'packageName': 'org.apache.opennlp:opennlp-tools', 'collectionURL': 'https://repo.maven.apache.org/maven2/', 'defaultStatus': 'unaffected'}] Changed Description 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. 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 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. -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Jun. 17, 2026
Action Type Old Value New Value Added SSVC {'id': 'CVE-2026-42027', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'yes'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-05-05T16:01:56.421468Z'} -
CVE Modified by [email protected]
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'vendor': 'Apache Software Foundation', 'product': 'Apache OpenNLP', 'versions': [{'status': 'affected', 'version': '0', 'lessThan': '2.5.9', 'versionType': 'semver'}, {'status': 'affected', 'version': '3.0', 'lessThan': '3.0.0-M3', 'versionType': 'semver'}], 'packageName': 'org.apache.opennlp:opennlp-tools', 'collectionURL': 'https://repo.maven.apache.org/maven2/', 'defaultStatus': 'unaffected'}] -
Initial Analysis by [email protected]
May. 06, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:a:apache:opennlp:*:*:*:*:*:*:*:* versions up to (excluding) 2.5.9 *cpe:2.3:a:apache:opennlp:3.0.0:m1:*:*:*:*:*:* *cpe:2.3:a:apache:opennlp:3.0.0:m2:*:*:*:*:*:* Added Reference Type CVE: http://www.openwall.com/lists/oss-security/2026/05/01/20 Types: Mailing List, Third Party Advisory Added Reference Type Apache Software Foundation: https://lists.apache.org/thread/ltlo4powjfc0w2w2yyl1o5tc7q1gcb2y Types: Mailing List, Vendor Advisory -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
May. 05, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H -
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
May. 04, 2026
Action Type Old Value New Value Added Reference http://www.openwall.com/lists/oss-security/2026/05/01/20 -
New CVE Received by [email protected]
May. 04, 2026
Action Type Old Value New Value Added Description 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. Added CWE CWE-470 Added Reference https://lists.apache.org/thread/ltlo4powjfc0w2w2yyl1o5tc7q1gcb2y