-
Notifications
You must be signed in to change notification settings - Fork 594
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
Syft generates invalid PURLs when name contains :
#3577
Comments
Ah, seems this might actually be a bug in https://github.com/anchore/packageurl-go |
Oddly enough,
gives me
Now I'm really confused as to why the |
BTW, I tried using
|
This is verified as a bug in anchore/packageurl-go. When I depend on
which is of course wrong But when I depend on
which is correct. I'll see what I can do to bring the fix into anchore/packageurl-go |
@wagoodman it seems you touched this last: https://github.com/anchore/packageurl-go/blob/master/packageurl.go#L515 Your comment here:
While it's true that the I see the change to not escape Any objection to reverting the escape function to https://github.com/anchore/packageurl-go/blob/master/packageurl.go#L515 or at least adding Thanks! |
Given https://github.com/package-url/purl-spec/blob/master/PURL-SPECIFICATION.rst#how-to-build-purl-string-from-its-components I would say everything in each segment is escaped, thus we should not be skipping |
I'm not 100% sure this is correct:
https://github.com/package-url/purl-spec/blob/master/PURL-SPECIFICATION.rst#rules-for-each-purl-component Also, for "name:" "A
Would you agree? |
What happened:
Syft found a dotnet executable during a scan, and pulled information from it, including the
name
parameter. In this file, the name it found wasTODO: <Product name>
.This generated a PURL like this:
As an aside, the bom-ref and cpe were:
This causes CycloneDX libraries such as https://github.com/CycloneDX/cyclonedx-python-lib to raise an exception, because this is an invalid PURL. Example:
What you expected to happen:
I expected Syft to generate a valid PURL by escaping all invalid characters.
Steps to reproduce the issue:
Scan a dotnet file with a product name value of "TODO: "
I am trying to get permission to attach the file to this ticket. I will attach if/when I get permission.
Anything else we need to know?:
Environment:
syft version
:cat /etc/os-release
or similar):The text was updated successfully, but these errors were encountered: