🇰🇷 한글 설명
Apache OpenNLP의 기본 정규식 이름 탐색기(EMAIL, URL)에 중첩된 수량자가 포함되어 있어, 조작된 입력값에 대해 과도한 백트래킹이나 무한 재귀를 유발할 수 있습니다. 공격자가 악의적인 텍스트를 입력할 경우 CPU 자원을 고갈시키거나 스택 오버플로를 발생시켜 서비스 거부(DoS) 상태로 만들 수 있습니다.
💡 쉬운 설명
특정한 규칙을 가진 글자를 찾는 기능에 결함이 있어, 나쁜 의도를 가진 짧은 문장을 보내면 컴퓨터가 계산을 하느라 멈추거나 프로그램이 강제로 종료될 수 있습니다. 이를 통해 웹사이트나 서비스를 마비시킬 수 있는 보안 취약점입니다.
🇺🇸 원문 (English)
The two built-in name-finder patterns exposed by
opennlp.tools.namefind.RegexNameFinderFactory - DEFAULT_REGEX_NAME_FINDER.EMAIL
and DEFAULT_REGEX_NAME_FINDER.URL - contain ambiguous nested quantifiers. An
application that obtains these finders through
RegexNameFinderFactory.getDefaultRegexNameFinders(...) and then applies them to
untrusted text through RegexNameFinder.find(String[]) or RegexNameFinder.find(String)
can be driven into super-linear backtracking or into unbounded matcher recursion by a
small crafted input.
For the EMAIL pattern, a long run of local-part characters that is never followed by an
@ forces the matcher to re-scan to end-of-input from every starting offset. Cost grows
quadratically with input length: an input of approximately 32 KB consumes several seconds
of CPU in a single find() call and returns no match, and each doubling of the input
multiplies the cost roughly four-fold.
For the URL pattern, the query-string sub-expression nests a capturing repetition inside
an outer repetition. The JDK matcher recurses once per query token, so an input of
approximately 4 KB containing many &-separated tokens exhausts the thread stack and
causes java.lang.StackOverflowError to propagate out of find(), terminating the
calling thread. On a thread created with a smaller stack (for example -Xss512k, typical
of server worker pools) approximately 1 KB is sufficient.
In both cases an attacker who can supply text for analysis can convert a single request
into seconds to minutes of pinned CPU, or into an abrupt thread death, denying service to
the embedding application. No authentication, special configuration, or model file is
required beyond the application having selected one of the two built-in finders.
This issue affects Apache OpenNLP: from 2.0.0 through 2.5.11; from 3.0.0-M1 through
3.0.0-M5.
Users are recommended to upgrade to version 2.5.12, or to 3.0.0-M6 for users tracking the
3.0.0 milestone line, which fix the issue.
📍 영향받는 시스템
Apache OpenNLP 2.0.0 ~ 2.5.11 및 3.0.0-M1 ~ 3.0.0-M5
⚔️ 공격 벡터
신뢰할 수 없는 텍스트를 분석 대상으로 제공하여 CPU 과부하 또는 StackOverflowError 유도
🛡️ 대응 방법
Apache OpenNLP 버전을 2.5.12 또는 3.0.0-M6 이상으로 업그레이드
🔧 검증 코드
출력된 결과에서 opennlp의 버전이 취약한 범위(2.0.0-2.5.11 또는 3.0.0-M1-M5)에 해당하는지 확인합니다.
mvn dependency:list | grep opennlp
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
💻 영향받는 소프트웨어
IBM WebSphere Application Server