🇰🇷 한글 설명
LimeSurvey의 RemoteControl API는 사용자 입력을 직접 SQL 쿼리에 삽입하여 SQL 인젝션 취약점이 존재합니다. 공격자는 이를 통해 데이터베이스의 임의 읽기 및 쓰기가 가능하며, 관리자 계정 탈취나 데이터 파괴 등 심각한 영향을 미칠 수 있습니다.
💡 쉬운 설명
이 취약점은 시스템의 보안 장치를 우회하여 해커가 데이터베이스를 마음대로 조작할 수 있게 만듭니다. 특히 관리자 비밀번호를 변경하거나 중요한 정보를 유출당할 위험이 매우 높습니다.
🇺🇸 원문 (English)
The RemoteControl API methods invite_participants and remind_participants pass a caller-supplied token-ID array into TokenDynamic::findUninvited(), which concatenates the values directly into a tid IN ('...') SQL clause without parameterization or input validation. A remote, authenticated attacker holding the tokens/update permission on a survey can inject a crafted array element to perform SQL injection. Because LimeSurvey configures its PDO connection with emulated prepared statements (emulatePrepare = true) and does not disable MySQL multi-statements, the injection supports stacked queries: the attacker can append arbitrary additional statements (INSERT/UPDATE/DELETE/DROP/CREATE) after the original SELECT. This permits both arbitrary read of any data in the database, such as administrator bcrypt password hashes (lime_users), survey response PII, session records, and global settings, all recoverable via a SLEEP() time-based blind oracle, and arbitrary write/destruction of that data, including directly overwriting the administrator password hash for immediate account takeover or dropping/truncating tables. Reads and writes extend to any schema the application's database user can access. The RemoteControl interface (RPCInterface = json/xml) must be enabled, which is not the default.
📍 영향받는 시스템
LimeSurvey (RemoteControl API 활성화 시)
⚔️ 공격 벡터
인증된 사용자가 RemoteControl API를 통해 조작된 토큰 배열을 전송하여 SQL 인젝션 수행
🛡️ 대응 방법
LimeSurvey를 최신 버전으로 업데이트하고, PDO의 emulatedPrepare 설정을 false로 변경하며 MySQL 다중 문장 실행을 비활성화하십시오.
🔧 검증 코드
명령어 실행 시 'true' 또는 해당 설정이 없으면 취약할 수 있으며, 설정이 'false'로 명시되어 있으면 안전합니다.
grep -r 'emulatePrepare' /path/to/limesurvey/config/ 2>/dev/null | grep -v 'false'