🇰🇷 한글 설명
Keycloak의 조직 선택 로그인 페이지에서 저장형 XSS 취약점이 발견되었습니다. manage-realm 또는 manage-organizations 권한을 가진 공격자가 organization.alias 필드에 악성 스크립트를 삽입하여 사용자의 브라우저에서 임의의 자바스크립트를 실행할 수 있습니다.
💡 쉬운 설명
관리자 권한을 가진 사람이 로그인 페이지에 몰래 악성 코드를 심어둘 수 있는 문제입니다. 이 코드가 실행되면 일반 사용자의 로그인 정보가 탈취되거나 계정이 도용될 위험이 있습니다.
🇺🇸 원문 (English)
A flaw was found in Keycloak, specifically in the organization selection login page. A remote attacker with `manage-realm` or `manage-organizations` administrative privileges can exploit a Stored Cross-Site Scripting (XSS) vulnerability. This flaw occurs because the `organization.alias` is placed into an inline JavaScript `onclick` handler, allowing a crafted JavaScript payload to execute in a user's browser when they view the login page. Successful exploitation enables arbitrary JavaScript execution, potentially leading to session theft, unauthorized account actions, or further attacks against users of the affected realm.
📍 영향받는 시스템
Keycloak (조직 선택 로그인 페이지를 사용하는 버전)
⚔️ 공격 벡터
관리자 권한을 이용한 organization.alias 필드에 악성 자바스크립트 삽입 (Stored XSS)
🛡️ 대응 방법
Keycloak 보안 패치 적용 및 관리자 권한(manage-realm, manage-organizations)에 대한 엄격한 통제
🔧 검증 코드
응답 헤더에 X-Content-Type-Options: nosniff 및 적절한 CSP 설정이 포함되어 있는지 확인하여 XSS 방어 여부를 점검합니다.
curl -s -I http://<keycloak-host>/auth/realms/<realm-name>/login-options | grep -i 'X-Content-Type-Options'