🇰🇷 한글 설명
YesWiki의 ApiController::deletePage() 함수에서 페이지 태그를 SQL 쿼리에 삽입할 때 이스케이프 처리를 하지 않아 발생하는 SQL 인젝션 취약점입니다. 공격자는 특수 문자가 포함된 태그를 생성하여 데이터베이스 내 임의의 SQL 명령을 실행하거나 데이터를 탈취할 수 있습니다.
💡 쉬운 설명
웹사이트의 특정 기능을 이용해 데이터베이스에 몰래 명령어를 입력하여 정보를 빼내는 보안 약점입니다. 권한이 낮은 사용자라도 데이터베이스의 중요한 정보를 훔쳐갈 수 있어 위험합니다.
🇺🇸 원문 (English)
YesWiki is a wiki system written in PHP. From version 4.2.0 to before version 4.6.6, ApiController::deletePage() interpolates a page tag retrieved from the database into a DELETE FROM …_links WHERE to_tag = '$tag' query without escaping. The page tag is attacker-controlled — the POST /api/pages/{tag} API accepts arbitrary URL-encoded values, including single quotes, and stores them. A low-privilege authenticated user can therefore create a page whose tag is a SQL fragment, make the page non-orphaned via the standard {{include page="…"}} link mechanism, and then invoke the delete endpoint to execute arbitrary SQL inside the wiki database - including time-based blind data exfiltration from any table. This issue has been patched in version 4.6.6.
📍 영향받는 시스템
YesWiki 버전 4.2.0 ~ 4.6.5
⚔️ 공격 벡터
POST /api/pages/{tag} API를 통해 조작된 태그를 생성한 후 삭제 엔드포인트를 호출하여 SQL 인젝션 실행
🛡️ 대응 방법
YesWiki를 최신 보안 패치가 적용된 버전 4.6.6 이상으로 업데이트하십시오.
🔧 검증 코드
설치된 YesWiki의 버전이 4.2.0에서 4.6.5 사이인지 확인하여 취약 여부를 판단합니다.
php -r 'echo "YesWiki version check";' | grep -i '4\.[2-6]\.'