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.
A custom JSON deserializer (my_load_from_json) handles a 'type' field in the request body. When this field is present, the deserializer dynamically imports the module and class specified by the attacker, then instantiates them with the arguments provided by the attacker. This allows invocation of unsafe system classes, such as subprocess.Popen, leading to execution of arbitrary system commands at the JSON parsing stage. The vulnerability affects both REST API requests and JSON file loading by the application.
An attacker without any authentication can remotely execute arbitrary system commands on the server, leading to complete system compromise, data leakage, and potential lateral movement within the network.
The EPyT-Flow package must be immediately updated to version 0.16.1 or newer, in which the vulnerability has been removed. The package is available at: https://github.com/WaterFutures/EPyT-Flow/releases/tag/v0.16.1
Python package EPyT-Flow (Waterfutures) in all versions prior to 0.16.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HWaterfutures Epyt Flow
APPWaterfutures< 0.16.1