🇰🇷 한글 설명
Anyquery 0.4.5 미만 버전에서 SQL 스칼라 함수인 clear_plugin_cache가 경로 탐색(Path Traversal) 공격을 제대로 차단하지 못하는 취약점이 발견되었습니다. 공격자가 조작된 플러그인 매개변수를 전달하면 os.RemoveAll 함수가 지정된 디렉토리를 벗어나 서버 프로세스가 접근 가능한 임의의 디렉토리를 재귀적으로 삭제할 수 있습니다. 이로 인해 영구적인 데이터 손실 및 서비스 거부(DoS)가 발생할 수 있습니다.
💡 쉬운 설명
특정 명령어를 통해 서버의 허가되지 않은 폴더를 통째로 삭제할 수 있는 보안 결함입니다. 공격자가 파일 경로를 조작하여 시스템의 중요한 데이터를 지워버릴 수 있습니다.
🇺🇸 원문 (English)
Anyquery is an SQL query engine built on top of SQLite. Prior to 0.4.5, the clear_plugin_cache(plugin) SQL scalar function in namespace/other_functions.go passes the caller-controlled plugin parameter through path.Join to os.RemoveAll without rejecting traversal segments. A low-privileged bearer-token holder can invoke the function through the /v1/query HTTP endpoint, causing path.Join to resolve .. segments outside $XDG_CACHE_HOME/anyquery/plugins/ and os.RemoveAll to recursively delete any reachable directory writable by the Anyquery server process. This causes permanent data loss and denial of service without disclosing file contents. This issue is fixed in version 0.4.5.
📍 영향받는 시스템
Anyquery versions prior to 0.4.5
⚔️ 공격 벡터
/v1/query HTTP 엔드포인트를 통해 조작된 경로 매개변수를 포함한 SQL 함수 호출
🛡️ 대응 방법
Anyquery를 최신 버전인 0.4.5 이상으로 업데이트하십시오.
🔧 검증 코드
명령어 결과에 0.4.5 미만의 버전 번호가 출력되면 취약한 버전이 설치된 상태입니다.
anyquery --version 2>/dev/null | grep -E '0\.[0-4]\.[0-4]'