🇰🇷 한글 설명
CodeWhale은 터미널에서 동작하는 DeepSeek 및 MiMo 기반 코딩 에이전트입니다. 0.8.22 이전 버전에서는 fetch_url 도구가 초기 URL의 IP만 검증하고, HTTP 클라이언트가 자동으로 따라가는 리다이렉트 대상은 SSRF 보호 검사를 다시 수행하지 않아 내부 서비스 접근이 가능합니다.
💡 쉬운 설명
외부 주소로 보이는 링크가 리다이렉트를 통해 클라우드 메타데이터나 내부 서버 같은 민감한 주소로 연결될 수 있습니다. 공격자는 이를 이용해 내부 정보를 몰래 읽어올 수 있습니다.
🇺🇸 원문 (English)
CodeWhale is a DeepSeek + MiMo coding agent in terminal. Prior to 0.8.22, the fetch_url tool validates the initial URL's resolved IP address against a restricted-IP blocklist (is_restricted_ip()) to prevent SSRF attacks against internal services (cloud metadata endpoints, localhost, private networks). However, the HTTP client (reqwest) is configured to automatically follow up to 5 redirects (reqwest::redirect::Policy::limited(5)) without re-validating the redirect target against the same SSRF protections. This vulnerability is fixed in 0.8.22.
📍 영향받는 시스템
CodeWhale 0.8.22 미만 버전
⚔️ 공격 벡터
공격자가 리다이렉트를 걸어둔 외부 URL을 에이전트가 fetch_url로 요청하게 유도하여 내부 IP나 클라우드 메타데이터 엔드포인트에 접근
🛡️ 대응 방법
CodeWhale을 0.8.22 이상으로 업데이트하고, 리다이렉트 대상마다 IP 차단 목록을 재검증하도록 설정
🔧 검증 코드
출력된 버전이 0.8.22 미만이면 취약하므로 업데이트가 필요하고, 0.8.22 이상이면 수정된 버전입니다.
codewhale --version 2>/dev/null || npm list -g codewhale 2>/dev/null