🔍 CVE-2023-42503

5.5
CVSS Score
MEDIUM
2023-09-14
2026-06-17 06:23
✅ 완료

🇰🇷 한글 설명

Apache Commons Compress의 TAR 파싱 과정에서 입력값 검증 미흡으로 인해 발생하는 자원 소모 취약점입니다. 공격자가 조작된 TAR 파일의 파일 수정 시간 헤더에 매우 긴 소수점이나 지수 표기법을 삽입하면, BigDecimal 클래스 처리 과정에서 과도한 CPU 사용을 유발하여 서비스 거부(DoS) 상태를 일으킬 수 있습니다.

💡 쉬운 설명

악의적으로 만들어진 압축 파일을 열 때 컴퓨터가 계산을 하느라 너무 많은 힘을 써서 멈추게 만드는 공격입니다. 압축 파일 안에 들어있는 시간 정보에 아주 긴 숫자를 넣어 컴퓨터를 마비시킵니다.

🇺🇸 원문 (English)

Improper Input Validation, Uncontrolled Resource Consumption vulnerability in Apache Commons Compress in TAR parsing.This issue affects Apache Commons Compress: from 1.22 before 1.24.0. Users are recommended to upgrade to version 1.24.0, which fixes the issue. A third party can create a malformed TAR file by manipulating file modification times headers, which when parsed with Apache Commons Compress, will cause a denial of service issue via CPU consumption. In version 1.22 of Apache Commons Compress, support was added for file modification times with higher precision (issue # COMPRESS-612 [1]). The format for the PAX extended headers carrying this data consists of two numbers separated by a period [2], indicating seconds and subsecond precision (for example “1647221103.5998539”). The impacted fields are “atime”, “ctime”, “mtime” and “LIBARCHIVE.creationtime”. No input validation is performed prior to the parsing of header values. Parsing of these numbers uses the BigDecimal [3] class from the JDK which has a publicly known algorithmic complexity issue when doing operations on large numbers, causing denial of service (see issue # JDK-6560193 [4]). A third party can manipulate file time headers in a TAR file by placing a number with a very long fraction (300,000 digits) or a number with exponent notation (such as “9e9999999”) within a file modification time header, and the parsing of files with these headers will take hours instead of seconds, leading to a denial of service via exhaustion of CPU resources. This issue is similar to CVE-2012-2098 [5]. [1]: https://issues.apache.org/jira/browse/COMPRESS-612 [2]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_05 [3]: https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html [4]: https://bugs.openjdk.org/browse/JDK-6560193 [5]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-2098 Only applications using CompressorStreamFactory class (with auto-detection of file types), TarArchiveInputStream and TarFile classes to parse TAR files are impacted. Since this code was introduced in v1.22, only that version and later versions are impacted.

📍 영향받는 시스템

Apache Commons Compress 1.22 버전부터 1.24.0 미만 버전

⚔️ 공격 벡터

조작된 파일 수정 시간 헤더(atime, ctime, mtime 등)가 포함된 악성 TAR 파일 제공

🛡️ 대응 방법

Apache Commons Compress를 1.24.0 이상의 버전으로 업그레이드

🔧 검증 코드

출력된 결과에서 commons-compress의 버전이 1.22 이상 1.24.0 미만인지 확인합니다.

Shell / Script
mvn dependency:list | grep commons-compress

📊 CVSS Vector String

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