APScheduler
- 4.0.0a3
- 4.0.0a4
- 4.0.0a5
- 4.0.0a6
A remote code execution vulnerability has been identified in the JSONSerializer and CBORSerializer components of APScheduler, affecting all versions in the 3.10.x series and the 4.0.0a5 release. This vulnerability arises from insecure deserialization, where the unmarshal_object function allows arbitrary class instantiation and state injection by dynamically importing modules and invoking __setstate__ on any class available in the Python environment. An attacker can exploit this by sending a specially crafted JSON or CBOR payload to an application that utilizes these serializers.
Exploitation of this vulnerability allows for remote code execution in the context of the scheduler process, by instantiating arbitrary classes and injecting attacker-controlled data into them.
To reproduce this vulnerability, send a JSON or CBOR payload that includes the '_apscheduler_json' key. The value should be an array where the first element is a string reference to a class in the Python environment, and the second element is a dictionary containing the state to be injected. When the payload is deserialized, the JSONSerializer or CBORSerializer will invoke the unmarshal_object function, leading to the execution of the injected state via the class's __setstate__ method.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.