🇰🇷 한글 설명
Gitea에서 write:user 권한을 가진 토큰을 사용하여 공격자가 제어하는 SSH 공개 키를 사용자 계정에 등록할 수 있는 취약점입니다. HTTP Signature 인증 과정에서 토큰의 범위(scope) 정보가 누락되어, 결과적으로 권한이 제한된 토큰이 계정의 모든 권한을 사용하는 무제한 인증 수단으로 변질될 수 있습니다.
💡 쉬운 설명
사용자 권한만 가진 열쇠를 이용해 공격자가 자신의 열쇠를 사용자 계정에 몰래 등록할 수 있는 문제입니다. 이렇게 등록된 공격자의 열쇠는 마치 관리자 권한처럼 계정의 모든 기능을 마음대로 사용할 수 있게 만듭니다.
🇺🇸 원문 (English)
Gitea allows a token with write:user scope to register an attacker-controlled SSH public key on the token owner's account. API requests signed with the corresponding private key authenticate as that account through HTTP Signature without API token scope information, causing route-level token scope checks to be skipped. This converts a user-scoped token into an unscoped API authentication method while retaining the account's normal role and repository permissions.
📍 영향받는 시스템
Gitea (취약한 버전의 HTTP Signature 인증 구현 버전)
⚔️ 공격 벡터
write:user 권한이 있는 토큰을 이용해 SSH 키를 등록한 후, HTTP Signature를 통해 권한 검사를 우회하여 공격 수행
🛡️ 대응 방법
Gitea를 최신 보안 패치가 적용된 버전으로 업데이트하고, 불필요한 write:user 권한 토큰 사용을 제한하십시오.
🔧 검증 코드
해당 API 호출 시 HTTP Signature 인증을 통한 권한 우회 여부를 테스트하여 패치 적용 상태를 확인합니다.
curl -s -I http://<gitea-instance>/api/v1/user | grep -i 'HTTP/1.1'