🇰🇷 한글 설명
Django Two-Factor Authentication 1.12 미만 버전에서 사용자의 비밀번호가 세션에 Base64로 인코딩된 평문 상태로 저장되는 취약점입니다. 2단계 인증을 완료하기 전까지 비밀번호가 세션 저장소(데이터베이스, 캐시, 쿠키 등)에 남아 있어 유출될 위험이 있습니다.
💡 쉬운 설명
로그인 과정 중 2단계 인증을 하기 전까지 사용자의 비밀번호가 암호화되지 않은 채 임시 저장 공간에 남게 되는 문제입니다. 만약 이 저장 공간이 해킹당하면 사용자의 비밀번호가 그대로 노출될 수 있습니다.
🇺🇸 원문 (English)
Django Two-Factor Authentication before 1.12, stores the user's password in clear text in the user session (base64-encoded). The password is stored in the session when the user submits their username and password, and is removed once they complete authentication by entering a two-factor authentication code. This means that the password is stored in clear text in the session for an arbitrary amount of time, and potentially forever if the user begins the login process by entering their username and password and then leaves before entering their two-factor authentication code. The severity of this issue depends on which type of session storage you have configured: in the worst case, if you're using Django's default database session storage, then users' passwords are stored in clear text in your database. In the best case, if you're using Django's signed cookie session, then users' passwords are only stored in clear text within their browser's cookie store. In the common case of using Django's cache session store, the users' passwords are stored in clear text in whatever cache storage you have configured (typically Memcached or Redis). This has been fixed in 1.12. After upgrading, users should be sure to delete any clear text passwords that have been stored. For example, if you're using the database session backend, you'll likely want to delete any session record from the database and purge that data from any database backups or replicas. In addition, affected organizations who have suffered a database breach while using an affected version should inform their users that their clear text passwords have been compromised. All organizations should encourage users whose passwords were insecurely stored to change these passwords on any sites where they were used. As a workaround, wwitching Django's session storage to use signed cookies instead of the database or cache lessens the impact of this issue, but should not be done without a thorough understanding of the security tradeoffs of using signed cookies rather than a server-side session storage. There is no way to fully mitigate the issue without upgrading.
📍 영향받는 시스템
Django Two-Factor Authentication versions before 1.12
⚔️ 공격 벡터
세션 저장소(DB, Redis, Memcached 등)에 대한 접근 권한을 획득하여 저장된 평문 비밀번호 탈취
🛡️ 대응 방법
Django Two-Factor Authentication을 1.12 이상으로 업그레이드하고, 기존 세션에 저장된 평문 비밀번호 데이터를 삭제하십시오.
🔧 검증 코드
출력된 버전 번호가 1.12 미만인지 확인하십시오.
pip show django-two-factor-authentication | grep Version