🇰🇷 한글 설명
EPyT-Flow는 물 공급 네트워크의 수압 및 수질 시나리오 데이터를 쉽게 생성하기 위한 Python 패키지입니다. 0.16.1 이전 버전에서 EPyT-Flow의 REST API는 공격자 제어의 JSON 요청 본문을 사용자 지정 역직렬화기(my_load_from_json)를 사용하여 구문 분석합니다. type 필드가 존재할 때 역직렬화기는 공격자가 지정한 모듈/클래스를 동적으로 가져오고 공격자 제공 인수와 함께 인스턴스화합니다. 이는 subprocess.Popen과 같은 위험한 클래스를 호출할 수 있으며 JSON 구문 분석 중에 OS 명령어 실행을 허용합니다. 또한 JSON 파일 로딩에도 영향을 미칩니다. 이 취약점은 0.16.1 버전에서 수정되었습니다.
💡 쉬운 설명
EPyT-Flow 패키지의 REST API에서 JSON 요청 본문을 구문 분석할 때 공격자 제어의 코드를 실행할 수 있는 취약점이 있습니다. 이는 시스템 명령어 실행을 허용하여 심각한 보안 위협을 일으킬 수 있습니다. EPyT-Flow 0.16.1 버전으로 업데이트하여 이 취약점을 해결할 수 있습니다.
🇺🇸 원문 (English)
EPyT-Flow is a Python package designed for the easy generation of hydraulic and water quality scenario data of water distribution networks. Prior to 0.16.1, EPyT-Flow’s REST API parses attacker-controlled JSON request bodies using a custom deserializer (my_load_from_json) that supports a type field. When type is present, the deserializer dynamically imports an attacker-specified module/class and instantiates it with attacker-supplied arguments. This allows invoking dangerous classes such as subprocess.Popen, which can lead to OS command execution during JSON parsing. This also affects the loading of JSON files. This vulnerability is fixed in 0.16.1.
📍 영향받는 시스템
EPyT-Flow 0.16.1 이전 버전
⚔️ 공격 벡터
공격자는 JSON 요청 본문에서 type 필드를 조작하여 시스템 명령어를 실행할 수 있습니다.
🛡️ 대응 방법
EPyT-Flow 0.16.1 버전으로 업데이트하거나 사용자 지정 역직렬화기를 안전한 방법으로 교체하세요.
🔧 검증 코드
로컬 시스템에서 Python을 사용하여 EPyT-Flow 패키지의 버전을 확인합니다. 코드를 실행하기 전에 Python과 pkg_resources가 설치되어 있는지 확인하세요. 코드를 실행하면 EPyT-Flow의 버전을 확인하여 취약점 여부를 판단합니다.
import pkg_resources
try:
version = pkg_resources.get_distribution('EPyT-Flow').version
if version < '0.16.1':
print({"result": "취약", "reason": "EPyT-Flow 버전이 0.16.1 미만"})
else:
print({"result": "양호", "reason": "EPyT-Flow 버전이 0.16.1 이상"})
except pkg_resources.DistributionNotFound:
print({"result": "미설치", "reason": "EPyT-Flow 패키지가 설치되어 있지 않음"})