🇰🇷 한글 설명
mailcow: dockerized의 /api/v1/add/mailbox 엔드포인트에서 quarantine_category 필드를 검증 없이 저장하고, 이후 quarantine_notify.py가 안전하지 않은 % 문자열 포맷팅으로 SQL 쿼리를 구성하여 second-order SQL injection이 발생합니다. 공격자는 UNION SELECT를 통해 관리자 자격증명 등 민감한 정보를 추출할 수 있습니다.
💡 쉬운 설명
mailcow 메일 서버에서 저장된 데이터가 나중에 쿼리할 때 안전하게 처리되지 않아 공격자가 SQL 명령을 주입할 수 있습니다. 이를 통해 관리자 정보 같은 중요한 데이터를 탈취할 수 있습니다.
🇺🇸 원문 (English)
mailcow: dockerized is an open source groupware/email suite based on docker. Versions prior to 2026-03b have a second-order SQL injection vulnerability in the quarantine_category field via the Mailcow API. The /api/v1/add/mailbox endpoint stores quarantine_category without validation or sanitization. This value is later used by quarantine_notify.py, which constructs SQL queries using unsafe % string formatting instead of parameterized queries. This results in a delayed (second-order) SQL injection when the quarantine notification job executes, allowing an attacker to inject arbitrary SQL. Using a UNION SELECT, sensitive data (e.g., admin credentials) can be exfiltrated and rendered inside quarantine notification emails. Version 2026-03b fixes the vulnerability.
📍 영향받는 시스템
mailcow: dockerized 2026-03b 이전 모든 버전
⚔️ 공격 벡터
/api/v1/add/mailbox 엔드포인트의 quarantine_category 필드에 SQL injection payload를 전송하면 나중에 quarantine_notify.py 실행 시 SQL 명령이 실행됨
🛡️ 대응 방법
mailcow를 버전 2026-03b 이상으로 업그레이드
🔧 검증 코드
표시된 태그가 2026-03b 이상이면 패치됨, 그 이전 버전이면 취약함
docker image ls | grep mailcow | awk '{print $2}'