🇰🇷 한글 설명
Statamic CMS의 AugmentedUser::get() 메서드에서 2단계 인증(2FA) 복구 코드가 적절한 접근 제한 없이 노출되는 취약점이 발견되었습니다. 해당 필드가 보안 가드 리스트에서 누락되어 있어, 동적 Antlers 템플릿 렌더링이 활성화된 경우 사용자의 복구 코드가 HTML 응답에 직접 출력될 수 있습니다.
💡 쉬운 설명
웹사이트 관리 도구의 설정 오류로 인해 사용자의 2단계 인증을 무력화할 수 있는 비밀 복구 코드가 화면에 노출될 수 있는 문제입니다. 공격자가 이 코드를 탈취하면 사용자의 계정을 안전하게 해킹할 수 있습니다.
🇺🇸 원문 (English)
Statamic CMS's user-augmentation resolver, AugmentedUser::get() in src/Auth/AugmentedUser.php, contains an explicit case for the `two_factor_recovery_codes` handle that returns the user's raw two-factor recovery codes with no access restriction: `if ($handle === 'two_factor_recovery_codes') { return new Value($this->data->get('two_factor_recovery_codes'), ...); }`. Unlike sensitive fields such as password/password_hash, which are excluded from AugmentedUser entirely, two_factor_recovery_codes is neither excluded from augmentation nor present in Statamic's Antlers variable guard lists (guardedVariablePatterns/guardedContentVariablePatterns in src/Providers/ViewServiceProvider.php, and the runtime GlobalRuntimeState guard paths), which by default only guard config.app.key. On any Antlers template field where raw/dynamic template rendering is enabled for a given field (an admin/developer-configured, blueprint-level field option), a template such as `{{ current_user.two_factor_recovery_codes }}{{ value }}|{{ /current_user.two_factor_recovery_codes }}` renders the viewing user's own 2FA recovery codes directly into the HTML response, allowing an attacker who can view or capture that response (e.g. via a shared/observable page, or a crafted link causing a victim to render it) to obtain the codes and bypass 2FA. Exploitation requires that dynamic Antlers rendering already be enabled on a field the target user's data flows through, which is a blueprint-configuration privilege rather than a standard content-editing permission.
📍 영향받는 시스템
Statamic CMS (AugmentedUser 클래스 및 Antlers 템플릿 엔진 사용 버전)
⚔️ 공격 벡터
동적 렌더링이 활성화된 Antlers 템플릿을 통해 사용자의 2FA 복구 코드를 HTML 응답으로 추출
🛡️ 대응 방법
two_factor_recovery_codes 필드를 AugmentedUser 제외 목록에 추가하고, Antlers 변수 가드 리스트에 등록하여 접근을 차단해야 합니다.
🔧 검증 코드
명령어 결과에서 해당 필드가 조건문 없이 Value 객체로 반환되는 코드가 확인되면 취약한 상태입니다.
grep -r 'two_factor_recovery_codes' src/Auth/AugmentedUser.php