Skip to content

OSV introduced: "0" is converted to a non-universal affected range #11568

Backlog

Description

@jeffwidman

Summary

GHSA-48qh-9gx4-j472 publishes the PyPI package aaiohttp with the affected range > 0. Its linked OpenSSF source, MAL-2023-1574, contains one ECOSYSTEM range event:

{ "introduced": "0" }

There is no terminating fixed, last_affected, or limit event.

The OSV schema defines introduced: "0" as a sentinel that sorts before every version, and its unfixed-vulnerability example says this event alone means every possible version is affected. Converting it to the literal ecosystem constraint > 0 loses that sentinel meaning.

Public API behavior

The public OSV API reports MAL-2023-1574 for all of these aaiohttp versions:

  • 0
  • 0.0.0
  • 0.0.0a1
  • 0.0.0.dev0
  • 0.post1
  • 0.0.1
  • 1.0

The GitHub Advisory Database REST affects query (GET /advisories?type=malware&affects=aaiohttp@<version>) excludes the first four versions and includes the last three. That behavior is consistent with interpreting the published > 0 literally under PEP 440, but not with the source OSV sentinel.

A second public record, GHSA-hqmv-64pp-q4xw, publishes >= 0. Its affects query includes 0 and 0.0.0, but excludes 0.0.0a1 and 0.0.0.dev0, which suggests the sentinel is being converted to an ordinary version boundary rather than retained as a universal lower bound.

Expected behavior

Importing an OSV range that begins with { "introduced": "0" } should preserve the sentinel's universal semantics. With no terminating event, every ecosystem version should be affected, including versions equal to zero and versions that sort before a literal zero release.

Recurrence hardening

Please add conversion/import regression coverage that:

  1. proves a lone introduced: "0" remains universal after conversion and publication;
  2. covers versions equal to zero and versions below a literal zero release, including PyPI prerelease/dev examples such as 0.0.0a1 and 0.0.0.dev0; and
  3. exercises each supported ecosystem/version parser where a literal > 0 or >= 0 boundary can differ from the OSV sentinel.

I am filing an issue rather than a data PR because this malware advisory is not present in the public github/advisory-database repository, and that repository does not contain the ingestion/conversion implementation needed for a systemic fix. The linked OpenSSF record is already correct, so changing it would only mask the downstream conversion problem.

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