gramps-webapi: Zip Slip Path Traversal in Media Archive Import
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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | gramps-webapi | >= 1.6.0, < 3.11.1 | 3.11.1 |
References
- https://github.com/gramps-project/gramps-web-api/security/advisories/GHSA-m5gr-86j6-99jp
- https://nvd.nist.gov/vuln/detail/CVE-2026-40258
- https://github.com/gramps-project/gramps-web-api/commit/3ed4342711e3ec849552df09b1fe2fbf2ca5c29a
- https://github.com/gramps-project/gramps-web-api
- https://github.com/gramps-project/gramps-web-api/releases/tag/v3.11.1
- https://pypi.org/project/gramps-webapi
- https://github.com/advisories/GHSA-m5gr-86j6-99jp
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H- Weakness (CWE)
CWE-22- Platform
- Python (PyPI)
- Package
gramps-webapi- Disclosed
- 10.04.2026
- Updated
- 11.10.2026 14:17
Sources and licenses
OSV / GitHub Advisory Database - GHSA-m5gr-86j6-99jp - CC BY 4.0
OSV / GitHub Advisory Database - PYSEC-2026-346 - PyPA Advisory Database; CC BY 4.0
Vulnerability history: gramps-webapi
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 2
- First → latest
- 04.2026 04.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- Medium 1
Disclosures per year
- 2026: 2
-
gramps-webapi: Zip Slip Path Traversal in Media Archive Import this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.