🇰🇷 한글 설명
dataclasses-avroschema 0.38.0부터 0.70.5 버전 사이에서 BaseGenerator.parse_fixed 함수가 고정 타입의 별칭(alias) 값을 생성된 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 interpolates a fixed type's aliases value directly into a generated types.confixed annotation. A list is represented with quoted entries, but a bare string is emitted as an unquoted Python expression and evaluated when the generated module is imported, allowing arbitrary code execution from a crafted schema. Version 0.70.6 fixes the vulnerability by rejecting aliases values that are not lists.
📍 영향받는 시스템
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 2>/dev/null | grep Version