🇰🇷 한글 설명
Gogs의 저장소 및 사용자 검색 API에서 q 파라미터가 적절히 검증되지 않아 SQL injection 취약점이 발생합니다. 공격자는 악의적인 SQL 구문을 주입하여 임의의 SQL 명령어를 실행하고 데이터베이스의 민감한 정보에 접근할 수 있습니다.
💡 쉬운 설명
Gogs 검색 기능에서 특수문자를 포함한 입력값이 검증되지 않아, 공격자가 데이터베이스를 직접 조작할 수 있습니다. 사용자 정보, 저장소 정보, 비밀번호 등 모든 데이터가 유출될 위험이 있습니다.
🇺🇸 원문 (English)
Multiple SQL injection vulnerabilities in Gogs (aka Go Git Service) 0.3.1-9 through 0.5.x before 0.5.6.1105 Beta allow remote attackers to execute arbitrary SQL commands via the q parameter to (1) api/v1/repos/search, which is not properly handled in models/repo.go, or (2) api/v1/users/search, which is not properly handled in models/user.go.
📍 영향받는 시스템
Gogs 0.3.1-9 ~ 0.5.6.1104 Beta
⚔️ 공격 벡터
GET 요청으로 /api/v1/repos/search 또는 /api/v1/users/search에 SQL injection 페이로드를 q 파라미터로 전송
🛡️ 대응 방법
Gogs를 0.5.6.1105 Beta 이상으로 업그레이드하거나, 입력값 검증과 prepared statements를 적용하는 패치 적용
🔧 검증 코드
0.5.6.1105 이상이 출력되면 안전, 0.5.6.1104 이하이면 즉시 업그레이드 필요
gogs --version 2>/dev/null | grep -oE '0\.[0-5]\.[0-6]' || curl -s http://localhost:3000/api/v1/version 2>/dev/null | grep -o '0\.[0-5]\.[0-6]'