CVE-2024-22416
📋 TL;DR
This CSRF vulnerability in pyLoad allows unauthenticated attackers to make arbitrary API calls via malicious GET requests. It affects all pyLoad instances with the vulnerable API configuration, potentially enabling complete system compromise. The issue stems from missing SameSite cookie protection on session cookies.
💻 Affected Systems
- pyLoad
📦 What is this software?
Pyload Ng by Pyload Ng Project
⚠️ Risk & Real-World Impact
Worst Case
Complete system takeover: attackers could execute arbitrary commands, download malicious files, delete/download user data, or reconfigure the system.
Likely Case
Unauthorized file downloads/uploads, configuration changes, or data exfiltration from the pyLoad instance.
If Mitigated
Limited impact if proper network segmentation and access controls prevent external exploitation.
🎯 Exploit Status
CSRF exploitation requires user interaction (visiting malicious page) but is trivial to implement.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.5.0b3.dev78
Vendor Advisory: https://github.com/pyload/pyload/security/advisories/GHSA-pgpj-v85q-h5fm
Restart Required: Yes
Instructions:
1. Backup pyLoad configuration and data. 2. Stop pyLoad service. 3. Update pyLoad using pip: 'pip install --upgrade pyload-ng'. 4. Verify version: 'pyload --version'. 5. Restart pyLoad service.
🔧 Temporary Workarounds
Disable API Access
allTemporarily disable pyLoad API to prevent exploitation
Edit pyLoad config (typically ~/.pyload/pyload.conf)
Set 'api.enabled' to 'False'
Restart pyLoad service
Network Restriction
allRestrict API access to trusted IPs only
Configure firewall to block external access to pyLoad API port (default: 8000)
Use reverse proxy with IP whitelisting
🧯 If You Can't Patch
- Isolate pyLoad instance behind firewall with strict network access controls
- Implement web application firewall (WAF) with CSRF protection rules
🔍 How to Verify
Check if Vulnerable:
Check if pyLoad version is below 0.5.0b3.dev78 and API is enabled in configuration
Check Version:
pyload --version
Verify Fix Applied:
Verify pyLoad version is 0.5.0b3.dev78 or higher and test API calls require proper authentication
📡 Detection & Monitoring
Log Indicators:
- Unusual API calls from unexpected sources
- GET requests to API endpoints with suspicious parameters
- Configuration changes via API from unauthenticated sources
Network Indicators:
- CSRF attack patterns in web traffic
- API calls originating from web pages rather than direct client connections
SIEM Query:
source="pyload.log" AND ("GET /api/" OR "CSRF" OR "unauthorized")
🔗 References
- https://github.com/pyload/pyload/commit/1374c824271cb7e927740664d06d2e577624ca3e
- https://github.com/pyload/pyload/commit/c7cdc18ad9134a75222974b39e8b427c4af845fc
- https://github.com/pyload/pyload/security/advisories/GHSA-pgpj-v85q-h5fm
- https://github.com/pyload/pyload/commit/1374c824271cb7e927740664d06d2e577624ca3e
- https://github.com/pyload/pyload/commit/c7cdc18ad9134a75222974b39e8b427c4af845fc
- https://github.com/pyload/pyload/security/advisories/GHSA-pgpj-v85q-h5fm