Skip to content

Inconsistent package identifier format for vulnerabilities in the Swift ecosystem #3333

Closed
@fviernau

Description

@fviernau

The vulnerability data has been imported to osv.dev, where I observed the issue which I filed
here: google/osv.dev#1923. here's the copied description:


Looking at the vulnerabilities linked to SwiftURL packages [1], it seems that there
are multiple variants how the canonical package name is constructed:

  1. SwiftURL/https://github.com/grpc/grpc-swift.git
  2. SwiftURL/https://github.com/apple/swift-nio-http2.git
  3. SwiftURL/github.com/vapor/leaf-kit

In SwiftPM a canocial name is derived using some normalization which
includes amongst others:

  1. Dropping .git suffix
  2. Dropping the protocol
  3. Lowercasing
  4. Dropping port, and user info

...see also [2]. Should osv.dev normalize the IDs of the packages and specify the normalization, so that
it is straight forward to craft a query to obtain vulnerabilities for a specific swift package?

[1] https://osv.dev/list?ecosystem=SwiftURL&q=
[2] https://github.com/apple/swift-package-manager/blob/24bfdd180afdf78160e7a2f6f6deb2c8249d40d3/Sources/PackageModel/PackageIdentity.swift#L345

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