pyLoad Arbitrary Code Execution via Malicious Session Deserialization
pyLoad is vulnerable to arbitrary code execution via an unprotected `storage_folder` configuration option, allowing an attacker with `SETTINGS` and `ADD` permissions to write a malicious pickle payload to the Flask session store and execute arbitrary code upon subsequent HTTP requests.
pyLoad, a download manager, is susceptible to arbitrary code execution due to an insecure configuration option related to the storage folder. This vulnerability arises from the incomplete fix for CVE-2026-33509. Specifically, the storage_folder option is not included in the ADMIN_ONLY_OPTIONS set, which allows users with SETTINGS and ADD permissions to modify it. By redirecting downloads to the Flask filesystem session store, an attacker can plant a malicious pickle payload as a predictable session file. Subsequently, any HTTP request containing the corresponding crafted session cookie will trigger the deserialization of the payload, resulting in arbitrary code execution. This issue affects pyLoad versions up to and including 0.5.0b3. The observed exploitation involves manipulating the download directory to write malicious files into the Flask session store, ultimately leading to code execution on the host.
Attack Chain
- An attacker gains a non-admin user account with both
SETTINGSandADDpermissions in pyLoad. - The attacker uses the
/api/set_config_valueendpoint to modify thestorage_folderoption, setting its value to the Flask session store directory:/tmp/pyLoad/flask. This bypasses existing path restrictions. - The attacker calculates the target session filename by computing the MD5 hash of the string “session:ATTACKER_SESSION_ID”.
- The attacker hosts a malicious pickle payload (e.g.,
92912f771df217fb6fbfded6705dd47c) on a remote server. - The attacker uses the
/api/add_packageendpoint to add a download package. The download link points to the hosted malicious pickle payload on the attacker’s server:http://attacker.com/92912f771df217fb6fbfded6705dd47c. Thedestparameter specifies where to store the downloaded file. - pyLoad downloads the malicious pickle payload and saves it to the Flask session store directory, naming it according to the MD5 hash calculated earlier.
- The attacker crafts an HTTP request to the pyLoad server, including a cookie named
pyload_session_{port}with the valueATTACKER_SESSION_ID. The port number is derived from the pyLoad configuration. - Upon receiving the request with the crafted cookie, Flask attempts to load the session data from the corresponding file. The
cacheliblibrary deserializes the malicious pickle payload usingpickle.load(), triggering arbitrary code execution.
Impact
Successful exploitation allows a non-admin user with SETTINGS and ADD permissions to achieve arbitrary code execution as the pyload service user. This grants the attacker the ability to execute arbitrary commands, read environment variables (potentially exposing API keys and credentials), access the filesystem (including download history and user databases), and potentially pivot to other network resources. The vulnerability requires no authentication to trigger the final stage of exploitation, increasing its severity and potential impact.
Recommendation
- Deploy the following Sigma rule to detect attempts to modify the
storage_folderconfiguration option to point to the Flask session directory (/tmp/pyLoad/flask):Suspicious pyLoad Storage Folder Modification. - Apply the suggested fix by adding
storage_folderto theADMIN_ONLY_OPTIONSset in the pyLoad configuration to prevent non-admin users from modifying it. - Block the malicious URLs used to deliver the pickle payload, specifically
http://attacker.com/92912f771df217fb6fbfded6705dd47c, at your network perimeter. - Monitor for HTTP requests containing the crafted session cookie (
pyload_session_{port}=ATTACKER_SESSION_ID), using a webserver or proxy log source, as it triggers the final stage of the attack.
Detection coverage 2
Suspicious pyLoad Storage Folder Modification
highDetects attempts to change the pyLoad storage_folder configuration to the Flask session directory, indicative of CVE-2026-35464 exploitation.
pyLoad Malicious Session Cookie Usage
criticalDetects HTTP requests with a pyload session cookie and a request to the root path, potentially indicating deserialization of a malicious session.
Detection queries are kept inside the platform. Get full rules →
Indicators of compromise
1
hash_md5
1
url
| Type | Value |
|---|---|
| url | http://attacker.com/92912f771df217fb6fbfded6705dd47c |
| hash_md5 | 92912f771df217fb6fbfded6705dd47c |