🇰🇷 한글 설명
Mercurius는 Fastify용 GraphQL 어댑터로, 16.8.0 버전 이전에는 WebSocket을 통한 GraphQL 구독(Subscription) 쿼리에 대해 설정된 queryDepth 제한을 강제하지 못하는 취약점이 있습니다. HTTP 쿼리와 뮤테이션에는 깊이 제한이 적용되지만, 구독 쿼리는 검증 없이 실행되어 재귀적 타입이 포함된 스키마에서 서비스 거부(DoS)를 유발할 수 있습니다.
💡 쉬운 설명
웹사이트의 실시간 알림 기능을 악용하여 아주 복잡하고 깊게 꼬인 요청을 보낼 수 있는 문제입니다. 이로 인해 서버가 과도한 계산을 하느라 멈추거나 마비될 수 있습니다.
🇺🇸 원문 (English)
Mercurius is a GraphQL adapter for Fastify. Prior to version 16.8.0, Mercurius fails to enforce the configured queryDepth limit on GraphQL subscription queries received over WebSocket connections. The depth check is correctly applied to HTTP queries and mutations, but subscription queries are parsed and executed without invoking the depth validation. This allows a remote client to submit arbitrarily deeply nested subscription queries over WebSocket, bypassing the intended depth restriction. On schemas with recursive types, this can lead to denial of service through exponential data resolution on each subscription event. This issue has been patched in version 16.8.0.
📍 영향받는 시스템
Mercurius version < 16.8.0
⚔️ 공격 벡터
WebSocket 연결을 통해 검증되지 않은 깊은 계층의 GraphQL 구독 쿼리 전송
🛡️ 대응 방법
Mercurius를 16.8.0 버전 이상으로 업데이트
🔧 검증 코드
출력된 버전 번호가 16.8.0 미만인지 확인
npm list mercurius | grep mercurius