Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40594

CVE-2026-40594: pyLoad Race Condition Vulnerability

CVE-2026-40594 is a race condition vulnerability in pyLoad that allows attackers to manipulate session cookie security flags for other users. This article covers the technical details, affected versions, and mitigation.

Published: April 23, 2026

CVE-2026-40594 Overview

CVE-2026-40594 is a race condition vulnerability in pyLoad, a free and open-source download manager written in Python. The vulnerability exists in the set_session_cookie_secure before_request handler within src/pyload/webui/app/__init__.py. This handler reads the X-Forwarded-Proto header from HTTP requests without validating that requests originate 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 with request_queue_size=512, this creates a race condition where an attacker's request can influence the Secure flag on other users' session cookies.

Critical Impact

Attackers can downgrade session cookie security for users behind TLS proxies or cause session denial-of-service on plain HTTP deployments by manipulating the X-Forwarded-Proto header in a multi-threaded environment.

Affected Products

  • pyLoad versions prior to 0.5.0b3.dev98
  • pyLoad web UI deployments using the Cheroot WSGI server
  • pyLoad instances behind reverse proxies or load balancers

Discovery Timeline

  • 2026-04-21 - CVE CVE-2026-40594 published to NVD
  • 2026-04-22 - Last updated in NVD database

Technical Details for CVE-2026-40594

Vulnerability Analysis

This vulnerability stems from improper origin validation (CWE-346) in pyLoad's session cookie handling mechanism. The set_session_cookie_secure function processes the X-Forwarded-Proto header on every incoming HTTP request without verifying whether the request genuinely originates from a trusted reverse proxy or load balancer.

The fundamental issue is that the handler modifies global Flask configuration state (SESSION_COOKIE_SECURE) based on untrusted client input. In a multi-threaded environment like the Cheroot WSGI server, this creates a Time-of-Check Time-of-Use (TOCTOU) race condition where concurrent requests can interfere with each other's session cookie security settings.

An attacker can exploit this by sending crafted requests with a manipulated X-Forwarded-Proto header set to either http or https. Due to the race condition, this can affect session cookies being set for other legitimate users, potentially:

  1. Downgrading cookie security: Removing the Secure flag from cookies intended for HTTPS connections, making them vulnerable to interception over unencrypted channels
  2. Session denial-of-service: On plain HTTP deployments, toggling the Secure flag can prevent cookies from being sent, effectively breaking session management

Root Cause

The root cause is the combination of two design flaws: trusting the X-Forwarded-Proto header without origin validation, and modifying global configuration state on a per-request basis in a multi-threaded server environment. The request_queue_size=512 setting in Cheroot allows for significant concurrent request processing, amplifying the exploitability of this race condition.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker sends HTTP requests with a spoofed X-Forwarded-Proto header to the pyLoad web UI. Due to the race condition in the multi-threaded server, these malicious requests can influence the SESSION_COOKIE_SECURE setting applied to other users' session cookies being generated concurrently.

The attack mechanism involves exploiting the timing window between when the header is read and when session cookies are set for other users. High request volume increases the probability of successful exploitation.

Detection Methods for CVE-2026-40594

Indicators of Compromise

  • Unusual patterns of X-Forwarded-Proto header values in web server access logs
  • Inconsistent session cookie attributes observed in browser developer tools or network captures
  • User reports of unexpected session terminations or authentication failures
  • High volume of requests from single sources with varying X-Forwarded-Proto values

Detection Strategies

  • Monitor HTTP access logs for requests containing X-Forwarded-Proto headers from non-proxy IP addresses
  • Implement log correlation to identify timing patterns consistent with race condition exploitation attempts
  • Deploy web application firewall (WAF) rules to flag or block requests with suspicious proxy headers from untrusted sources

Monitoring Recommendations

  • Enable detailed logging for the pyLoad web UI including all HTTP headers
  • Set up alerts for anomalous session cookie behavior or unexpected authentication failures
  • Monitor for high-frequency requests to the pyLoad web interface that may indicate exploitation attempts

How to Mitigate CVE-2026-40594

Immediate Actions Required

  • Upgrade pyLoad to version 0.5.0b3.dev98 or later immediately
  • If immediate upgrade is not possible, restrict access to the pyLoad web UI to trusted networks only
  • Configure upstream reverse proxies to strip or normalize X-Forwarded-Proto headers from client requests
  • Review firewall rules to ensure only legitimate proxy servers can forward requests to pyLoad

Patch Information

The vulnerability is fixed in pyLoad version 0.5.0b3.dev98. The fix addresses the improper origin validation by ensuring the X-Forwarded-Proto header is only trusted from validated proxy sources and prevents race conditions in session cookie configuration. For detailed patch information, refer to the GitHub Security Advisory.

Workarounds

  • Deploy pyLoad behind a reverse proxy that strips incoming X-Forwarded-Proto headers and sets them based on actual connection security
  • Restrict network access to the pyLoad web interface using firewall rules or VPN
  • Consider running pyLoad in a single-threaded configuration temporarily, though this may impact performance
bash
# Example nginx configuration to normalize X-Forwarded-Proto
# Add to your nginx server block proxying to pyLoad
proxy_set_header X-Forwarded-Proto $scheme;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRace Condition

  • Vendor/TechPyload

  • SeverityMEDIUM

  • CVSS Score4.8

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-346
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-41133: pyLoad Privilege Escalation Vulnerability

  • CVE-2026-40071: pyLoad Privilege Escalation Vulnerability

  • CVE-2026-35464: pyLoad Download Manager RCE Vulnerability

  • CVE-2026-35463: pyLoad Download Manager RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English