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

[FP]: CVE-2022-21704, a log4js (node.js) dependency, gets flagged in a log4j (Java) dependency #6695

Closed
volkert-fastned opened this issue May 28, 2024 · 6 comments
Labels
FP Report maven changes to the maven plugin

Comments

@volkert-fastned
Copy link
Contributor

Package URl

pkg:maven/org.apache.logging.log4j/[email protected]

CPE

cpe:2.3:a:apache:log4j:2.23.1:::::::*

CVE

CVE-2022-21704

ODC Integration

{"label"=>"Gradle Plugin"}

ODC Version

9.2.0

Description

Vulnerability CVE-2022-21704, which applies to log4js (with an s at the end, a Node.js library) gets flagged on a Log4j (Java) dependency:

log4j-slf4j2-impl-2.23.1-sources.jar (pkg:maven/org.apache.logging.log4j/[email protected], cpe:2.3:a:apache:log4j:2.23.1:*:*:*:*:*:*:*, cpe:2.3:a:log4js_project:log4js:2.23.1:*:*:*:*:*:*:*) : CVE-2022-21704

Strangely enough, this suddenly got flagged (along with a bunch of other vulnerabilities) while I tried to upgrade a project from Kotlin 1.9.x to Kotlin 2.0. But the dependencies that suddenly got flagged with that upgrade weren't related to the Kotlin 2.0 upgrade.

Also worth noting: according to NIST, the CPE should in fact be cpe:2.3:a:log4js_project:log4js:*:*:*:*:*:node.js:*:*, but both CPEs that the DendencyCheck Gradle plugin flags have a wildcard in place of the node.js part. Perhaps that's what's causing this false positive?

Copy link
Contributor

Maven Coordinates

<dependency>
   <groupId>org.apache.logging.log4j</groupId>
   <artifactId>log4j-slf4j2-impl</artifactId>
   <version>2.23.1</version>
</dependency>

Suppression rule:

<suppress base="true">
   <notes><![CDATA[
   FP per issue #6695
   ]]></notes>
   <packageUrl regex="true">^pkg:maven/org\.apache\.logging\.log4j/log4j-slf4j2-impl@.*$</packageUrl>
   <cpe>cpe:/a:apache:log4j</cpe>
</suppress>

Link to test results: https://github.com/jeremylong/DependencyCheck/actions/runs/9268617953

@volkert-fastned
Copy link
Contributor Author

@jeremylong
Copy link
Owner

approved

Copy link
Contributor

Suppress rule has been added to the generatedSuppressions branch.

github-actions bot added a commit that referenced this issue May 28, 2024
@volkert-fastned
Copy link
Contributor Author

volkert-fastned commented May 28, 2024

@jeremylong This suppression didn't work, apparently. The FP is still getting flagged, even with the suppression added to my project:

log4j-slf4j2-impl-2.23.1-sources.jar (pkg:maven/org.apache.logging.log4j/[email protected], cpe:2.3:a:log4js_project:log4js:2.23.1:*:*:*:*:*:*:*) : CVE-2022-21704

@volkert-fastned
Copy link
Contributor Author

@jeremylong I figured out why the automatically generated suppression didn't work.

See b2052fb#r142470093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FP Report maven changes to the maven plugin
Projects
None yet
Development

No branches or pull requests

2 participants