# CVE-2026-40258: Gramps Web API has Zip Slip Path Traversal in Media Archive Import

> Authenticated owners can exploit Zip Slip in media import to write arbitrary files outside the intended directory, requiring an upgrade to fix.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Apr 2026
- **Updated:** 20 Apr 2026
- **Also known as:** GHSA-m5gr-86j6-99jp, PYSEC-2026-346

## What is CVE-2026-40258?

CVE-2026-40258 is a critical path traversal vulnerability in gramps-project gramps-web-api, published on 17 Apr 2026. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

The Gramps Web API is a Python REST API for the genealogical research software Gramps. Versions 1.6.0 through 3.11.0 have a path traversal vulnerability (Zip Slip) 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. Startig in version 3.11.1, 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.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-40258?

3 open source packages ship an affected version, including gramps-webapi.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gramps-webapi` | PyPI | From 1.6.0 | 3.11.1 |
| `gramps-webapi` | PyPI | From 1.6.0 | 3.11.1 |
| `gramps-webapi` | PyPI | From 1.6.0 | 3.11.1 |

## How do I fix CVE-2026-40258?

Upgrade gramps-webapi to 3.11.1 or later.

## Is CVE-2026-40258 being exploited?

There is no known exploitation of CVE-2026-40258 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40258 and fix it if it is affected.

What it is: CVE-2026-40258 is a critical path traversal vulnerability in gramps-project gramps-web-api, published on 17 Apr 2026. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-40258 in the wild and no public exploit code.

Affected packages and fixed versions:
- gramps-webapi (PyPI): affected from 1.6.0; fixed in 3.11.1
- gramps-webapi (PyPI): affected from 1.6.0; fixed in 3.11.1
- gramps-webapi (PyPI): affected from 1.6.0; fixed in 3.11.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-40258/ (Markdown: https://insights.sbomify.com/CVE-2026-40258/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-40258
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-40258
- OSV: https://osv.dev/vulnerability/CVE-2026-40258

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-40258/
Summaries are generated and may contain mistakes; the official description above is the record.
