All vulnerabilities
CVE-2026-40258GHSA-m5gr-86j6-99jpPYSEC-2026-346

gramps-webapi: Zip Slip Path Traversal in Media Archive Import

gramps-project gramps-webapipipLibraries & packages
CVSS
9.1Critical
ExploitationNo known exploitationNot in CISA KEV, which does not prove it is unexploitedCISA KEV
Exploit odds (EPSS)0.40%Chance of exploitation activity in the next 30 days, higher than 34% of CVEs. Scored 27 Oct 2026FIRST EPSS
Fixed in3.11.1Fixed versionGitHub
Published17 Apr 2026Updated 27 Oct 2026CVE List

What fixes it

  • 3.11.1gramps-webapi, pipGitHub
  • 3.11.1gramps-webapi, PyPIOSVpip install "gramps-webapi>=3.11.1"

A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.

Description

Summary

A path traversal vulnerability (Zip Slip) exists in the media archive import feature. An authenticated user with owner-level privileges can craft a malicious ZIP file with directory-traversal filenames to write arbitrary files outside the intended temporary extraction directory on the server's local filesystem.

Details

When importing media archives as ZIP file, MediaImporter._check_disk_space_and_extract() in gramps_webapi/api/media_importer.py called zipfile.extractall() without validating ZIP entry names. Python's zipfile module does not sanitize entry names containing ../ sequences, allowing extraction to paths outside the target directory.

Only users with owner permission can upload media ZIP archives, so the biggest risk is for multi-tree deployments, where tree owners are distinct from server administrators.

For multi-tree deployments, the impact depends on deployment configuration. Assuming the standard docker-based deployment is used:

  • SQLite family tree + local media: An attacker can overwrite another tree's database file or media files, leading to cross-tree data corruption or replacement.
  • Postgres family tree + S3 media: No persistent tree data is stored on the local filesystem, so cross-tree impact is eliminated. The remaining risk is overwriting volume-mounted files such as the application config file.
  • Postgres family tree + S3 media + environment-variable-only config: No persistent files of value are present on the local filesystem. Impact is limited to writes to ephemeral container storage, which are lost on woker restart.

Fix

ZIP entry names are now validated against the resolved real path of the temporary directory before extraction. Any entry whose resolved path falls outside the temporary directory raises an error and aborts the import.

Text from GitHub Advisory Database

Affected versions 43

  • gramps-webapi, pip>= 1.6.0, <= 3.11.0GitHub
  • gramps-web-apiaffected: >= 1.6.0, < 3.11.1CVE List
  • gramps-webapi, PyPIfrom 1.6.0, fixed in 3.11.1OSV
  • gramps-webapi, PyPI1.6.0OSV
  • gramps-webapi, PyPI2.0.0OSV
  • gramps-webapi, PyPI2.1.0OSV
  • gramps-webapi, PyPI2.2.0OSV
  • gramps-webapi, PyPI2.2.1OSV
  • gramps-webapi, PyPI2.3.0OSV
  • gramps-webapi, PyPI2.3.1OSV
  • gramps-webapi, PyPI2.4.0OSV
  • gramps-webapi, PyPI2.4.1OSV
  • gramps-webapi, PyPI2.4.2OSV
  • gramps-webapi, PyPI2.4.3OSV
  • gramps-webapi, PyPI2.5.0OSV
  • gramps-webapi, PyPI2.5.1OSV
  • gramps-webapi, PyPI2.5.2OSV
  • gramps-webapi, PyPI2.5.3OSV
  • gramps-webapi, PyPI2.6.0OSV
  • gramps-webapi, PyPI2.7.0OSV
  • gramps-webapi, PyPI2.8.0OSV
  • gramps-webapi, PyPI2.8.1OSV
  • gramps-webapi, PyPI2.8.2OSV
  • gramps-webapi, PyPI2.9.0OSV
  • gramps-webapi, PyPI2.9.1OSV
  • gramps-webapi, PyPI2.9.2OSV
  • gramps-webapi, PyPI3.0.0OSV
  • gramps-webapi, PyPI3.0.1OSV
  • gramps-webapi, PyPI3.0.2OSV
  • gramps-webapi, PyPI3.1.0OSV
  • gramps-webapi, PyPI3.10.0OSV
  • gramps-webapi, PyPI3.11.0OSV
  • gramps-webapi, PyPI3.2.0OSV
  • gramps-webapi, PyPI3.3.0OSV
  • gramps-webapi, PyPI3.4.0OSV
  • gramps-webapi, PyPI3.4.1OSV
  • gramps-webapi, PyPI3.5.0OSV
  • gramps-webapi, PyPI3.6.0OSV
  • gramps-webapi, PyPI3.7.0OSV
  • gramps-webapi, PyPI3.7.1OSV
  • gramps-webapi, PyPI3.8.0OSV
  • gramps-webapi, PyPI3.9.0OSV
  • gramps-webapi, PyPI3.9.1OSV

References 7