🔍 CVE-2026-42440

7.5
CVSS Score
HIGH
2026-05-04
2026-10-26 19:10
✅ 완료

🇰🇷 한글 설명

Apache OpenNLP의 AbstractModelReader는 바이너리 모델 파일에서 읽은 개수 필드를 검증 없이 배열 할당에 사용합니다. 악의적으로 조작된 .bin 모델 파일로 인해 메모리 부족(OOM)이 발생하여 서비스 거부(DoS)가 가능합니다.

💡 쉬운 설명

신뢰할 수 없는 출처의 모델 파일을 불러오면 프로그램이 메모리를 과도하게 할당하며 비정상 종료될 수 있습니다. 공격자는 작은 파일 하나로 이 문제를 일으킬 수 있습니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

Apache OpenNLP 2.5.9 미만, 3.0.0-M3 미만, 1.9.5 미만 버전을 사용하는 Java 기반 애플리케이션

⚔️ 공격 벡터

공격자가 개수 필드를 Integer.MAX_VALUE로 설정한 조작된 .bin 모델 파일을 대상 시스템이 로드하도록 유도

🛡️ 대응 방법

2.x는 2.5.9, 3.x는 3.0.0-M3 이상으로 업그레이드하고, 검증되지 않은 .bin 모델 파일 로딩을 피할 것

🔧 검증 코드

출력된 Implementation-Version이 2.5.9 미만(2.x 계열) 또는 3.0.0-M3 미만(3.x 계열)이면 취약하며, 아무것도 출력되지 않으면 OpenNLP JAR이 설치되어 있지 않은 것입니다.

Shell / Script
find / -name 'opennlp*.jar' 2>/dev/null | xargs -I{} sh -c 'unzip -p {} META-INF/MANIFEST.MF 2>/dev/null | grep -i impl-version'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H