🇰🇷 한글 설명
Banks 2.4.4 미만 버전에서 미디어 필터가 사용자 입력을 검증 없이 파일 경로로 처리하여 발생하는 경로 탐색 취약점입니다. 공격자는 경로 탐색(../)을 통해 시스템의 민감한 파일(.env, SSH 키, /etc/passwd 등)을 읽고 탈취할 수 있습니다.
💡 쉬운 설명
프로그램이 파일 이름을 확인하지 않고 그대로 읽어들이는 허점이 있어, 공격자가 시스템 내부의 중요한 비밀 파일을 몰래 훔쳐갈 수 있는 문제입니다. 마치 집 주소를 입력하는 칸에 '옆집 금고'라고 적어도 집주인이 그대로 열어주는 것과 같습니다.
🇺🇸 원문 (English)
Banks generates meaningful LLM prompts using a simple template language. In versions prior to 2.4.4, all four media filters (image, audio, video, document) in banks accept untrusted user input as file paths via Path(value) and pass them directly to open(file_path, "rb") without any path sanitization, canonicalization, or directory restriction. An attacker who controls template variables passed to a banks Prompt can use path traversal (../) to read arbitrary files accessible to the Python process—including .env files, SSH keys, cloud credentials, source code, /etc/passwd, and /etc/shadow—with the content returned base64-encoded in the rendered prompt output, making exfiltration trivial. This is particularly dangerous for applications that use banks to process user-provided template variables before sending prompts to an LLM. This issue has been fixed in version 2.4.4.
📍 영향받는 시스템
Banks versions prior to 2.4.4
⚔️ 공격 벡터
템플릿 변수에 경로 탐색 문자열(../)을 삽입하여 임의의 파일 경로를 전달하는 방식
🛡️ 대응 방법
Banks 라이브러리를 2.4.4 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 2.4.4 미만이면 취약한 상태이며, 2.4.4 이상이면 안전합니다.
pip show banks | grep Version