🇰🇷 한글 설명
zrok 2.0.1 이전 버전의 proxyUi 템플릿 엔진이 HTML 이스케이핑을 수행하지 않는 text/template을 사용. GitHub OAuth 콜백에서 공격자 제어 refreshInterval 쿼리 파라미터를 검증 없이 에러 메시지에 포함시켜 XSS 공격 가능.
💡 쉬운 설명
zrok 로그인 후 링크에 숨겨진 JavaScript 코드를 실행할 수 있는 보안 문제. 2.0.1 버전으로 업데이트하면 해결됨.
🇺🇸 원문 (English)
zrok is software for sharing web services, files, and network resources. Prior to version 2.0.1, the proxyUi template engine uses Go's text/template (which performs no HTML escaping) instead of html/template. The GitHub OAuth callback handlers in both publicProxy and dynamicProxy embed the attacker-controlled refreshInterval query parameter verbatim into an error message when time.ParseDuration fails, and render that error unescaped into HTML. An attacker can deliver a crafted login URL to a victim; after the victim completes the GitHub OAuth flow, the callback page executes arbitrary JavaScript in the OAuth server's origin. Version 2.0.1 patches the issue.
⚔️ 공격 벡터
공격자가 조작된 GitHub OAuth 콜백 URL을 피해자에게 제공하여 refreshInterval 파라미터에 JavaScript 코드 삽입
🛡️ 대응 방법
zrok을 2.0.1 이상 버전으로 업데이트
🔧 검증 코드
출력된 버전이 2.0.1 이상이면 안전함. 2.0.1 미만이거나 zrok not found면 취약함.
zrok version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo 'zrok not found'