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

Instanciating a PackagerURL with a version number containing a new line leads eventually to an invalid URL #150

Open
nhumblot opened this issue May 30, 2024 · 0 comments · May be fixed by #151

Comments

@nhumblot
Copy link

Context

Identified following this analysis jeremylong/DependencyCheck#6688 (comment)

Maven supports the newline character in the version as per its XSD. When instantiating a PackageURL with such a character in its version, calling PackageURL.canonicalize() returns an invalid URL.

Steps to reproduce

        PackageURL url = new PackageURL("maven", "com.google.summit", "summit-ast", "2.2.0\n", null, null);

        String canonicalize = url.canonicalize();

Expected beavior

canonicalize is equal to pkg:maven/com.google.summit/[email protected]%0A

Current behavior

canonicalize is equal to pkg:maven/com.google.summit/[email protected]%A

nhumblot added a commit to nhumblot/packageurl-java that referenced this issue Jun 1, 2024
nhumblot added a commit to nhumblot/packageurl-java that referenced this issue Jun 1, 2024
@nhumblot nhumblot linked a pull request Jun 1, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant