Skip to content

Elixir Security importer drops affected packages when an advisory lists no patched or unaffected versions #2540

Backlog

Description

@sanchit955

An Elixir Security advisory that lists no unaffected_versions and no patched_versions — a normal data shape, a disclosed vulnerability with no patched version yet — produces an AffectedPackageV2 whose version range serializes as 'vers:hex/'.

VersionRange.from_string('vers:hex/') raises ValueError: 'vers:hex/' specifies no version range constraints., so the importer logs Cannot create AffectedPackage with invalid or unknown range and the package is dropped when the advisory round-trips through AdvisoryDataV2.from_dict.

Reproduction: a minimal advisory YAML with a valid CVE and package but no version lists. process_file yields the advisory with affected_version_range == 'vers:hex/', and the package disappears on round-trip.

This is the same defect family as #2387 (Gentoo / apache_httpd), fixed for apache_httpd in #2392 and for Gentoo in #2521.

Fix: build the range only when constraints are non-empty; when there is no usable range, log and skip the package entry. The advisory itself is still recorded (with an empty affected_packages list).

Note: the package is not recorded as affected for that advisory. A deeper fix in AffectedPackageV2.from_dict (tolerate a None range instead of dropping the package) is a behaviour change beyond the importer — flagging for maintainer decision, not bundling it here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions