Skip to content

Match denylist entries the way each ecosystem spells names - #555

Merged
andrew merged 2 commits into
git-pkgs:mainfrom
simonchrz:fix/denylist-names
Oct 23, 2026
Merged

andrew merged 2 commits into
git-pkgs:mainfrom
simonchrz:fix/denylist-names

Conversation

@simonchrz

@simonchrz simonchrz commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Denylist entries were compared as plain PURL strings, while handlers build PURLs from download URLs that spell packages differently. Some denied versions were still served:

  • PyPI: . vs -/_ (wheel filenames always use _)
  • NuGet: entries with capitals never matched the lowercased ids
  • RubyGems: platform gems such as nokogiri-1.16.0-x86_64-linux.gem
  • conda: the handler's channel/name never matched a plain entry, and qualifiers were rejected

Entries and checked PURLs now go through one comparison form in internal/denylist. Handlers, cache keys and DB rows are unchanged. A conda entry matches every channel unless it has a channel qualifier. The docs list how each ecosystem is matched and drop the claim that PyPI separators were already handled.

A second commit covers more spellings: Composer's leading v, OCI repositories written as a path (manifests are now checked by tag and digest too), Swift registry packages in either form and when streaming, Go versions with escaped uppercase letters, and gems with a dash followed by a digit in their name. Gems like devise-2fa were parsed with the wrong name and version, so their cached copies are fetched again once.

Denylist entries were compared as plain PURL strings, but handlers build
PURLs from download URLs that spell packages differently, so some denied
versions were still served. Entries and checked PURLs now go through one
per-ecosystem comparison form: PyPI names follow PEP 503 (case and runs of
-, _ and . are equivalent), NuGet ids and versions ignore case, a gem
version also matches its platform builds, and a conda entry matches the
package in every channel unless it carries a channel qualifier. Cache keys
are unchanged.
Denylist entries now also match Composer versions with Packagist's
leading v, OCI repositories written as a path, Swift registry packages
in either form (also when streaming), Go versions with escaped uppercase
letters, and gems whose names contain a dash followed by a digit. OCI
manifests are checked by tag and digest, and denied blobs and Swift
archives answer 403 instead of 500 or 502.
@andrew
andrew merged commit 1bd5cfc into git-pkgs:main Oct 23, 2026
6 checks passed
@simonchrz simonchrz added the breaking Changes behaviour users rely on; needs a minor release label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Changes behaviour users rely on; needs a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants