🇰🇷 한글 설명
dataclasses-avroschema 0.38.0부터 0.70.5 버전 사이에서 BaseGenerator.parse_fixed 함수가 고정 타입의 네임스페이스 값을 이스케이프 처리 없이 생성합니다. 공격자가 조작된 따옴표를 포함한 네임스페이스를 제공하면 Python이 생성된 클래스를 정의할 때 임의의 코드를 실행할 수 있습니다.
💡 쉬운 설명
프로그램이 자동으로 코드를 만들어내는 과정에서 사용자의 입력값을 제대로 검사하지 않아 발생하는 문제입니다. 악의적인 코드가 포함된 데이터를 넣으면 컴퓨터가 해당 코드를 명령어로 착각해 실행해버릴 수 있습니다.
🇺🇸 원문 (English)
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.38.0 through 0.70.5, BaseGenerator.parse_fixed inserts a fixed type's namespace value between quotes inside a generated types.confixed annotation without escaping or validating it. A crafted quote can terminate the namespace string and alter the surrounding annotation expression, which Python evaluates when the generated class is defined, allowing arbitrary code execution. Version 0.70.6 fixes the vulnerability by requiring the namespace to be a dot-separated sequence of valid Avro names.
📍 영향받는 시스템
dataclasses-avroschema version 0.38.0 through 0.70.5
⚔️ 공격 벡터
조작된 따옴표가 포함된 Avro 네임스페이스 값을 입력하여 Python 코드 실행 유도
🛡️ 대응 방법
dataclasses-avroschema를 0.70.6 이상의 버전으로 업데이트
🔧 검증 코드
출력된 버전이 0.70.5 이하이면 취약한 상태이며, 0.70.6 이상이면 안전합니다.
pip show dataclasses-avroschema | grep Version