🇰🇷 한글 설명
Gentoo soko 패키지 관리 시스템의 1.0.1 미만 버전에서 SQL 인젝션 취약점이 발견되었습니다. 공격자가 'search_history' 쿠키 값을 조작하여 SQL 쿼리를 주입할 수 있으며, 이를 통해 데이터베이스를 삭제하거나 내용을 변경하여 서비스 거부(DoS)를 유발할 수 있습니다.
💡 쉬운 설명
웹사이트의 설정 저장용 쿠키 값을 악의적으로 수정하여 데이터베이스를 망가뜨릴 수 있는 보안 약점입니다. 이로 인해 웹사이트의 정보가 지워지거나 정상적인 서비스 이용이 불가능해질 수 있습니다.
🇺🇸 원문 (English)
Gentoo soko is the code that powers packages.gentoo.org. Versions prior to 1.0.1 are vulnerable to SQL Injection, leading to a Denial of Service. If the user selects (in user preferences) the "Recently Visited Packages" view for the index page, the value of the `search_history` cookie is used as a base64 encoded comma separated list of atoms. These are string loaded directly into the SQL query with `atom = '%s'` format string. As a result, any user can modify the browser's cookie value and inject most SQL queries. A proof of concept malformed cookie was generated that wiped the database or changed it's content. On the database, only public data is stored, so there is no confidentiality issues to site users. If it is known that the database was modified, a full restoration of data is possible by performing a full database wipe and performing full update of all components. This issue is patched with commit id 5ae9ca83b73. Version 1.0.1 contains the patch. If users are unable to upgrade immediately, the following workarounds may be applied: (1.) Use a proxy to always drop the `search_history` cookie until upgraded. The impact on user experience is low. (2.) Sanitize to the value of `search_history` cookie after base64 decoding it.
📍 영향받는 시스템
Gentoo soko versions prior to 1.0.1
⚔️ 공격 벡터
사용자 브라우저의 'search_history' 쿠키 값을 조작하여 Base64 인코딩된 SQL 쿼리 주입
🛡️ 대응 방법
soko 버전을 1.0.1 이상으로 업데이트하거나, 프록시를 통해 'search_history' 쿠키를 차단하십시오.
🔧 검증 코드
명령어 실행 결과로 패치 커밋 ID인 5ae9ca83b73가 출력되면 취약점이 해결된 상태입니다.
grep -r '5ae9ca83b73' /path/to/soko/repository || echo 'Patch not found'