-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Incomplete trailing escape (%) pattern #6688
Comments
Hi! 👋 Thank you for reaching us.
Changing the current implementation of /**
* Helper to complain if unable to parse Package-URL.
*
* @param value the url to parse
* @return the package url
*/
@Nullable
private PackageUrl parsePackageUrl(final String value) {
try {
return PackageUrl.parse(value);
} catch (RuntimeException e) {
LOG.debug("Invalid Package-URL: {}", value, e);
return null;
}
} (see: 6f76587) We get the value from
I don't have more time now, I will look to continue this investigation later today and see where we are getting this value as a software identifier for this dependency to make sure there may not be a deeper issue in DependencyCheck. Sorry for the inconvenience. |
I'm unable to reproduce this? I don't get the invalid PURL and when I run
Which does not include I was trying to look at where the package URL is being created as we can likely fix the bug there. But without a reproduce I can't help. |
We somehow parse a pom that gets a version number with a newline in it: When we analyze the dependency we extract the When I unzip the jar and give a look into the extracted This eventually generates the We don't have the
builder.append(Integer.toHexString(b).toUpperCase()); does not guarantee to have a Technically, the Maven pom schema definition states that the I will look to reach both projects to let them know about this. Given these observations, I am not sure we should implement a specific fix in DependencyCheck as there may actually be cases where this could be a correct value. I honestly discovered today that it is possible to package a jar with a newline in the version 😮 If @jeremylong prefers to also have a patch in DependencyCheck to fix it faster, I can open a PR that would sanitize the version number by removing |
@nhumblot yes - we should trim the version number in dependency-check. Thank you for investigating this. |
Thank you, I appreciate all you've done. |
Describe the bug
The dependency-check throws an IllegalArgumentException
URLDecoder: Incomplete trailing escape (%) pattern
when analyzing the dependency org.scalameta:common_2.13:4.9.1. The actual culprit seems to be thetransitivedependency com.google.summit:summit-ast:2.2.0 with following two softwareIdentifiers:The second identifier is not a valid URL, leading to URLDecoder failing with
Incomplete trailing escape (%) pattern
.Version of dependency-check used
The problem occurs using version 9.2.0 of the maven plugin. It does not occur with earlier versions.
Log file
Full log: https://github.com/acanda/code-analysis-maven-plugin/actions/runs/9236637535/job/25412701360?pr=289
To Reproduce
Steps to reproduce the behavior:
renovate/org.owasp-dependency-check-maven-9.x
NVD_API_KEY
to your NVD API key./mvnw dependency-check:check
Expected behavior
The dependency check should not throw an
AnalysisException
and finish the dependency check successfully.The text was updated successfully, but these errors were encountered: