🇰🇷 한글 설명
shell-quote 1.8.5 미만 버전에서 parse() 함수가 토큰을 처리할 때 Array.prototype.concat을 사용하여 O(n^2)의 시간 복잡도를 발생시키는 취약점이 발견되었습니다. 공격자가 제어 가능한 문자열을 입력할 경우 Node.js의 이벤트 루프를 장시간 차단하여 서비스 거부(DoS) 상태를 유발할 수 있습니다.
💡 쉬운 설명
입력값이 많아질수록 처리 속도가 급격히 느려지는 결함이 있어, 악의적인 데이터를 보내 서버를 멈추게 할 수 있습니다. 이는 데이터 유출과는 무관하며 서비스 이용을 방해하는 공격입니다.
🇺🇸 원문 (English)
shell-quote prior to 1.8.5 finalizes parsed tokens in parse() using Array.prototype.concat as a reduce accumulator, which reallocates and copies the entire growing array on every iteration. As a result parse() runs in O(n^2) time relative to the number of input tokens. An attacker who can supply an attacker-controlled string to any code path that calls parse() (no shell metacharacters are required; plain space-separated words suffice) can block the single-threaded Node.js event loop for an extended period with a small input, resulting in a denial of service. There is no code execution or data disclosure; impact is to availability only. Fixed in 1.8.5.
📍 영향받는 시스템
shell-quote 1.8.5 미만 버전
⚔️ 공격 벡터
parse() 함수를 호출하는 코드 경로에 공격자가 제어하는 긴 문자열을 입력하여 이벤트 루프 차단
🛡️ 대응 방법
shell-quote 라이브러리를 1.8.5 버전 이상으로 업데이트
🔧 검증 코드
출력된 결과에서 shell-quote의 버전이 1.8.5 미만인지 확인