Loading...
Skip to main content

CVE-2026-40258 — gramps-webapi: Zip Slip Path Traversal in...

CRITICAL

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

Published April 10, 2026Updated June 29, 2026Source: osv

Summary

## 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.

Advisory Timeline

  • First published April 10, 2026 (185 days ago).
  • Last revised June 29, 2026 — 80 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

pip
Update gramps-webapi to 3.11.1 or later
pip install "gramps-webapi>=3.11.1"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: pypi (1).

PackageEcosystemAffectedFixed In
gramps-webapi
pypi
1.6.0, 2.0.0, 2.1.0, 2.2.0 (+36 more)3.11.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-40258?
gramps-webapi: Zip Slip Path Traversal in Media Archive Import This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.1/10).
How do I check if my project is affected by CVE-2026-40258?
CVE-2026-40258 affects gramps-webapi. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40258 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.1

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-m5gr-86j6-99jp
PYSEC-2026-346

Related CVEs

  • CVE-2026-61447
    CRITICAL

    PraisonAI: CodeAgent Executes LLM-Generated Code Without Sandboxing and Leaks All Environment Secrets

  • CVE-2026-61445
    CRITICAL

    PraisonAI: AICoder Arbitrary File Write and Command Execution via LLM Tool Calls

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies