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

Log4j 2.12.1 getting download it when running pluggin commands #1175

Closed
rogelio-blanco opened this issue Nov 8, 2024 · 6 comments · Fixed by #1180
Closed

Log4j 2.12.1 getting download it when running pluggin commands #1175

rogelio-blanco opened this issue Nov 8, 2024 · 6 comments · Fixed by #1180
Milestone

Comments

@rogelio-blanco
Copy link

rogelio-blanco commented Nov 8, 2024

Hi team,

I want to raise the issue that when I run a command using this plugin in the .m2 folder, I get a log4j 2.12.1 version with multiple vulnerabilities. Our Security team is asking to upgrade to a higher version.

I already verify:

  • Our pom. doesn't have any reference to this log4j version.
  • I also cloned the plugin project to check if I could exclude the dependency, but I could not see it.
  • When I run a clean install in my project, I don't see that dependency being downloaded; I see it when I run the command to upgrade the POM version.

How can I get around to downloading that log4j version? I would appreciate any help or feedback you can give me.

Plugin version: 2.17.1
Command: version:set versions:commit -DnewVersion="dummy"

image

https://security.snyk.io/package/maven/org.apache.logging.log4j:log4j-core/2.12.1

@andrzejj0
Copy link
Contributor

andrzejj0 commented Nov 9, 2024

We don't use log4j. It's most likely a transitive dependency of your project. You can use dependency:tree to track what dependency is using it.

mvn dependency:tree -Dverbose | grep -B 8 log4j

@slawekjaranowski
Copy link
Member

You can also try with: maven.repo.local.recordReverseTree property, exxecute your example as:

mvn -Dmaven.repo.local.recordReverseTree version:set ....

next examine content of directories: .tracking in your ~./m2/repository

@rogelio-blanco
Copy link
Author

rogelio-blanco commented Nov 9, 2024

Thank you for the quick response; the commands help me.

Below, you can see the output, which indicates that the plugin is importing that specific dependency.

image

Thanks

@andrzejj0 andrzejj0 removed the invalid label Nov 9, 2024
@andrzejj0 andrzejj0 reopened this Nov 9, 2024
@andrzejj0
Copy link
Contributor

Apologies for closing this. dependency:tree did not include any descendants of commons-logging for some reason. log4j looks to be an optional dependency of it.

This should be resolved by #1168

@slawekjaranowski
Copy link
Member

It is strange ... optional dependencies should not be downloaded .... we need more investigation in Maven/Resolver

By the wat should be resolved with new version of doxia.

@slawekjaranowski slawekjaranowski added this to the 2.18.0 milestone Nov 9, 2024
@slawekjaranowski slawekjaranowski linked a pull request Nov 9, 2024 that will close this issue
@andrzejj0
Copy link
Contributor

andrzejj0 commented Nov 9, 2024

@slawekjaranowski in case you're interested, here's the output of

rm -rf ~/.m2/repository/log4j/log4j; mvn -X versions:set versions:revert -DnewVersion=dummy | tee /tmp/versions.log

Only pom.xml gets downloaded. Not a vulnerability.

I'm not sure why pom.xml gets downloaded, but this is out of scope of versions-maven-plugin, it's a question to Resolver guys.

I wonder if this plugin's use would get flagged by any threat scanner if it's only downloading a pom.xml.

versions.log

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.

3 participants