🇰🇷 한글 설명
team-alembic ash_authentication의 사용자 제어 키에 대한 인가 우회 취약점입니다. 공격자는 자신이 통제하는 TOTP 비밀키를 다른 사용자의 계정에 설치하여 해당 계정으로 로그인하거나 두 번째 인증 수단을 탈취할 수 있습니다. ConfirmSetupChange가 설정 토큰이 해당 레코드에 발급된 것인지 검증하지 않고, TOTP 설정 변경 작업이 정책 우회 대상으로 표시되어 본인 계정 제한 정책이 적용되지 않습니다.
💡 쉬운 설명
공격자가 자신의 2단계 인증 설정을 다른 사람의 계정에 몰래 등록할 수 있는 문제입니다. 이렇게 되면 공격자가 피해자 계정에 들어가거나 2단계 인증을 장악할 수 있습니다.
🇺🇸 원문 (English)
Authorization Bypass Through User-Controlled Key vulnerability in team-alembic ash_authentication allows a user with an account to install a TOTP secret they control on another user's account, and then sign in as that user or hold their second factor.
AshAuthentication.Strategy.Totp.ConfirmSetupChange verified a setup token but did not check that it was issued to the record being confirmed, so an attacker's own pending secret could be confirmed onto another user's record. The TOTP setup changes, ConfirmSetupChange, GeneratePendingSetupChange and GenerateSecretChange, also marked their changesets as AshAuthentication interactions, which the standard AshAuthenticationInteraction policy bypass lets through. A policy limiting setup and confirm_setup to the actor's own record therefore never ran when an application exposed those actions by record key, and a direct setup call on another user's record returned that user's pending secret and setup token.
This issue affects ash_authentication: from 5.0.0-rc.0 before 5.0.0-rc.16.
📍 영향받는 시스템
ash_authentication 5.0.0-rc.0 이상 5.0.0-rc.16 미만을 사용하는 Elixir/Ash 애플리케이션
⚔️ 공격 벡터
계정을 가진 공격자가 자신의 대기 중인 TOTP 비밀키와 설정 토큰을 타인의 레코드 키를 지정해 설정 확인 액션을 호출하여 타인 계정에 등록
🛡️ 대응 방법
ash_authentication을 5.0.0-rc.16 이상으로 업그레이드하고, 설정 및 확인 액션을 본인 레코드로만 제한하는 정책을 적용
🔧 검증 코드
출력된 버전이 5.0.0-rc.0 이상 5.0.0-rc.16 미만이면 취약하며, 5.0.0-rc.16 이상이거나 결과가 없으면 해당 프로젝트에 영향이 없거나 패키지가 설치되지 않은 것입니다.
grep -rE '"ash_authentication"' mix.lock 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?'