🇰🇷 한글 설명
Hot Chocolate GraphQL 서버의 Utf8GraphQLParser에서 재귀 깊이 제한이 없어 발생하는 취약점입니다. 공격자가 정교하게 설계된 중첩된 GraphQL 문서를 전송하면 StackOverflowException이 발생하여 .NET 프로세스가 즉시 종료됩니다. 이는 검증 단계 이전에 발생하므로 기존의 보안 규칙이나 복잡도 분석기로는 방어가 불가능합니다.
💡 쉬운 설명
서버가 처리할 수 있는 한계를 넘어서는 복잡한 요청을 보내 서버를 강제로 꺼지게 만드는 공격입니다. 서버가 갑자기 종료되어 서비스가 중단될 수 있는 위험한 상태입니다.
🇺🇸 원문 (English)
Hot Chocolate is an open-source GraphQL server. Prior to versions 12.22.7, 13.9.16, 14.3.1, and 15.1.14, Hot Chocolate's recursive descent parser `Utf8GraphQLParser` has no recursion depth limit. A crafted GraphQL document with deeply nested selection sets, object values, list values, or list types can trigger a `StackOverflowException` on payloads as small as 40 KB. Because `StackOverflowException` is uncatchable in .NET (since .NET 2.0), the entire worker process is terminated immediately. All in-flight HTTP requests, background `IHostedService` tasks, and open WebSocket subscriptions on that worker are dropped. The orchestrator (Kubernetes, IIS, etc.) must restart the process. This occurs before any validation rules run — `MaxExecutionDepth`, complexity analyzers, persisted query allow-lists, and custom `IDocumentValidatorRule` implementations cannot intercept the crash because `Utf8GraphQLParser.Parse` is invoked before validation. The `MaxAllowedFields=2048` limit does not help because the crashing payloads contain very few fields. The fix in versions 12.22.7, 13.9.16, 14.3.1, and 15.1.14 adds a `MaxAllowedRecursionDepth` option to `ParserOptions` with a safe default, and enforces it across all recursive parser methods (`ParseSelectionSet`, `ParseValueLiteral`, `ParseObject`, `ParseList`, `ParseTypeReference`, etc.). When the limit is exceeded, a catchable `SyntaxException` is thrown instead of overflowing the stack. There is no application-level workaround. `StackOverflowException` cannot be caught in .NET. The only mitigation is to upgrade to a patched version. Operators can reduce (but not eliminate) risk by limiting HTTP request body size at the reverse proxy or load balancer layer, though the smallest crashing payload (40 KB) is well below most default body size limits and is highly compressible (~few hundred bytes via gzip).
📍 영향받는 시스템
Hot Chocolate versions prior to 12.22.7, 13.9.16, 14.3.1, and 15.1.14
⚔️ 공격 벡터
매우 깊게 중첩된 선택 세트, 객체 값 또는 리스트 타입을 포함한 40KB 미만의 특수 제작된 GraphQL 문서 전송
🛡️ 대응 방법
패치된 버전(12.22.7, 13.9.16, 14.3.1, 15.1.14 이상)으로 즉시 업그레이드
🔧 검증 코드
출력된 HotChocolate의 버전이 취약점이 해결된 버전(12.22.7, 13.9.16, 14.3.1, 15.1.14 이상)인지 확인합니다.
dotnet list package | grep HotChocolate
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
💻 영향받는 소프트웨어
IBM WebSphere Application Server