🇰🇷 한글 설명
DBHub 0.22.6 미만 버전에서 execute_sql 도구의 읽기 전용 설정이 제대로 작동하지 않는 취약점이 발견되었습니다. 설정값이 활성화되지 않아 실제 데이터베이스 연결이 읽기 전용으로 전환되지 않으며, 공격자가 SQL 명령어를 통해 데이터를 조작하거나 권한에 따라 원격 코드 실행까지 가능합니다. 특히 HTTP 전송 계층이 인증 없이 모든 네트워크에 노출되어 있어 위험도가 높습니다.
💡 쉬운 설명
데이터베이스를 읽기 전용으로 설정해도 실제로는 데이터를 수정하거나 삭제할 수 있는 보안 결함입니다. 해커가 이 허점을 이용하면 데이터베이스 내용을 바꾸거나 서버를 마음대로 조종할 수도 있습니다.
🇺🇸 원문 (English)
DBHub is a database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite. Prior to version 0.22.6, setting `readonly = true` on the `execute_sql` tool does not make the connection read-only. The connectors are written to set PostgreSQL `default_transaction_read_only=on` (and open SQLite in `readOnly` mode), but that code is gated on a config value that is never populated, so it never runs. The only thing left enforcing read-only is a classifier that inspects the first keyword of each statement. Any `SELECT` that writes or has side effects through a function call passes it. With an ordinary role this allows sequence tampering; with a privileged role it allows writing arbitrary files on the server (`lo_export`), reading arbitrary host files (`pg_read_file`), and remote code execution (`dblink` + `COPY ... TO PROGRAM`). The HTTP transport is unauthenticated and binds to `0.0.0.0` by default, so this is reachable by any network caller of `/mcp`. Version 0.22.6 patches the issue.
📍 영향받는 시스템
DBHub version < 0.22.6
⚔️ 공격 벡터
인증되지 않은 네트워크를 통해 /mcp 엔드포인트로 조작된 SQL 명령어를 전송
🛡️ 대응 방법
DBHub를 최신 버전인 0.22.6 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 Version이 0.22.6 미만이면 취약한 상태입니다.
pip show dbhub 2>/dev/null | grep -E 'Version'