CVE-2026-40594·Python vulnerability
pyLoad is a free and open-source download manager written in Python. Prior to 0.5.0b3.dev98, the set_session_cookie_secure before_request handler in src/pyload/webui/app/__init__.py reads the X-Forwarded-Proto header from any HTTP request without validating that the request originates from a trusted proxy, then mutates the global Flask configuration SESSION_COOKIE_SECURE on every request. Because pyLoad uses the multi-threaded Cheroot WSGI server (request_queue_size=512), this creates a race condition where an attacker's request can influence the Secure flag on other users' session cookies — either downgrading cookie security behind a TLS proxy or causing a session denial-of-service on plain HTTP deployments. This vulnerability is fixed in 0.5.0b3.dev98.
- Severity
- medium
- Software
- Python
- Fixed in
- 0.5.0b3.dev69
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — in the bottom 1% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
Until: 0.5.0b3.dev69
Fixed in: 0.5.0b3.dev69
How to fix this CVE
Update pyLoad to version 0.5.0b3.dev98 or later to fix a race condition in the session cookie security handler. The vulnerability stems from unvalidated X-Forwarded-Proto header processing in multi-threaded environments, which can allow attackers to manipulate session cookie security flags. Apply this patch immediately if you are running pyLoad behind a proxy or in any production environment.
sudo dnf update python3-pyloadDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST|GET.*X-Forwarded-Proto.*(http|https).*SESSION_COOKIE_SECURE|Multiple requests with conflicting X-Forwarded-Proto values within 100ms from the same or different IPsWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Implement WAF rules to validate and restrict X-Forwarded-Proto headers to known trusted proxy IPs only. Drop or rewrite any X-Forwarded-Proto headers originating from non-trusted sources. Additionally, enforce strict rate limiting on requests with varying X-Forwarded-Proto values from the same client IP.How to check if you are affected
- Step 1: Check the installed pyLoad version by running: python3 -m pip show pyload | grep Version
- Step 2: Verify if pyLoad is running behind a reverse proxy by checking your web server configuration (nginx/Apache) for proxy_set_header X-Forwarded-Proto directives
- Step 3: Search your pyLoad and web server logs for multiple X-Forwarded-Proto header variations in quick succession, which may indicate header injection attempts: grep -i 'X-Forwarded-Proto' /var/log/pyload/*.log /var/log/nginx/access.log
- Step 4: Confirm the fix by verifying the installed version is 0.5.0b3.dev98 or higher: python3 -m pip show pyload | grep Version | awk '{print $2}' and check if it matches or exceeds the patched version
FAQ
What is CVE-2026-40594?
CVE-2026-40594 is a race condition vulnerability in pyLoad's session cookie handler that fails to validate the origin of X-Forwarded-Proto headers. This allows attackers to manipulate session cookie security flags across concurrent requests in multi-threaded deployments, potentially downgrading HTTPS cookie security or causing session denial-of-service.
Is CVE-2026-40594 being actively exploited?
No, this vulnerability is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploit code is available. However, the attack is theoretically feasible and should be patched promptly.
What versions of Python are affected by CVE-2026-40594?
The vulnerability affects pyLoad versions prior to 0.5.0b3.dev98. All deployments running pyLoad 0.5.0b3.dev69 and earlier are vulnerable, regardless of the Python version installed.
How do I check if my server is vulnerable to CVE-2026-40594?
Run 'python3 -m pip show pyload | grep Version' and compare the version string. If it is below 0.5.0b3.dev98, your system is vulnerable. Additionally, check if pyLoad is exposed to untrusted network access or running behind a proxy.
Does Defensia detect CVE-2026-40594?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If pyLoad is installed on a monitored server, CVE-2026-40594 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-40594. Free for 1 server.
Get started free