Skip to content

fix(sbom): percent-encode vcs_url qualifier in generated purls#9670

Merged
owlstronaut merged 1 commit into
npm:latestfrom
ubeddulla:sbom-purl-vcs-url-encode
Jun 29, 2026
Merged

fix(sbom): percent-encode vcs_url qualifier in generated purls#9670
owlstronaut merged 1 commit into
npm:latestfrom
ubeddulla:sbom-purl-vcs-url-encode

Conversation

@ubeddulla

Copy link
Copy Markdown
Contributor

Both SBOM generators build a git package's purl by sticking the raw node.resolved straight into the vcs_url qualifier, so any # or & in that resolved URL escapes the qualifier value. A git dep resolving to e.g. https://github.com/foo/bar.git?a=b&c=d#1234 produces pkg:npm/...?vcs_url=https://github.com/foo/bar.git?a=b&c=d#1234, where a purl parser reads c=d as a separate qualifier and 1234 as the subpath. Wrapping node.resolved in encodeURIComponent at both sites keeps it a single qualifier value; the existing git-url snapshots and two new assertions cover it.

@ubeddulla ubeddulla requested review from a team as code owners June 26, 2026 05:55
@owlstronaut owlstronaut merged commit 024e6d9 into npm:latest Jun 29, 2026
27 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Backport to release/v11 created: #9693

owlstronaut pushed a commit that referenced this pull request Jun 29, 2026
Backport of #9670 to `release/v11`.

Co-authored-by: UB <ubed@bugqore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants