The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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-40491

CVE-2026-40491: gdown Path Traversal Vulnerability

CVE-2026-40491 is a path traversal flaw in gdown that allows attackers to write files outside intended directories during archive extraction. This article covers technical details, affected versions, and mitigation.

Published: April 23, 2026

CVE-2026-40491 Overview

CVE-2026-40491 is a Path Traversal vulnerability affecting gdown, a popular Google Drive public file and folder downloader library. Versions prior to 5.2.2 are vulnerable to a path traversal attack within the extractall functionality. When extracting a maliciously crafted ZIP or TAR archive, the library fails to sanitize or validate the filenames of the archive members, allowing files to be written outside the intended destination directory. This can potentially lead to arbitrary file overwrite and Remote Code Execution (RCE).

Critical Impact

Attackers can craft malicious archives that, when extracted using vulnerable gdown versions, write files to arbitrary locations on the file system, potentially overwriting critical system files or placing malicious code in executable paths.

Affected Products

  • gdown versions prior to 5.2.2
  • Python applications utilizing vulnerable gdown versions for Google Drive file extraction
  • Systems processing user-supplied or untrusted archives through gdown

Discovery Timeline

  • 2026-04-18 - CVE CVE-2026-40491 published to NVD
  • 2026-04-20 - Last updated in NVD database

Technical Details for CVE-2026-40491

Vulnerability Analysis

This vulnerability is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), commonly known as Path Traversal. The flaw exists in gdown's archive extraction functionality, specifically in how filenames from ZIP and TAR archive members are processed before extraction.

When a user downloads an archive from Google Drive and extracts it using gdown, the library processes each filename within the archive. In vulnerable versions, these filenames are not properly sanitized to prevent directory traversal sequences such as ../ or absolute paths. An attacker can craft a malicious archive containing files with names like ../../../etc/cron.d/malicious or ../../.bashrc, which would be extracted outside the intended destination directory.

The vulnerability requires user interaction—specifically, the victim must download and extract a malicious archive using the vulnerable gdown library. However, given gdown's widespread use in data science workflows and automated pipelines, the impact can be significant.

Root Cause

The root cause is the absence of filename sanitization in the extractall functionality. Prior to version 5.2.2, the library directly used filenames from archive members without validating that the resulting file path remains within the intended extraction directory. Additionally, the _get_filename_from_response function did not properly sanitize filenames obtained from HTTP Content-Disposition headers, allowing special characters, null bytes, and path separators to be processed.

Attack Vector

The attack requires network access and user interaction. An attacker would:

  1. Create a malicious archive (ZIP or TAR) containing files with path traversal sequences in their names
  2. Host the archive on Google Drive or distribute it through other means
  3. Trick a victim into downloading and extracting the archive using a vulnerable version of gdown
  4. Upon extraction, files are written to arbitrary locations based on the traversal paths in the archive

The following patch demonstrates how the vulnerability was fixed by introducing proper filename sanitization:

python
# Security patch - _sanitize_filename function added to gdown/download.py
def _sanitize_filename(filename):
    filename = filename.replace("\\x00", "")
    filename = filename.replace("/", "_").replace("\\", "_").strip()
    if filename in ("", ".", ".."):
        return "_"
    return filename


def _get_filename_from_response(response):
    content_disposition = urllib.parse.unquote(response.headers["Content-Disposition"])

    m = re.search(r"filename\*=UTF-8''(.*)", content_disposition)
    if m:
        return _sanitize_filename(m.groups()[0])

    m = re.search('attachment; filename="(.*?)"', content_disposition)
    if m:
        return _sanitize_filename(m.groups()[0])

    return None

Source: GitHub Commit

Detection Methods for CVE-2026-40491

Indicators of Compromise

  • Files appearing in unexpected directories after archive extraction operations
  • Presence of files with path traversal patterns in extraction logs or audit trails
  • Modified system configuration files, cron jobs, or shell profiles following gdown operations
  • Unexpected executable files in user home directories or system paths

Detection Strategies

  • Monitor file system operations during archive extraction for writes outside expected directories
  • Implement application-level logging that captures filenames being extracted from archives
  • Deploy endpoint detection rules that alert on file creation in sensitive directories following Python process execution
  • Scan installed Python packages for gdown versions prior to 5.2.2 using dependency auditing tools

Monitoring Recommendations

  • Enable file integrity monitoring on critical system directories and user profile configurations
  • Implement network monitoring for downloads of suspicious archive files from cloud storage services
  • Configure process monitoring to track extraction operations involving the gdown library
  • Review pip/conda dependency lists across development and production environments

How to Mitigate CVE-2026-40491

Immediate Actions Required

  • Upgrade gdown to version 5.2.2 or later immediately using pip install --upgrade gdown
  • Audit systems for any signs of exploitation, particularly unexpected file modifications
  • Review any archives recently processed through vulnerable gdown versions
  • Implement application sandboxing to limit file system access during archive extraction operations

Patch Information

The vulnerability has been fixed in gdown version 5.2.2. The patch introduces a _sanitize_filename function that removes null bytes, replaces path separators (/ and \) with underscores, strips whitespace, and handles edge cases like . and .. filenames. This sanitization is applied to filenames obtained from both archive members and HTTP Content-Disposition headers.

Users should upgrade using:

  • pip: pip install gdown>=5.2.2
  • conda: Update to the latest version available in your channel

For more details, see the GitHub Security Advisory and Release Notes for v5.2.2.

Workarounds

  • Avoid processing untrusted archives through gdown until the upgrade is applied
  • Implement wrapper scripts that validate archive contents before extraction
  • Use containerization or sandboxing to isolate gdown extraction operations from sensitive file system areas
  • Manually extract and inspect archive contents using trusted tools before processing
bash
# Upgrade gdown to patched version
pip install --upgrade gdown>=5.2.2

# Verify installed version
pip show gdown | grep Version

# Audit for vulnerable versions across environments
pip list --outdated | grep gdown

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechGdown

  • SeverityMEDIUM

  • CVSS Score6.5

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-22
  • Technical References
  • GitHub Commit Update

  • GitHub Release v5.2.2

  • GitHub Security Advisory GHSA-76hw-p97h-883f
  • Latest CVEs
  • CVE-2025-52479: HTTP.jl & URIs.jl CRLF Injection Flaw

  • CVE-2026-31740: Linux Kernel Race Condition Vulnerability

  • CVE-2026-31743: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31744: Linux Kernel NULL Pointer 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