🇰🇷 한글 설명
MessagePack for C#의 JSON 변환 도우미 기능에서 재귀 호출 시 깊이 제한을 일관되게 적용하지 않는 취약점이 발견되었습니다. 공격자가 조작된 중첩 JSON 데이터를 전송할 경우 프로세스 스택을 고갈시켜 StackOverflowException을 유발하고 애플리케이션을 강제 종료할 수 있습니다.
💡 쉬운 설명
특수한 형태의 복잡한 데이터를 보내 프로그램이 처리 한계를 넘어서게 만들어 컴퓨터 프로그램을 갑자기 꺼지게 만드는 취약점입니다. 마치 끝없이 이어지는 질문을 던져 상대방의 정신을 혼미하게 만드는 것과 비슷합니다.
🇺🇸 원문 (English)
MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, MessagePack-CSharp's JSON conversion helpers contain multiple recursion paths that do not consistently enforce a depth limit. These paths are in the JSON conversion component rather than normal typed MessagePack deserialization. MessagePackSerializer.ConvertFromJson recursively processes nested JSON arrays and objects in FromJsonCore() without consulting MessagePackSecurity.MaximumObjectGraphDepth. TinyJsonReader.ReadNextToken() recursively consumes comma and colon separator characters, allowing even malformed JSON with long separator runs to consume one stack frame per character. MessagePackSerializer.ConvertToJson applies depth checks to arrays and maps, but the typeless extension branch for ext-100 recursively calls ToJsonCore() without applying MessagePackSecurity.DepthStep(ref reader). Each path can allow attacker-controlled input to exhaust the process stack and trigger an uncatchable StackOverflowException instead of failing with a catchable parse or serialization exception. This vulnerability is fixed in 2.5.301 and 3.1.7.
📍 영향받는 시스템
MessagePack-CSharp 2.5.301 미만 및 3.1.7 미만 버전
⚔️ 공격 벡터
깊게 중첩된 JSON 배열이나 객체, 또는 긴 구분자가 포함된 악의적인 JSON 데이터를 전송하여 스택 오버플로우 유발
🛡️ 대응 방법
MessagePack-CSharp 라이브러리를 2.5.301 또는 3.1.7 이상의 최신 버전으로 업데이트
🔧 검증 코드
출력된 MessagePack 라이브러리의 버전이 2.5.301 또는 3.1.7 이상인지 확인합니다.
dotnet list package | grep MessagePack.Cli