🇰🇷 한글 설명
MessagePack for C#의 MessagePackReader.TrySkip() 함수가 중첩된 배열이나 맵을 처리할 때 재귀적으로 탐색하면서 깊이 제한을 확인하지 않는 취약점입니다. 이로 인해 MessagePackSecurity.MaximumObjectGraphDepth 설정이 무시되어, 악의적으로 설계된 깊은 구조의 데이터를 처리할 때 StackOverflowException이 발생할 수 있습니다.
💡 쉬운 설명
데이터를 읽는 과정에서 데이터가 얼마나 깊게 겹쳐 있는지 확인하는 안전장치가 작동하지 않는 문제입니다. 공격자가 아주 복잡하게 꼬인 데이터를 보내면 프로그램이 감당하지 못하고 갑자기 꺼져버릴 수 있습니다.
🇺🇸 원문 (English)
MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, MessagePackReader.TrySkip() recursively descends into nested arrays and maps without incrementing the reader depth or calling the configured depth checks. This bypasses MessagePackSecurity.MaximumObjectGraphDepth, the library's documented protection against deeply nested object graphs. Many generated and dynamic formatters call reader.Skip() when they encounter unknown map keys, unknown array members, ignored fields, or data that should be skipped for forward compatibility. A deeply nested value in one of these skipped positions can therefore cause unbounded recursion and an uncatchable StackOverflowException. This vulnerability is fixed in 2.5.301 and 3.1.7.
📍 영향받는 시스템
MessagePack for C# 버전 2.5.301 미만 및 3.1.7 미만
⚔️ 공격 벡터
악의적으로 조작된 깊은 중첩 구조를 가진 MessagePack 데이터를 전송하여 대상 애플리케이션의 스택 오버플로 유도
🛡️ 대응 방법
MessagePack for C# 라이브러리를 2.5.301 또는 3.1.7 이상의 최신 버전으로 업데이트
🔧 검증 코드
출력된 MessagePack 라이브러리의 버전이 2.5.301 또는 3.1.7보다 낮은지 확인
dotnet list package | grep MessagePack