🇰🇷 한글 설명
Gogs 오픈소스 Git 서비스의 0.14.3 미만 버전에서 발생하는 저장형 XSS 취약점입니다. .ipynb 파일 미리보기 시 클라이언트 측에서 마크다운 렌더링 과정 중 sanitization이 누락되어, 공격자가 삽입한 javascript: 스킴을 포함한 링크가 실행될 수 있습니다.
💡 쉬운 설명
공격자가 만든 특수한 파일을 열어 링크를 클릭하면, 사용자의 브라우저에서 악성 코드가 몰래 실행될 수 있는 보안 약점입니다. 이로 인해 사용자의 계정 정보가 탈취되거나 원치 않는 동작이 수행될 수 있습니다.
🇺🇸 원문 (English)
Gogs is an open source self-hosted Git service. Prior to 0.14.3, although .ipynb previews are sanitized on the server side via /-/api/sanitize_ipynb, the inserted content is re-rendered on the client side without sanitization using marked() on elements with the .nb-markdown-cell class. During this process, links containing schemes such as javascript: can be regenerated. As a result, when a victim views an attacker-crafted .ipynb file and clicks the link, arbitrary JavaScript is executed in the Gogs origin, leading to a click-based Stored XSS. This vulnerability is fixed in 0.14.3.
📍 영향받는 시스템
Gogs versions prior to 0.14.3
⚔️ 공격 벡터
공격자가 조작된 .ipynb 파일을 업로드하고, 피해자가 해당 파일의 특정 링크를 클릭하도록 유도함
🛡️ 대응 방법
Gogs를 최신 버전인 0.14.3 이상으로 업데이트하십시오.
🔧 검증 코드
명령어 결과로 버전 정보가 출력되면 취약한 버전이 설치되어 있는 상태입니다.
curl -s http://<GOGS_HOST>/api/version | grep -E '0\.[0-9]+\.[0-9]+' | awk '$1 < "0.14.3"'