{"id":"CVE-2026-40258","aliases":["CVE-2026-40258","GHSA-m5gr-86j6-99jp","PYSEC-2026-346"],"related":[],"kind":"vulnerability","state":"published","title":"Gramps Web API has Zip Slip Path Traversal in Media Archive Import","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"La API web de Gramps es una API REST de Python para el software de investigación genealógica Gramps. Las versiones 1.6.0 a la 3.11.0 tienen una vulnerabilidad de salto de ruta (Zip Slip) en la función de importación de archivo multimedia. Un usuario autenticado con privilegios de nivel de propietario puede crear un archivo ZIP malicioso con nombres de archivo de recorrido de directorio para escribir archivos arbitrarios fuera del directorio de extracción temporal previsto en el sistema de archivos local del servidor. A partir de la versión 3.11.1, los nombres de entrada ZIP ahora se validan contra la ruta real resuelta del directorio temporal antes de la extracción. Cualquier entrada cuya ruta resuelta caiga fuera del directorio temporal genera un error y aborta la importación.","source":"nvd"}],"published":"2026-04-10T21:00:09.000Z","modified":"2026-10-27T16:45:03.540Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":">= 1.6.0, < 3.11.1","status":"affected"}],"vendor":"gramps-project","product":"gramps-web-api","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.6.0","status":"affected","fixed":"3.11.1"}],"ecosystem":"PyPI","package":"gramps-webapi","purl":"pkg:pypi/gramps-webapi","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.6.0","status":"affected","fixed":"3.11.1"}],"ecosystem":"PyPI","package":"gramps-webapi","purl":"pkg:pypi/gramps-webapi","source":"pysec"}],"references":[{"url":"https://github.com/gramps-project/gramps-web-api/security/advisories/GHSA-m5gr-86j6-99jp","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/gramps-project/gramps-web-api/commit/3ed4342711e3ec849552df09b1fe2fbf2ca5c29a","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/gramps-project/gramps-web-api/releases/tag/v3.11.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40258","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/gramps-project/gramps-web-api","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/gramps-webapi/PYSEC-2026-346.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/gramps-webapi","tags":["package","web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-m5gr-86j6-99jp","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-04-20T15:48:26.185Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40258","url":"https://www.cve.org/CVERecord?id=CVE-2026-40258","licence":"CVE Terms of Use","modified":"2026-04-20T15:48:41.690Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m5gr-86j6-99jp","url":"https://github.com/advisories/GHSA-m5gr-86j6-99jp","licence":"CC-BY-4.0","modified":"2026-10-27T16:45:03.540Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40258","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40258","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-346","url":"https://osv.dev/vulnerability/PYSEC-2026-346","licence":"CC-BY-4.0","modified":"2026-07-13T16:15:26.843Z"}],"updatedAt":"2026-11-25T22:59:18.971Z","epss":{"score":0.00408,"percentile":0.3714,"date":"2026-12-02T12:00:21.000Z"}}