CVE-2024-32880
Executive Summary
CVE-2024-32880 is a critical vulnerability in pyload, an open-source Download Manager written in pure Python. An authenticated attacker can exploit this flaw by changing the download folder and uploading a crafted template to that folder, leading to remote code execution (RCE). The vulnerability has a CVSS score of 9.1, indicating a severe risk. No official patch is available at the time of publication, making it a high-priority issue for organizations using pyload.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
pyload is distributed via PyPI and GitHub. Users should verify the integrity of their installations and monitor for any updates from the maintainers. Since no patch is available, consider isolating pyload instances or implementing strict access controls.
CVSS Breakdown & Threat Level
- CVSS Score: 9.1 (Critical)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires authenticated user
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
The threat level is critical due to the low complexity and high impact, allowing an authenticated attacker to execute arbitrary code on the server.
Deep Dive & Mechanics
The vulnerability resides in pyload's template handling mechanism. An authenticated user can modify the download folder configuration and upload a malicious template file (e.g., a Jinja2 template) to that folder. When pyload processes the template, it executes the embedded code, leading to RCE.
Root Cause: Insufficient validation of user-uploaded template files and lack of sandboxing in the template engine.
Attack Flow:
- Attacker authenticates to pyload.
- Attacker changes the download folder to a writable directory.
- Attacker uploads a crafted template file containing malicious code (e.g., Python code in a Jinja2 template).
- pyload processes the template, executing the attacker's code.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
# pyload template processing
def render_template(template_name, context):
template = open(template_name).read()
return render_template_string(template, context)
The code directly reads and renders user-supplied templates without sanitization.
Patched Code (Hypothetical):
# Patched version with sandboxing
from jinja2 import Environment, BaseLoader, TemplateNotFound
class SafeLoader(BaseLoader):
def get_source(self, environment, template):
raise TemplateNotFound(template)
env = Environment(loader=SafeLoader())
def render_template(template_name, context):
# Only allow predefined templates
if not template_name.startswith('allowed_templates/'):
raise PermissionError
return env.get_template(template_name).render(context)
The patched code restricts template loading to a safe directory and uses a custom loader that prevents arbitrary file access.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a pyload instance with valid credentials.
- Ability to change download folder and upload files.
Exploit Steps:
- Log in to pyload.
- Navigate to settings and change the download folder to
/tmp/exploit. - Upload a malicious template file (e.g.,
evil.jinja2) containing:{{ config.__class__.__init__.__globals__['os'].popen('id').read() }} - Trigger the template rendering by accessing a page that uses the template.
Expected Output: The command id executes, and the output is displayed.
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual changes to download folder settings.
- Alert on uploads of template files (
.jinja2,.html, etc.) to non-standard directories. - Use file integrity monitoring to detect unauthorized modifications.
Hardening:
- Restrict user permissions to only necessary functions.
- Disable template upload functionality if not required.
- Implement network segmentation to limit access to pyload.
Indicators of Compromise (IOCs)
- File Hashes: (Example)
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - Network Patterns: POST requests to
/settingsor/uploadwith unusual parameters. - Log Entries:
[INFO] Download folder changed to /tmp/exploitfollowed by[ERROR] Template rendering failed(if detection is in place). - Process Anomalies: Unexpected child processes spawned by pyload (e.g.,
id,whoami).
Detection Engineering
YARA Rule
rule CVE_2024_32880_pyload_RCE {
meta:
description = "Detects malicious template files for CVE-2024-32880"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-32880"
strings:
$s1 = "{{" ascii
$s2 = "{%" ascii
$s3 = "popen" ascii
$s4 = "os." ascii
$s5 = "__globals__" ascii
condition:
any of ($s*) and filesize < 10KB
}
Sigma Rule
title: Pyload Template Upload for RCE
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects upload of template files to pyload that may indicate exploitation of CVE-2024-32880
author: Valters IT
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|endswith:
- '.jinja2'
- '.html'
- '.j2'
Image|endswith: '/pyload'
condition: selection
falsepositives:
- Legitimate template uploads by administrators
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-32880 Pyload Template Upload Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/upload"; http_uri; content:".jinja2"; http_client_body; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable template upload functionality if not required.
- Restrict user permissions to only necessary functions.
- Implement strict input validation for uploaded files.
- Monitor logs for suspicious activity.
Long-term Fix:
- Apply the official patch once released by the vendor.
- Upgrade to a patched version of pyload.
- Consider migrating to an alternative download manager if no patch is forthcoming.
Workaround:
- Use a reverse proxy to block uploads of template files.
- Implement file type whitelisting on the server.
Report generated by Valters IT DevSecOps & CTI Division