🇰🇷 한글 설명
Reflex 라이브러리의 /auth-codespace 엔드포인트가 redirect_to 쿼리 파라미터를 검증 없이 직접 사용하여 임의의 외부 URL로 사용자를 자동 리다이렉트할 수 있습니다. GitHub Codespaces 환경뿐만 아니라 GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN 환경 변수 설정 시 프로덕션 환경에서도 발생 가능합니다.
💡 쉬운 설명
Reflex 웹 라이브러리가 사용자를 보낼 주소를 제대로 검증하지 않아 공격자가 악의적인 웹사이트로 사용자를 보낼 수 있습니다. GitHub Codespaces나 특정 환경 변수가 설정된 경우에만 발생합니다.
🇺🇸 원문 (English)
Reflex is a library to build full-stack web apps in pure Python. In versions 0.5.4 through 0.8.14, the /auth-codespace endpoint automatically assigns the redirect_to query parameter value directly to client-side links without any validation and triggers automatic clicks when the page loads in a GitHub Codespaces environment. This allows attackers to redirect users to arbitrary external URLs. The vulnerable route is only registered when a Codespaces environment is detected, and the detection is controlled by environment variables. The same behavior can be activated in production if the GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN environment variable is set. The vulnerability occurs because the code assigns the redirect_to query parameter directly to a.href without any validation and immediately triggers a click (automatic navigation), allowing users to be sent to arbitrary external domains. The execution condition is based on the presence of a sessionStorage flag, meaning it triggers immediately on first visits or in incognito/private browsing windows, with no server-side origin/scheme whitelist or internal path enforcement defenses in place. This issue has been patched in version 0.8.15. As a workaround, users can ensure that GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN is not set in a production environment.
📍 영향받는 시스템
Reflex 0.5.4 ~ 0.8.14 (0.8.15에서 패치됨)
⚔️ 공격 벡터
/auth-codespace 엔드포인트의 redirect_to 파라미터에 악의적 URL을 포함하여 페이지 로드 시 자동 리다이렉트 유발
🛡️ 대응 방법
Reflex를 0.8.15 이상으로 업그레이드하거나 프로덕션 환경에서 GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN 환경 변수 미설정 확인
🔧 검증 코드
0.8.15 이상이면 안전, 0.8.14 이하면 패치 필요
python -c "import reflex; print(reflex.__version__)"