🇰🇷 한글 설명
Emlog 웹사이트 빌딩 시스템 2.6.26 및 이전 버전에서 AI 어시스턴트의 execute_tool 기능에 CSRF 보호가 누락되어 발생합니다. 공격자는 관리자의 세션을 악용하여 데이터베이스의 모든 테이블을 읽거나 blog 테이블을 제외한 모든 테이블을 수정할 수 있으며, 이를 통해 관리자 계정을 탈취할 수 있습니다.
💡 쉬운 설명
관리자가 로그인한 상태에서 공격자가 만든 악성 링크를 클릭하면, 관리자 몰래 웹사이트의 데이터베이스를 조작할 수 있는 보안 결함입니다. 이로 인해 해커가 관리자 권한을 뺏어 사이트를 완전히 장악할 위험이 있습니다.
🇺🇸 원문 (English)
Emlog is an open source website building system. In 2.6.26 and earlier, missing CSRF protection on the AI Assistant execute_tool action in admin/ai.php lets a remote unauthenticated attacker submit a forged cross-site request from an attacker-controlled page to a recently logged-in administrator. The authentication cookie set in include/lib/loginauth.php has no explicit SameSite attribute, enabling Chrome's temporary Lax+POST grace window. The query_database case passes attacker-controlled sql and confirm_code values to Ai::queryDatabase in include/service/ai.php; read queries need no confirmation, write queries accept the public confirm string, only the blog table is write-protected, and aliasing password as pwd_hash bypasses output redaction. A successful request can read every database table and write every table except blog, including changing the user table to take over an administrator account. No fixed version is available as of this review.
📍 영향받는 시스템
Emlog 2.6.26 및 그 이전 모든 버전
⚔️ 공격 벡터
CSRF(사이트 간 요청 위조)를 통한 관리자 권한의 데이터베이스 쿼리 실행
🛡️ 대응 방법
현재 고정된 버전이 없으므로, SameSite 속성을 적용한 쿠키 설정 및 AI 어시스턴트 기능에 대한 CSRF 토큰 검증 로직을 직접 구현해야 합니다.
🔧 검증 코드
해당 파일 내에 execute_tool 액션과 데이터베이스 쿼리 처리 로직이 존재하는지 확인하여 취약 여부를 판단합니다.
grep -r "execute_tool" admin/ai.php include/service/ai.php 2>/dev/null