Quick answers
- Is CVE-2026-40594 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-40594 being exploited in the wild.
- How severe is CVE-2026-40594?
- Medium severity, with a CVSS score of 4.8, published 21 April 2026.
- Which products and versions are affected?
- pyLoad Next Gen <= 0.5.0b3.dev97; pyload-ng (PyPI) <= 0.5.0b3.dev97, ECOSYSTEM:introduced=0,fixed=0.5.0b3.dev69, ECOSYSTEM:introduced=0,fixed=0.5.0b3.dev98.
- Is there a fix for CVE-2026-40594?
- Yes. pyload-ng (PyPI): upgrade to 0.5.0b3.dev69, 0.5.0b3.dev98 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-40594 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2026-40594?
- Check whether you run pyLoad Next Gen, Pyload-Ng Project Pyload-Ng or pyload-ng (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- pyload-ng (PyPI): upgrade to 0.5.0b3.dev69, 0.5.0b3.dev98 or later
pip install "pyload-ng>=0.5.0b3.dev98"
Technical details
The vulnerability exists in the `set_session_cookie_secure` handler within `src/pyload/webui/app/__init__.py`. The application reads the `X-Forwarded-Proto` header without validation and uses it to mutate the global Flask configuration `SESSION_COOKIE_SECURE`. In the multi-threaded Cheroot WSGI server environment, this creates a race condition. An unauthenticated remote attacker can spoof this header to either force the `Secure` flag to `False` (enabling session hijacking via cleartext transmission behind a proxy) or force it to `True` on plain HTTP deployments (causing browsers to reject cookies and creating a denial-of-service). The issue is fixed in version 0.5.0b3.dev98.
Affected products
- pyLoad pyload-ng <= 0.5.0b3.dev97
Identifiers
- CVE-2026-40594
- GHSA-mp82-fmj6-f22v
- PYSEC-2026-125
Timeline
- 2026-04-14: disclosed
- 2026-04-16: advisory
- 2026-04-16: patched