# CVE-2026-40594: pyLoad: Session Cookie Security Downgrade via Untrusted X-Forwarded-Proto Header Spoofing (Global State Race Condition)

- Severity: Medium 4.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.18%, higher than 7% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-16T01:20:49.000Z
- Modified: 2026-11-11T23:10:00.263Z
- Also known as: GHSA-mp82-fmj6-f22v, PYSEC-2026-125
- Weaknesses: CWE-346
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- pyload pyload: < 0.5.0b3.dev98
- pyload-ng (PyPI): before 0.5.0b3.dev98; before 0.5.0b3.dev69
- pyload-ng_project pyload-ng: before 0.5.0b3.dev69

## Every score

- GitHub_M: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L`
- GitHub: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L`
- PyPA Advisory Database: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L`

## References

- <https://github.com/pyload/pyload/security/advisories/GHSA-mp82-fmj6-f22v> (exploit, evidence, mitigation, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40594> (advisory)
- <https://github.com/pyload/pyload> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2026-125.yaml> (web)

## Sources

- CVE List: [CVE-2026-40594](https://www.cve.org/CVERecord?id=CVE-2026-40594), CVE Terms of Use, modified 2026-04-21
- GitHub Advisory Database: [GHSA-mp82-fmj6-f22v](https://github.com/advisories/GHSA-mp82-fmj6-f22v), CC-BY-4.0, modified 2026-06-08
- NVD: [CVE-2026-40594](https://nvd.nist.gov/vuln/detail/CVE-2026-40594), Public domain, modified 2026-11-11
- PyPA Advisory Database: [PYSEC-2026-125](https://osv.dev/vulnerability/PYSEC-2026-125), CC-BY-4.0, modified 2026-05-20

---

Page: https://cve.day/CVE-2026-40594 · Whole record: https://cve.day/CVE-2026-40594.json · Rebuilt by cve.day 2026-11-25T22:59:19.125Z
