Описание
BentoML Allows Remote Code Execution (RCE) via Insecure Deserialization
Summary
A Remote Code Execution (RCE) vulnerability caused by insecure deserialization has been identified in the latest version(v1.4.2) of BentoML. It allows any unauthenticated user to execute arbitrary code on the server.
Details
It exists an unsafe code segment in serde.py:
Through data flow analysis, it is confirmed that the payload content is sourced from an HTTP request, which can be fully manipulated by the attack. Due to the lack of validation in the code, maliciously crafted serialized data can execute harmful actions during deserialization.
PoC
Environment:
- Server host:
- IP: 10.98.36.123
- OS: Ubuntu
- Attack host:
- IP: 10.98.36.121
- OS: Ubuntu
- Follow the instructions on the BentoML official README(https://github.com/bentoml/BentoML) to set up the environment.
1.1 Install BentoML (Server host: 10.98.36.123) :
pip install -U bentoml
1.2 Define APIs in a service.py file (Server host: 10.98.36.123) :
1.3 Run the service code (Server host: 10.98.36.123) :
-
Start nc listening on the attacking host (Attack host: 10.98.36.121) :
nc -lvvp 1234 -
Send maliciously crafted request (Attack host: 10.98.36.121) :
- Attack success (Attack host: 10.98.36.121) :
The server host(10.98.36.123) has connected to the attacker's host(10.98.36.121) listening on port 1234.
Impact
Remote Code Execution (RCE).
Пакеты
bentoml
>= 1.3.4, < 1.4.3
1.4.3
Связанные уязвимости
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. A Remote Code Execution (RCE) vulnerability caused by insecure deserialization has been identified in the latest version (v1.4.2) of BentoML. It allows any unauthenticated user to execute arbitrary code on the server. It exists an unsafe code segment in serde.py. This vulnerability is fixed in 1.4.3.
Уязвимость компонента serde.py библиотеки BentoML, позволяющая нарушителю выполнить произвольный код на сервере