🇰🇷 한글 설명
@next-auth/upstash-redis-adapter v3.0.2 미만 버전에서 이메일 인증 토큰 검증 시 식별자(이메일)와 토큰을 동시에 확인하지 않는 취약점이 발견되었습니다. 공격자가 피해자의 이메일과 토큰 만료 시간을 알고 있다면 피해자의 계정으로 쉽게 로그인할 수 있습니다.
💡 쉬운 설명
로그인할 때 이메일 주소만 맞으면 유효하지 않은 비밀번호로도 접속이 허용될 수 있는 보안 결함입니다. 공격자가 타인의 이메일 주소를 이용해 해당 사용자로 위장하여 로그인할 위험이 있습니다.
🇺🇸 원문 (English)
`@next-auth/upstash-redis-adapter` is the Upstash Redis adapter for NextAuth.js, which provides authentication for Next.js. Applications that use `next-auth` Email Provider and `@next-auth/upstash-redis-adapter` before v3.0.2 are affected by this vulnerability. The Upstash Redis adapter implementation did not check for both the identifier (email) and the token, but only checking for the identifier when verifying the token in the email callback flow. An attacker who knows about the victim's email could easily sign in as the victim, given the attacker also knows about the verification token's expired duration. The vulnerability is patched in v3.0.2. A workaround is available. Using Advanced Initialization, developers can check the requests and compare the query's token and identifier before proceeding.
📍 영향받는 시스템
@next-auth/upstash-redis-adapter v3.0.2 미만 버전
⚔️ 공격 벡터
피해자의 이메일 주소와 토큰 만료 시간을 이용한 인증 우회 공격
🛡️ 대응 방법
@next-auth/upstash-redis-adapter를 v3.0.2 이상으로 업데이트하거나 고급 초기화 설정을 통해 토큰과 식별자를 직접 비교하도록 수정
🔧 검증 코드
명령어 결과에 버전 번호가 나타나면 취약한 버전이 설치되어 있는 상태입니다.
npm list @next-auth/upstash-redis-adapter 2>/dev/null | grep -E '@next-auth/upstash-redis-adapter@([0-2]\.)'