🇰🇷 한글 설명
OpenAPI.NET SDK의 특정 버전에서 중첩된 앵커와 별칭(alias)이 포함된 YAML 문서를 파싱할 때 제어되지 않는 메모리를 소비하는 취약점이 발견되었습니다. 공격자가 정교하게 조작된 YAML 파일을 제공할 경우, 노드 수가 기하급수적으로 증가하여 시스템 메모리를 고갈시키고 프로세스를 강제 종료(DoS)시킬 수 있습니다.
💡 쉬운 설명
악의적으로 만들어진 복잡한 설정 파일을 읽을 때 컴퓨터의 메모리를 순식간에 모두 써버려 프로그램이 멈추게 만드는 공격입니다. 마치 종이 한 장에 적힌 내용을 복사할 때, 복사본이 계속 늘어나서 방 전체를 종이로 가득 채워버리는 것과 같습니다.
🇺🇸 원문 (English)
The OpenAPI.NET SDK contains a useful object model for OpenAPI documents in .NET along with common serializers to extract raw OpenAPI JSON and YAML documents from the model. In Microsoft.OpenApi.Readers versions before 1.6.30 and Microsoft.OpenApi.YamlReader from 2.0.0-preview.11 through 2.11.0 and 3.0.0 through 3.9.0, parsing a YAML OpenAPI document with nested anchors and aliases can consume uncontrolled memory. SharpYaml represents aliases as shared nodes in a small directed acyclic graph, but conversion to independent OpenAPI or System.Text.Json.Nodes.JsonNode trees duplicates every aliased path; without a node-count or nesting-depth limit, N nested anchors referenced k times can require k^N materialized nodes and terminate the process through an out-of-memory condition. The fixed readers bound materialization to 5,000,000 nodes and a nesting depth of 64 by default and report an OpenApiDiagnostic error when a limit is exceeded. This vulnerability is fixed in Microsoft.OpenApi.Readers 1.6.30 and Microsoft.OpenApi.YamlReader 2.12.0 and 3.10.0.
📍 영향받는 시스템
Microsoft.OpenApi.Readers < 1.6.30, Microsoft.OpenApi.YamlReader (2.0.0-preview.11 ~ 2.11.0 및 3.0.0 ~ 3.9.0)
⚔️ 공격 벡터
중첩된 앵커와 별칭을 사용하여 노드 수를 기하급수적으로 늘린 악성 YAML OpenAPI 문서를 시스템에 입력함
🛡️ 대응 방법
Microsoft.OpenApi.Readers 1.6.30 이상 또는 Microsoft.OpenApi.YamlReader 2.12.0/3.10.0 이상 버전으로 업데이트
🔧 검증 코드
출력된 라이브러리 버전이 취약한 버전 범위에 포함되는지 확인합니다.
dotnet list package | grep -E 'Microsoft.OpenApi.Readers|Microsoft.OpenApi.YamlReader'