Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid purl passes as valid #66

Open
surendrapathak opened this issue Mar 15, 2024 · 2 comments
Open

Invalid purl passes as valid #66

surendrapathak opened this issue Mar 15, 2024 · 2 comments

Comments

@surendrapathak
Copy link

PURL - 'pkg:maven/org.apache.commons:io@1.3.4' passes as valid

p.PackageURL.fromString('pkg:maven/org.apache.commons:io@1.3.4')
PackageURL {
type: 'maven',
name: 'org.apache.commons:io',
namespace: null,
version: '1.3.4',
qualifiers: null,
subpath: null
}

However, it shouldn't be because the namespace is not percent-encoded.

@jdalton
Copy link
Contributor

jdalton commented May 17, 2024

If you .toString() it then it's encoded:

p.PackageURL.fromString('pkg:maven/org.apache.commons:io@1.3.4').toString()
// => 'pkg:maven/org.apache.commons%3Aio@1.3.4'

@surendrapathak
Copy link
Author

Hi @jdalton - The concern is that PURL such as:

pkg:maven/org.apache.commons:io@1.3.4

should be marked invalid for violating the namespace rule:
Screenshot 2024-05-19 at 2 20 52 PM

However, because packageurl-js parses these successfully, they show up in SBOM as valid entries, causing identification issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants