You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] ComparablePackageURL omits the name, so purls differing only by name compare equal #1021
ComparablePackageURL in cyclonedx/_internal/compare.py builds its comparison tuple from type, namespace, version, qualifiers and subpath, but not name:
Both produce the tuple ("pypi", None, "1.0.0", (), None).
name is a required component of a purl and is the main thing that distinguishes one package from another, so leaving it out makes the comparison much weaker than intended. Anything that sorts or compares components by purl treats unrelated packages as interchangeable, and ordering between them is then decided by whatever the sort algorithm happens to do, which is not stable across inputs.
Expected
name participates in the comparison, in its canonical purl position between namespace and version.
I have a fix and a regression test ready and will open a PR referencing this issue.
changed the title [-]ComparablePackageURL omits the name, so purls differing only by name compare equal[/-][+][BUG] ComparablePackageURL omits the name, so purls differing only by name compare equal[/+]on Jul 31, 2026
Activity
[-]ComparablePackageURL omits the name, so purls differing only by name compare equal[/-][+][BUG] ComparablePackageURL omits the name, so purls differing only by name compare equal[/+]jkowalleck commentedon Aug 10, 2026
fixed via https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v11.11.1