🇰🇷 한글 설명
Kiota는 OpenAPI 기반 HTTP 클라이언트 코드 생성기입니다. 1.29.1 및 1.32.5 이전 버전에서는 -c/--class-name 옵션 없이 kiota generate를 실행할 때 x-ms-kiota-info의 clientClassName과 clientNamespaceName 값을 검증 없이 사용하여, 조작된 OpenAPI 명세가 -o 출력 디렉터리 밖에 파일을 쓰거나 생성된 코드에 임의의 텍스트를 삽입할 수 있었습니다. 1.29.1 및 1.32.5에서 SanitizeClientClassName과 SanitizeClientNamespaceName으로 수정되었습니다.
💡 쉬운 설명
코드 생성 도구가 외부 API 설명서의 이름 값을 검증 없이 믿고 파일 경로와 코드에 그대로 사용하는 문제입니다. 공격자가 만든 설명서를 사용하면 지정한 폴더 밖에 파일이 생성될 수 있습니다.
🇺🇸 원문 (English)
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.5, Kiota emitted x-ms-kiota-info clientClassName and clientNamespaceName values without identifier or path sanitization as both generated client class or namespace names and generated output path components when `kiota generate` ran without -c/--class-name, allowing an attacker-controlled or compromised OpenAPI description to write generated source outside the -o output directory and inject arbitrary text into generated class or namespace declarations. This issue is fixed in version 1.29.1 and 1.32.5 by GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName.
📍 영향받는 시스템
Kiota 1.29.1 미만 및 1.32.5 미만 버전을 사용하는 환경 (kiota generate 실행 시)
⚔️ 공격 벡터
악의적으로 변조된 OpenAPI 명세의 x-ms-kiota-info 값을 통해 경로 조작 및 코드 주입 수행
🛡️ 대응 방법
Kiota를 1.29.1 이상 또는 1.32.5 이상으로 업그레이드하고, 신뢰할 수 없는 OpenAPI 명세는 사용하지 않기
🔧 검증 코드
출력된 버전이 1.29.1 또는 1.32.5 미만이면 취약하며, 이상이면 패치가 적용된 것입니다.
kiota --version 2>/dev/null || dotnet tool list -g 2>/dev/null | grep -i kiota