Vulnerabilities in pkg:pypi/gramps-webapi
PACKAGECVE-2026-40258 is a CRITICAL (CVSS 9.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting gramps-webapi libraries in the PyPI ecosystem. The issue involves zip slip path traversal in media archive import. Remediation is available by upgrading affected packages to version 3.11.1.
pkg:pypi/gramps-webapi
Vulnerability advisories affecting package pkg:pypi/gramps-webapi. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-m5gr-86j6-99jp | CVE-2026-40258 | CRITICAL | gramps-webapi: Zip Slip Path Traversal in Media Archive Import |
| GHSA-9gjv-jvm7-vv2v | - | MODERATE | Gramps Web API: Private Sub-Object Data in Non-Private Objects Exposed to Guest Users |
CVE-2026-40258 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-40258
To remediate this vulnerability, upgrade all affected gramps-webapi dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install gramps-webapi>=3.11.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show gramps-webapi
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-40258, inspect your installed packages using pip:
pip show gramps-webapi
Analyze the terminal output to locate any version of gramps-webapi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.11.1), your application is affected.
Note: The pip show gramps-webapi command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In gramps-webapi, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-40258 Affected gramps-webapi Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gramps-webapi
|
PyPI |
≥ 1.6.0
< 3.11.1
|
3.11.1
|
References
Frequently Asked Questions
What is CVE-2026-40258?
Which gramps-webapi versions are affected?
What version fixes CVE-2026-40258?
Is gramps-webapi affected?
What is the CVSS score of CVE-2026-40258?
What CWE is associated with CVE-2026-40258?
How can I check PyPI dependencies for CVE-2026-40258?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m5gr-86j6-99jp",
"modified" : "2026-04-24T20:49:27Z",
"published" : "2026-04-10T21:00:09Z",
"aliases" : [ "CVE-2026-40258" ],
"summary" : "gramps-webapi: Zip Slip Path Traversal in Media Archive Import",
"details" : "## Summary\n\nA 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.\n\n## Details\n\nWhen 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.\n\nOnly 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.\n\nFor multi-tree deployments, the impact depends on deployment configuration. Assuming the standard docker-based deployment is used:\n\n- **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.\n- **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.\n- **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.\n\n## Fix\n\nZIP 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "gramps-webapi"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.6.0"
}, {
"fixed" : "3.11.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.11.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/gramps-project/gramps-web-api/security/advisories/GHSA-m5gr-86j6-99jp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40258"
}, {
"type" : "WEB",
"url" : "https://github.com/gramps-project/gramps-web-api/commit/3ed4342711e3ec849552df09b1fe2fbf2ca5c29a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gramps-project/gramps-web-api"
}, {
"type" : "WEB",
"url" : "https://github.com/gramps-project/gramps-web-api/releases/tag/v3.11.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-10T21:00:09Z",
"nvd_published_at" : "2026-04-17T22:16:32Z"
}
}