🇰🇷 한글 설명
DSAI-Cline의 명령 자동 승인 모듈에서 화이트리스트 보안 메커니즘을 무력화하는 심각한 OS 명령 주입 취약점이 발견되었습니다. 시스템이 세미콜론이나 앰퍼샌드 같은 특수 문자는 차단하지만 줄바꿈 문자는 검증하지 못해, 공격자가 허용된 명령 뒤에 줄바꿈과 함께 악성 코드를 삽입하여 원격 코드 실행(RCE)을 수행할 수 있습니다.
💡 쉬운 설명
프로그램이 허용된 명령어만 실행하도록 감시하고 있지만, 줄바꿈 문자를 이용한 속임수를 찾아내지 못하는 결함이 있습니다. 공격자가 줄바꿈을 이용해 허용된 명령 뒤에 몰래 나쁜 명령을 붙여 보내면 프로그램이 이를 정상적인 명령으로 착각하고 실행해 버립니다.
🇺🇸 원문 (English)
DSAI-Cline's command auto-approval module contains a critical OS command injection vulnerability that renders its whitelist security mechanism completely ineffective. The system relies on string-based parsing to validate commands; while it intercepts dangerous operators such as ;, &&, ||, |, and command substitution patterns, it fails to account for raw newline characters embedded within the input. An attacker can construct a payload by embedding a literal newline between a whitelisted command and malicious code (e.g., git log malicious_command), forcing DSAI-Cline to misidentify it as a safe operation and automatically approve it. The underlying PowerShell interpreter treats the newline as a command separator, executing both commands sequentially, resulting in Remote Code Execution without any user interaction.
📍 영향받는 시스템
DSAI-Cline (command auto-approval module 사용 버전)
⚔️ 공격 벡터
허용된 명령어 뒤에 줄바꿈 문자(
)와 함께 악성 명령어를 삽입하여 자동 승인을 유도하는 방식
🛡️ 대응 방법
명령어 검증 로직에 줄바꿈 문자(
,
)에 대한 필터링을 추가하고, 문자열 기반 파싱 대신 구조화된 명령 검증 방식을 도입해야 함
🔧 검증 코드
명령어 실행 결과가 'Vulnerable'로 출력되면 줄바꿈을 이용한 명령 주입이 가능한 상태입니다.
echo -e 'git log
whoami' | python3 -c "import sys; cmd = sys.stdin.read(); print('Vulnerable' if '\n' in cmd and 'git log' in cmd else 'Safe')"