Lookup for vulnerable packages by Package URL.

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

{
    "url": "http://public2.vulnerablecode.io/api/packages/69907?format=api",
    "purl": "pkg:golang/github.com/ulikunitz/xz@0.5.15",
    "type": "golang",
    "namespace": "github.com/ulikunitz",
    "name": "xz",
    "version": "0.5.15",
    "qualifiers": {},
    "subpath": "",
    "is_vulnerable": false,
    "next_non_vulnerable_version": null,
    "latest_non_vulnerable_version": null,
    "affected_by_vulnerabilities": [],
    "fixing_vulnerabilities": [
        {
            "url": "http://public2.vulnerablecode.io/api/vulnerabilities/28749?format=api",
            "vulnerability_id": "VCID-aag6-jhbk-qqd6",
            "summary": "github.com/ulikunitz/xz leaks memory when decoding a corrupted multiple LZMA archives\n### Summary\n\nIt is possible to put data in front of an LZMA-encoded byte stream without detecting the situation while reading the header. This can lead to increased memory consumption because the current implementation allocates the full decoding buffer directly after reading the header. The LZMA header doesn't include a magic number or has  a checksum to detect such an issue according to the [specification](https://github.com/jljusten/LZMA-SDK/blob/master/DOC/lzma-specification.txt).\n\nNote that the code recognizes the issue later while reading the stream, but at this time the memory allocation has already been done.\n\n### Mitigations\n\nThe release v0.5.15 includes following mitigations:\n\n- The ReaderConfig DictCap field is now interpreted as a limit for the dictionary size.\n- The default is 2 Gigabytes - 1 byte (2^31-1 bytes).\n- Users can check with the [Reader.Header] method what the actual values are in  their LZMA files and set a smaller limit using ReaderConfig.\n- The dictionary size will not exceed the larger of the file size and the minimum dictionary size. This is another measure to prevent huge memory allocations for the dictionary.\n- The code supports stream sizes only up to a pebibyte (1024^5).\n\nNote that the original v0.5.14 version had a compiler error for 32 bit platforms, which has been fixed by v0.5.15.\n\n### Methods affected\n\nOnly software that uses [lzma.NewReader](https://pkg.go.dev/github.com/ulikunitz/xz/lzma#NewReader) or [lzma.ReaderConfig.NewReader](https://pkg.go.dev/github.com/ulikunitz/xz/lzma#ReaderConfig.NewReader) is affected. There is no issue for software using the xz functionality.\n\nI thank  @GregoryBuligin for his report, which is provided below.\n\n### Summary\nWhen unpacking a large number of LZMA archives, even in a single goroutine, if the first byte of the archive file is 0 (a zero byte added to the beginning), an error __writeMatch: distance out of range__ occurs. Memory consumption spikes sharply, and the GC clearly cannot handle this situation.\n\n### Details\nJudging by the error  __writeMatch: distance out of range__, the problems occur in the code around this function.\nhttps://github.com/ulikunitz/xz/blob/c8314b8f21e9c5e25b52da07544cac14db277e89/lzma/decoderdict.go#L81\n\n### PoC\nRun a function similar to this one in 1 or several goroutines on a multitude of LZMA archives that have a 0 (a zero byte) added to the beginning.\n```\nconst ProjectLocalPath = \"some/path\"\nconst TmpDir = \"tmp\"\n\nfunc UnpackLZMA(lzmaFile string) error {\n\tfile, err := os.Open(lzmaFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\treader, err := lzma.NewReader(bufio.NewReader(file))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttmpFile, err := os.CreateTemp(TmpDir, TmpLZMAPrefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\ttmpFile.Close()\n\t\t_ = os.Remove(tmpFile.Name())\n\t}()\n\n\tsha256Hasher := sha256.New()\n\tmultiWriter := io.MultiWriter(tmpFile, sha256Hasher)\n\n\tif _, err = io.Copy(multiWriter, reader); err != nil {\n\t\treturn err\n\t}\n\n\tunpackHash := hex.EncodeToString(sha256Hasher.Sum(nil))\n\tunpackDir := filepath.Join(\n\t\tProjectLocalPath, unpackHash[:2],\n\t)\n\t_ = os.MkdirAll(unpackDir, DirPerm)\n\n\tunpackPath := filepath.Join(unpackDir, unpackHash)\n\n\treturn os.Rename(tmpFile.Name(), unpackPath)\n}\n```\n\n\n\n### Impact\nServers with a small amount of RAM that download and unpack a large number of unverified LZMA archives",
            "references": [
                {
                    "reference_url": "https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2025-58058.json",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "5.3",
                            "scoring_system": "cvssv3",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
                        }
                    ],
                    "url": "https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2025-58058.json"
                },
                {
                    "reference_url": "https://api.first.org/data/v1/epss?cve=CVE-2025-58058",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19082",
                            "published_at": "2026-04-29T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19126",
                            "published_at": "2026-04-26T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19136",
                            "published_at": "2026-04-24T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19237",
                            "published_at": "2026-04-21T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19224",
                            "published_at": "2026-04-18T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19215",
                            "published_at": "2026-04-16T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19253",
                            "published_at": "2026-04-13T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19308",
                            "published_at": "2026-04-12T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19354",
                            "published_at": "2026-04-09T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19357",
                            "published_at": "2026-04-11T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19506",
                            "published_at": "2026-04-04T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19223",
                            "published_at": "2026-04-07T12:55:00Z"
                        },
                        {
                            "value": "0.00062",
                            "scoring_system": "epss",
                            "scoring_elements": "0.19301",
                            "published_at": "2026-04-08T12:55:00Z"
                        },
                        {
                            "value": "0.00065",
                            "scoring_system": "epss",
                            "scoring_elements": "0.2027",
                            "published_at": "2026-04-02T12:55:00Z"
                        },
                        {
                            "value": "0.00067",
                            "scoring_system": "epss",
                            "scoring_elements": "0.20511",
                            "published_at": "2026-05-07T12:55:00Z"
                        },
                        {
                            "value": "0.00067",
                            "scoring_system": "epss",
                            "scoring_elements": "0.2044",
                            "published_at": "2026-05-05T12:55:00Z"
                        }
                    ],
                    "url": "https://api.first.org/data/v1/epss?cve=CVE-2025-58058"
                },
                {
                    "reference_url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-58058",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [],
                    "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-58058"
                },
                {
                    "reference_url": "https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "5.3",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
                        }
                    ],
                    "url": "https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml"
                },
                {
                    "reference_url": "https://github.com/ulikunitz/xz",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "5.3",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
                        },
                        {
                            "value": "MODERATE",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/ulikunitz/xz"
                },
                {
                    "reference_url": "https://github.com/ulikunitz/xz/commit/88ddf1d0d98d688db65de034f48960b2760d2ae2",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "5.3",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
                        },
                        {
                            "value": "MODERATE",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/ulikunitz/xz/commit/88ddf1d0d98d688db65de034f48960b2760d2ae2"
                },
                {
                    "reference_url": "https://github.com/ulikunitz/xz/security/advisories/GHSA-jc7w-c686-c4v9",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "5.3",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
                        },
                        {
                            "value": "MODERATE",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://github.com/ulikunitz/xz/security/advisories/GHSA-jc7w-c686-c4v9"
                },
                {
                    "reference_url": "https://nvd.nist.gov/vuln/detail/CVE-2025-58058",
                    "reference_id": "",
                    "reference_type": "",
                    "scores": [
                        {
                            "value": "5.3",
                            "scoring_system": "cvssv3.1",
                            "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
                        },
                        {
                            "value": "MODERATE",
                            "scoring_system": "generic_textual",
                            "scoring_elements": ""
                        }
                    ],
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-58058"
                },
                {
                    "reference_url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1112508",
                    "reference_id": "1112508",
                    "reference_type": "",
                    "scores": [],
                    "url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1112508"
                },
                {
                    "reference_url": "https://bugzilla.redhat.com/show_bug.cgi?id=2391585",
                    "reference_id": "2391585",
                    "reference_type": "",
                    "scores": [],
                    "url": "https://bugzilla.redhat.com/show_bug.cgi?id=2391585"
                }
            ],
            "fixed_packages": [
                {
                    "url": "http://public2.vulnerablecode.io/api/packages/69907?format=api",
                    "purl": "pkg:golang/github.com/ulikunitz/xz@0.5.15",
                    "is_vulnerable": false,
                    "affected_by_vulnerabilities": [],
                    "resource_url": "http://public2.vulnerablecode.io/packages/pkg:golang/github.com/ulikunitz/xz@0.5.15"
                }
            ],
            "aliases": [
                "CVE-2025-58058",
                "GHSA-jc7w-c686-c4v9"
            ],
            "risk_score": 3.1,
            "exploitability": "0.5",
            "weighted_severity": "6.2",
            "resource_url": "http://public2.vulnerablecode.io/vulnerabilities/VCID-aag6-jhbk-qqd6"
        }
    ],
    "risk_score": null,
    "resource_url": "http://public2.vulnerablecode.io/packages/pkg:golang/github.com/ulikunitz/xz@0.5.15"
}