🇰🇷 한글 설명
FasterXML jackson-core의 NumberInput.looksLikeValidNumber() 메서드에서 정규 표현식의 중첩된 수량자로 인해 ReDoS(정규 표현식 서비스 거부) 취약점이 발생합니다. 공격자가 조작된 긴 숫자 문자열을 포함한 JSON을 전송하면 백트래킹 엔진의 과도한 연산으로 인해 CPU 자원이 고갈될 수 있습니다. 이 문제는 jackson-databind의 기본 문자열-숫자 변환 과정을 통해 발생합니다.
💡 쉬운 설명
특정한 패턴의 아주 긴 숫자를 입력하면 컴퓨터가 이를 처리하느라 과도하게 계산을 반복하게 만드는 공격입니다. 이로 인해 서버의 처리 능력이 마비되어 서비스가 중단될 수 있습니다.
🇺🇸 원문 (English)
NumberInput.looksLikeValidNumber() in FasterXML jackson-core pre-validates "stringified numbers" with two regular expressions: PATTERN_FLOAT ([+-]?[0-9]*[\.]?[0-9]+([eE][+-]?[0-9]+)?), present since 2.17.0, and PATTERN_FLOAT_TRAILING_DOT, added in 2.17.2. PATTERN_FLOAT places adjacent quantifiers over the same character class -- an optional [0-9]* run, an optional dot, then a required [0-9]+ run -- so input that ultimately fails to match forces Java's backtracking engine to retry every possible split point of the digit run.
Matching cost therefore grows with the square of the input length.
An attacker who can supply JSON that an application deserializes into a numeric target type reaches this method through jackson-databind's default String-to-number coercion (StdDeserializer and NumberDeserializers for BigDecimal, BigInteger, Double and Float).
Because StreamReadConstraints.maxStringLength defaults to 20,000,000 characters, no constraint bounds the input before it reaches the regex.
Testing by the reporter confirmed O(n^2) growth across five consecutive input-size doublings, with a single 160,000-character string consuming roughly 74 seconds in one call; a small number of concurrent requests of ordinary body size can therefore exhaust a server's request-handling thread pool.
The affected method does not exist before 2.17.0, so 2.16.x and earlier releases are not affected.
The fix replaces both regular expressions with a hand-rolled single-pass scan.
📍 영향받는 시스템
FasterXML jackson-core 2.17.0 이상 버전 (2.16.x 및 이전 버전은 해당 없음)
⚔️ 공격 벡터
애플리케이션이 역직렬화하는 JSON 데이터 내에 조작된 긴 숫자 문자열을 포함하여 전송
🛡️ 대응 방법
정규 표현식을 단일 패스 스캔 방식으로 개선한 최신 버전의 jackson-core로 업데이트
🔧 검증 코드
출력된 결과에서 jackson-core의 버전을 확인하여 2.17.0 이상인지 체크
mvn dependency:list | grep jackson-core
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
💻 영향받는 소프트웨어
IBM WebSphere Application Server