Lookup for vulnerable packages by Package URL.

GET /api/packages/1018324?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "url": "http://public2.vulnerablecode.io/api/packages/1018324?format=api",
    "purl": "pkg:pypi/gramps-webapi@2.5.3",
    "type": "pypi",
    "namespace": "",
    "name": "gramps-webapi",
    "version": "2.5.3",
    "qualifiers": {},
    "subpath": "",
    "is_vulnerable": true,
    "next_non_vulnerable_version": "3.11.1",
    "latest_non_vulnerable_version": "3.11.1",
    "affected_by_vulnerabilities": [
        {
            "url": "http://public2.vulnerablecode.io/api/vulnerabilities/89173?format=api",
            "vulnerability_id": "VCID-fp8j-w9xm-skda",
            "summary": "gramps-webapi: Zip Slip Path Traversal in Media Archive Import\n## 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.",
            "references": [
                {
                    "reference_url": "https://api.first.org/data/v1/epss?cve=CVE-2026-40258",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "0.00074",
                            "scoring_system": "epss",
                            "scoring_elements": "0.22428",
                            "published_at": "2026-06-05T12:55:00Z"
                        },
                        {
                            "value": "0.00074",
                            "scoring_system": "epss",
                            "scoring_elements": "0.22328",
                            "published_at": "2026-06-09T12:55:00Z"
                        },
                        {
                            "value": "0.00074",
                            "scoring_system": "epss",
                            "scoring_elements": "0.22313",
                            "published_at": "2026-06-08T12:55:00Z"
                        },
                        {
                            "value": "0.00074",
                            "scoring_system": "epss",
                            "scoring_elements": "0.22366",
                            "published_at": "2026-06-07T12:55:00Z"
                        },
                        {
                            "value": "0.00074",
                            "scoring_system": "epss",
                            "scoring_elements": "0.22415",
                            "published_at": "2026-06-06T12:55:00Z"
                        }
                    ],
                    "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-40258"
                },
                {
                    "reference_url": "https://github.com/gramps-project/gramps-web-api",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "9.1",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
                        },
                        {
                            "value": "CRITICAL",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/gramps-project/gramps-web-api"
                },
                {
                    "reference_url": "https://github.com/gramps-project/gramps-web-api/commit/3ed4342711e3ec849552df09b1fe2fbf2ca5c29a",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "9.1",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
                        },
                        {
                            "value": "CRITICAL",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/gramps-project/gramps-web-api/commit/3ed4342711e3ec849552df09b1fe2fbf2ca5c29a"
                },
                {
                    "reference_url": "https://github.com/gramps-project/gramps-web-api/releases/tag/v3.11.1",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "9.1",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
                        },
                        {
                            "value": "CRITICAL",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/gramps-project/gramps-web-api/releases/tag/v3.11.1"
                },
                {
                    "reference_url": "https://github.com/gramps-project/gramps-web-api/security/advisories/GHSA-m5gr-86j6-99jp",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "9.1",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
                        },
                        {
                            "value": "CRITICAL",
                            "scoring_system": "cvssv3.1_qr",
                            "scoring_elements": ""
                        },
                        {
                            "value": "CRITICAL",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/gramps-project/gramps-web-api/security/advisories/GHSA-m5gr-86j6-99jp"
                },
                {
                    "reference_url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40258",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "9.1",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
                        },
                        {
                            "value": "CRITICAL",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40258"
                },
                {
                    "reference_url": "https://github.com/advisories/GHSA-m5gr-86j6-99jp",
                    "reference_id": "GHSA-m5gr-86j6-99jp",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "CRITICAL",
                            "scoring_system": "cvssv3.1_qr",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/advisories/GHSA-m5gr-86j6-99jp"
                }
            ],
            "fixed_packages": [
                {
                    "url": "http://public2.vulnerablecode.io/api/packages/110217?format=api",
                    "purl": "pkg:pypi/gramps-webapi@3.11.1",
                    "is_vulnerable": false,
                    "affected_by_vulnerabilities": [],
                    "resource_url": "http://public2.vulnerablecode.io/packages/pkg:pypi/gramps-webapi@3.11.1"
                }
            ],
            "aliases": [
                "CVE-2026-40258",
                "GHSA-m5gr-86j6-99jp"
            ],
            "risk_score": 4.5,
            "exploitability": "0.5",
            "weighted_severity": "9.0",
            "resource_url": "http://public2.vulnerablecode.io/vulnerabilities/VCID-fp8j-w9xm-skda"
        },
        {
            "url": "http://public2.vulnerablecode.io/api/vulnerabilities/90277?format=api",
            "vulnerability_id": "VCID-jhbq-9x4b-p3cr",
            "summary": "Gramps Web API: Private Sub-Object Data in Non-Private Objects Exposed to Guest Users\n## Summary\n\nUsers with the **Guest** role could receive private sub-object data (e.g. private alternate names, private addresses, private note/citation/media handles) through list API endpoints such as `GET /api/people/`, `GET /api/places/`, `GET /api/events/`, and all other object list endpoints.\n\n**This does not expose objects (people, places, events, …) that are themselves marked private.** Top-level private objects are correctly excluded from all responses. Only sub-object data attached to otherwise-public objects is affected.\n\n## Affected Versions\n\nAll versions of Gramps Web API prior to the fix.\n\n## Root Cause\n\nThe vulnerability originates from the behaviour of `PrivateProxyDb.iter_*()` in **Gramps core**. The `ProxyDbBase.__iter_object()` helper, which backs all `iter_*()` methods in `PrivateProxyDb`, correctly filters out top-level private objects but returns the remaining objects **unsanitized** — i.e. without stripping private sub-object references. In contrast, `PrivateProxyDb.get_*_from_handle()` does call the appropriate `sanitize_*()` function.\n\nGramps Web API's `ModifiedPrivateProxyDb` (which wraps the raw database for non-admin users) inherited this behaviour without override.\n\nThe same issue affects Gramps desktop features that consume `iter_*()` output: reports and exports generated via Gramps desktop using `PrivateProxyDb` may also include private sub-object data that should have been stripped.\n\n## Conditions Required\n\n**This issue only affects trees in which sub-objects have been explicitly marked private in Gramps desktop.** The Gramps Web frontend UI does not expose controls for setting the private flag on sub-objects (alternate names, addresses, notes,\ncitations, media references, event references, etc.). In practice, such flags are set in Gramps desktop and then synced or imported into Gramps Web.\n\n## Impact\n\nWhen the conditions above are met, a user with the Guest role querying any list endpoint receives:\n\n- **Full content** of private embedded sub-objects on people, such as alternate  names (first name, surname, etc.) and addresses (street, city, etc.).\n- **Handles referencing** private notes, citations, and media attached to places,  events, sources, and other objects. These reveal the *existence* of private\n  linked objects but not their content; fetching those objects by handle is  correctly blocked by the proxy.\n\n## Fix\n\n`ModifiedPrivateProxyDb` now overrides all `iter_*()` object methods to check `obj.get_privacy()` directly on the already-loaded object (eliminating the redundant per-object refetch) and to call the appropriate `sanitize_*()` function before yielding each object. This is consistent with the behaviour of `get_*_from_handle()` in `PrivateProxyDb`.",
            "references": [
                {
                    "reference_url": "https://github.com/gramps-project/gramps-web-api",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "6.9",
                            "scoring_system": "cvssv4",
                            "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
                        },
                        {
                            "value": "MODERATE",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/gramps-project/gramps-web-api"
                },
                {
                    "reference_url": "https://github.com/gramps-project/gramps-web-api/releases/tag/v3.11.0",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "6.9",
                            "scoring_system": "cvssv4",
                            "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
                        },
                        {
                            "value": "MODERATE",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/gramps-project/gramps-web-api/releases/tag/v3.11.0"
                },
                {
                    "reference_url": "https://github.com/gramps-project/gramps-web-api/security/advisories/GHSA-9gjv-jvm7-vv2v",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "MODERATE",
                            "scoring_system": "cvssv3.1_qr",
                            "scoring_elements": ""
                        },
                        {
                            "value": "6.9",
                            "scoring_system": "cvssv4",
                            "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
                        },
                        {
                            "value": "MODERATE",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/gramps-project/gramps-web-api/security/advisories/GHSA-9gjv-jvm7-vv2v"
                },
                {
                    "reference_url": "https://github.com/advisories/GHSA-9gjv-jvm7-vv2v",
                    "reference_id": "GHSA-9gjv-jvm7-vv2v",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "MODERATE",
                            "scoring_system": "cvssv3.1_qr",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/advisories/GHSA-9gjv-jvm7-vv2v"
                }
            ],
            "fixed_packages": [
                {
                    "url": "http://public2.vulnerablecode.io/api/packages/111573?format=api",
                    "purl": "pkg:pypi/gramps-webapi@3.11.0",
                    "is_vulnerable": true,
                    "affected_by_vulnerabilities": [
                        {
                            "vulnerability": "VCID-fp8j-w9xm-skda"
                        }
                    ],
                    "resource_url": "http://public2.vulnerablecode.io/packages/pkg:pypi/gramps-webapi@3.11.0"
                }
            ],
            "aliases": [
                "GHSA-9gjv-jvm7-vv2v"
            ],
            "risk_score": 3.1,
            "exploitability": "0.5",
            "weighted_severity": "6.2",
            "resource_url": "http://public2.vulnerablecode.io/vulnerabilities/VCID-jhbq-9x4b-p3cr"
        }
    ],
    "fixing_vulnerabilities": [],
    "risk_score": "4.5",
    "resource_url": "http://public2.vulnerablecode.io/packages/pkg:pypi/gramps-webapi@2.5.3"
}