🇰🇷 한글 설명
Rocket.Chat의 CAS 로그인 핸들러가 클라이언트가 전달한 options.cas.credentialToken 값을 런타임 타입 검사 없이 MongoDB findOne 쿼리에 그대로 전달합니다. 인증되지 않은 공격자가 이 값을 MongoDB 연산자 객체로 바꿔 넣어 CAS 티켓 검증을 우회하고, 진행 중인 SSO 로그인의 자격 증명 토큰을 가로채 피해자(관리자 포함) 명의의 인증 토큰을 획득할 수 있습니다.
💡 쉬운 설명
공격자가 채팅 서버의 로그인 확인 과정을 속여 다른 사람의 로그인 권한을 빼앗을 수 있는 취약점입니다. 관리자 계정이 탈취되면 서버 전체가 장악될 수 있습니다.
🇺🇸 원문 (English)
Rocket.Chat is an open-source, secure, fully customizable communications platform. Prior to 8.5.0, 8.4.1, 8.3.3, 8.2.3, 8.1.4, 8.0.5, 7.13.7, and 7.10.11, Rocket.Chat's CAS login handler forwards the client-supplied options.cas.credentialToken value straight into a MongoDB findOne({_id: ...}) query without any runtime type check. TypeScript's string parameter annotation is erased at runtime, so an unauthenticated attacker can substitute a MongoDB query operator ({"$gt": ""}, {"$ne": null}, etc.) for what the server expects to be an opaque ticket string. The injected operator matches the first unexpired document in the credential_tokens collection, bypassing the CAS ticket check entirely. When any legitimate CAS or SAML SSO login is in flight, the attacker's next DDP login call matches the same credential-token row via the NoSQL operator and is issued a full Meteor auth token (userId + token) bound to the victim. The token is immediately usable against the complete REST and DDP surface as that user. If the victim is an administrator, this escalates to full instance compromise via Apps-Engine app install. This vulnerability is fixed in 8.5.0, 8.4.1, 8.3.3, 8.2.3, 8.1.4, 8.0.5, 7.13.7, and 7.10.11.
📍 영향받는 시스템
Rocket.Chat 8.5.0 미만, 8.4.1 미만, 8.3.3 미만, 8.2.3 미만, 8.1.4 미만, 8.0.5 미만, 7.13.7 미만, 7.10.11 미만 버전 (CAS/SAML SSO 사용 환경)
⚔️ 공격 벡터
인증되지 않은 공격자가 로그인 요청의 credentialToken 값을 MongoDB 연산자(예: {"$ne": null})로 조작해 전송하여 피해자의 진행 중인 SSO 로그인 토큰을 탈취
🛡️ 대응 방법
Rocket.Chat을 8.5.0, 8.4.1, 8.3.3, 8.2.3, 8.1.4, 8.0.5, 7.13.7, 7.10.11 등 해당 브랜치의 패치 버전으로 업데이트
🔧 검증 코드
출력된 버전이 해당 브랜치의 패치 버전(예: 8.5.0 이상, 8.4.x는 8.4.1 이상 등) 이상이면 패치 완료이고, 그보다 낮으면 취약한 상태입니다.
rocketchat-version=$(grep -o '"version":"[^"]*"' /opt/Rocket.Chat/package.json 2>/dev/null | head -1); echo "$rocketchat-version"