CVE-2026-42440
Full vulnerability record from the local CVENow database.
Description
OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader Versions Affected: before 1.9.5 before 2.5.9 before 3.0.0-M3 Description: The AbstractModelReader methods getOutcomes(), getOutcomePatterns(), and getPredicates() each read a 32-bit signed integer count field from a binary model stream and pass that value directly to an array allocation (new String[numOutcomes], new int[numOCTypes][], new String[NUM_PREDS]) without validating that the value is non-negative or within a reasonable bound. The count is therefore fully attacker-controlled when the model file originates from an untrusted source. A crafted .bin model file in which any of these count fields is set to Integer.MAX_VALUE (or any value large enough to exhaust the available heap) triggers an OutOfMemoryError at the array allocation itself, before the corresponding label or pattern data is consumed from the stream. The error occurs very early in deserialization: for a GIS model, getOutcomes() is reached after only the model-type string, the correction constant, and the correction parameter have been read; so the attacker pays no meaningful size cost to weaponize a payload, and a single small file can crash a JVM that loads it. Any code path that deserializes a .bin model is affected, including direct use of GenericModelReader and any higher-level component that delegates to it during model load. The practical impact is denial of service against processes that load model files from untrusted or semi-trusted origins. Mitigation: * 2.x users should upgrade to 2.5.9. * 3.x users should upgrade to 3.0.0-M3. Note: The fix introduces an upper bound on each of the three count fields, checked before array allocation; counts that are negative or exceed the bound cause an IllegalArgumentException to be thrown and the read to fail fast with no large allocation. The default bound is 10,000,000, which is well above the entry counts of legitimate OpenNLP models but far below any value that would threaten heap exhaustion. Deployments that legitimately need to load models with more entries than the default can raise the limit at JVM startup by setting the OPENNLP_MAX_ENTRIES system property to the desired positive integer (e.g. -DOPENNLP_MAX_ENTRIES=50000000); invalid or non-positive values fall back to the default. Users who cannot upgrade immediately should treat all .bin model files as untrusted input unless their provenance is verified, and should avoid loading models supplied by end users or fetched from third-party repositories without integrity checks.
View original CVE JSON
{
"id": "CVE-2026-42440",
"sourceIdentifier": "[email protected]",
"published": "2026-05-04T17:16:26.147",
"lastModified": "2026-10-26T19:10:00.163",
"vulnStatus": "Modified",
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader \n\nVersions Affected: \n\nbefore 1.9.5\nbefore 2.5.9\n\nbefore 3.0.0-M3 \n\nDescription:\n\n\nThe AbstractModelReader methods getOutcomes(), getOutcomePatterns(), and getPredicates() each read a 32-bit signed integer count field from a binary model stream and pass that value directly to an array allocation (new String[numOutcomes], new int[numOCTypes][], new String[NUM_PREDS]) without validating that the value is non-negative or within a reasonable bound. The count is therefore fully attacker-controlled when the model file originates from an untrusted source.\n\n\nA crafted .bin model file in which any of these count fields is set to Integer.MAX_VALUE (or any value large enough to exhaust the available heap) triggers an OutOfMemoryError at the array allocation itself, before the corresponding label or pattern data is consumed from the stream. The error occurs very early in deserialization: for a GIS model, getOutcomes() is reached after only the model-type string, the correction constant, and the correction parameter have been read; so the attacker pays no meaningful size cost to weaponize a payload, and a single small file can crash a JVM that loads it. Any code path that deserializes a .bin model is affected, including direct use of GenericModelReader and any higher-level component that delegates to it during model load.\n\n\nThe practical impact is denial of service against processes that load model files from untrusted or semi-trusted origins. \n\n\nMitigation:\n\n\n\n * 2.x users should upgrade to 2.5.9.\n\n * 3.x users should upgrade to 3.0.0-M3.\n\n\n\n\nNote: The fix introduces an upper bound on each of the three count fields, checked before array allocation; counts that are negative or exceed the bound cause an IllegalArgumentException to be thrown and the read to fail fast with no large allocation. The default bound is 10,000,000, which is well above the entry counts of legitimate OpenNLP models but far below any value that would threaten heap exhaustion. Deployments that legitimately need to load models with more entries than the default can raise the limit at JVM startup by setting the OPENNLP_MAX_ENTRIES system property to the desired positive integer (e.g. -DOPENNLP_MAX_ENTRIES=50000000); invalid or non-positive values fall back to the default.\n\n\nUsers who cannot upgrade immediately should treat all .bin model files as untrusted input unless their provenance is verified, and should avoid loading models supplied by end users or fetched from third-party repositories without integrity checks."
},
{
"lang": "es",
"value": "Denegación de servicio por OOM a través de asignación de array sin límites en Apache OpenNLP AbstractModelReader\n\nVersiones afectadas:\n\nanteriores a 2.5.9\n\nanteriores a 3.0.0-M3\n\nDescripción:\n\nLos métodos de AbstractModelReader getOutcomes(), getOutcomePatterns() y getPredicates() leen cada uno un campo de conteo entero con signo de 32 bits de un flujo de modelo binario y pasan ese valor directamente a una asignación de array (new String[numOutcomes], new int[numOCTypes][], new String[NUM_PREDS]) sin validar que el valor no sea negativo o esté dentro de un límite razonable. Por lo tanto, el conteo está completamente controlado por el atacante cuando el archivo del modelo proviene de una fuente no confiable.\n\nUn archivo de modelo .bin manipulado en el que cualquiera de estos campos de conteo se establece en Integer.MAX_VALUE (o cualquier valor lo suficientemente grande como para agotar el heap disponible) desencadena un OutOfMemoryError en la propia asignación del array, antes de que los datos de etiqueta o patrón correspondientes se consuman del flujo. El error ocurre muy temprano en la deserialización: para un modelo GIS, se llega a getOutcomes() después de que solo se hayan leído la cadena de tipo de modelo, la constante de corrección y el parámetro de corrección; por lo que el atacante no paga un costo de tamaño significativo para convertir una carga útil en arma, y un solo archivo pequeño puede bloquear una JVM que lo carga. Cualquier ruta de código que deserialice un modelo .bin se ve afectada, incluyendo el uso directo de GenericModelReader y cualquier componente de nivel superior que le delegue durante la carga del modelo.\n\nEl impacto práctico es la denegación de servicio contra procesos que cargan archivos de modelo de orígenes no confiables o semi-confiables.\n\nMitigación:\n\n * Los usuarios de 2.x deberían actualizar a 2.5.9.\n\n * Los usuarios de 3.x deberían actualizar a 3.0.0-M3.\n\nNota: La corrección introduce un límite superior en cada uno de los tres campos de conteo, verificado antes de la asignación del array; los conteos que son negativos o exceden el límite hacen que se lance una IllegalArgumentException y la lectura falle rápidamente sin una asignación grande. El límite predeterminado es 10,000,000, que está muy por encima de los conteos de entradas de los modelos legítimos de OpenNLP pero muy por debajo de cualquier valor que amenazaría el agotamiento del heap. Las implementaciones que legítimamente necesitan cargar modelos con más entradas que el valor predeterminado pueden aumentar el límite al iniciar la JVM configurando la propiedad del sistema OPENNLP_MAX_ENTRIES al entero positivo deseado (por ejemplo, -DOPENNLP_MAX_ENTRIES=50000000); los valores inválidos o no positivos vuelven al valor predeterminado.\n\nLos usuarios que no pueden actualizar inmediatamente deberían tratar todos los archivos de modelo .bin como entrada no confiable a menos que se verifique su procedencia, y deberían evitar cargar modelos proporcionados por usuarios finales o obtenidos de repositorios de terceros sin verificaciones de integridad."
}
],
"affected": [
{
"source": "[email protected]",
"affectedData": [
{
"vendor": "Apache Software Foundation",
"product": "Apache OpenNLP",
"defaultStatus": "unaffected",
"collectionURL": "https://repo.maven.apache.org/maven2",
"packageName": "org.apache.opennlp:opennlp-tools",
"versions": [
{
"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",
"status": "affected"
}
]
}
]
},
{
"source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c",
"affectedData": [
{
"vendor": "Red Hat",
"product": "Red Hat Data Grid 8",
"defaultStatus": "unaffected",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "opennlp-tools",
"cpes": [
"cpe:/a:redhat:jboss_data_grid:8"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat Fuse 7",
"defaultStatus": "affected",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "opennlp-maxent",
"cpes": [
"cpe:/a:redhat:jboss_fuse:7"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat Fuse 7",
"defaultStatus": "affected",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "opennlp-tools",
"cpes": [
"cpe:/a:redhat:jboss_fuse:7"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat JBoss Enterprise Application Platform Expansion Pack",
"defaultStatus": "unaffected",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "opennlp-tools",
"cpes": [
"cpe:/a:redhat:jbosseapxp"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat OpenShift AI (RHOAI)",
"defaultStatus": "unknown",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "rhoai/odh-trustyai-service-rhel8",
"cpes": [
"cpe:/a:redhat:openshift_ai"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat OpenShift AI (RHOAI)",
"defaultStatus": "unknown",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "rhoai/odh-trustyai-service-rhel9",
"cpes": [
"cpe:/a:redhat:openshift_ai"
]
},
{
"vendor": "Red Hat",
"product": "Red Hat OpenShift AI (RHOAI)",
"defaultStatus": "unknown",
"collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
"packageName": "rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9",
"cpes": [
"cpe:/a:redhat:openshift_ai"
]
}
]
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"availabilityImpact": "HIGH"
},
"exploitabilityScore": 3.9,
"impactScore": 3.6
},
{
"source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"availabilityImpact": "HIGH"
},
"exploitabilityScore": 3.9,
"impactScore": 3.6
}
],
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"timestamp": "2026-05-05T16:00:26.146388Z",
"id": "CVE-2026-42440",
"options": [
{
"exploitation": "none"
},
{
"automatable": "yes"
},
{
"technicalImpact": "partial"
}
],
"role": "CISA Coordinator",
"version": "2.0.3"
}
}
]
},
"weaknesses": [
{
"source": "[email protected]",
"type": "Secondary",
"description": [
{
"lang": "en",
"value": "CWE-789"
}
]
},
{
"source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c",
"type": "Secondary",
"description": [
{
"lang": "en",
"value": "CWE-770"
}
]
}
],
"configurations": [
{
"nodes": [
{
"operator": "OR",
"negate": false,
"cpeMatch": [
{
"vulnerable": true,
"criteria": "cpe:2.3:a:apache:opennlp:*:*:*:*:*:*:*:*",
"versionEndExcluding": "2.5.9",
"matchCriteriaId": "3E73109B-BF5E-4832-B5DC-1747D3C42287"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:a:apache:opennlp:3.0.0:m1:*:*:*:*:*:*",
"matchCriteriaId": "57E14048-91DB-4673-9A7B-B15675B3994A"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:a:apache:opennlp:3.0.0:m2:*:*:*:*:*:*",
"matchCriteriaId": "2E738486-C0BD-4FDB-8880-DBC2BA4C0D77"
}
]
}
]
}
],
"references": [
{
"url": "https://lists.apache.org/thread/s8xlkx1gqbxfsq48py5h6jphjvgqp1jo",
"source": "[email protected]",
"tags": [
"Mailing List",
"Vendor Advisory"
]
},
{
"url": "http://www.openwall.com/lists/oss-security/2026/05/01/21",
"source": "af854a3a-2127-422b-91ae-364da2661108",
"tags": [
"Mailing List",
"Third Party Advisory"
]
},
{
"url": "https://access.redhat.com/security/cve/CVE-2026-42440",
"source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c"
},
{
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2466494",
"source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c"
},
{
"url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42440.json",
"source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c"
}
]
}