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

Update dependency to resolve issue relating to log4j CVE #28

Open
ReidWeb opened this issue Dec 14, 2021 · 16 comments · Fixed by #29
Open

Update dependency to resolve issue relating to log4j CVE #28

ReidWeb opened this issue Dec 14, 2021 · 16 comments · Fixed by #29

Comments

@ReidWeb
Copy link
Contributor

ReidWeb commented Dec 14, 2021

A critical CVE has been discovered in Log4J that requires immediate resolution.

Further detail can be found here and here.

A dependency update is required of log4j dependencies to resolve.

@nomemory
Copy link
Owner

@ReidWeb thank you for mentioning. I will take care of it as soon as I find some available time.

@ReidWeb
Copy link
Contributor Author

ReidWeb commented Dec 14, 2021

Thanks, hopefully should find the time later to get something in to this effect

ReidWeb added a commit to ReidWeb/mapneat that referenced this issue Dec 14, 2021
nomemory added a commit that referenced this issue Dec 14, 2021
[#28] Resolve dependency CVE for Log4J
@nomemory
Copy link
Owner

@ReidWeb created a new version with your PR. Thank you for the contributions.

New version is: 0.9.8

@nomemory nomemory reopened this Dec 14, 2021
@nomemory
Copy link
Owner

Because of the log4j incident, the MVN central is working atrociously slow. It might take a while to sync, so it's best if you try tomorrow.

@ReidWeb
Copy link
Contributor Author

ReidWeb commented Dec 15, 2021

Understandable, think a few repos were having that issue yesterday

It's been found overnight that the fix is incomplete in 2.15.0, will file a PR for that if you don't get to it before I can.

@ReidWeb
Copy link
Contributor Author

ReidWeb commented Dec 15, 2021

Having some difficulties importing this into our project, don't see any tags or releases in your repo, do you know which commit in the repo corresponds to the 0.9.6 release?

@ReidWeb
Copy link
Contributor Author

ReidWeb commented Dec 15, 2021

From reviewing the git commitlog, looks like #23 added a good number of changes.

#23 never appears to have been released independently, 0.9.6 was in February, this PR was merged in October?

So has only just been released with 0.9.8 from what i can see.


We're facing an issue utilising the module

Cannot access 'org.apache.logging.log4j.kotlin.Logging' which is a supertype of 'net.andreinc.mapneat.dsl.MapNeat'

The constructor of MapNeat appears to have changed and would seem to correspond to the error we're facing? i.e. seems this PR introduced a breaking change from what i'm reading?

Would it be at all possible to correct this? From my experience I'd recommend either:

  1. A change reverting this change introduced in Please provide possibility to update JsonPath configuration options #23 and release that again inline with semver
  2. A change correcting this constructor? If possible? Not quite sure if it is?

Apologies if any of the above isn't correct, I'm by no means an expert in Kotlin or the JVM.

@ReidWeb
Copy link
Contributor Author

ReidWeb commented Dec 15, 2021

Digging deeper on this

For published version 0.9.6 of Mapneat, IntelliJ IDEA reports the dependency as looking like so

image

Whereas with 0.9.8 it resolves as a flat dependency

image

Was 0.9.6 built and published with maven?

@nomemory
Copy link
Owner

I think there's a problem with the gradle version I've used to build up everything. Gradle is a nightmare when it comes to breaking changes. I need to take a deeper look to understand what is happening. I had/have limited time because the log4j incident was also problematic at work...

I will comeback with some answers.

Yes, there was a skip in versions.

I think the problem is not with the constructor but with the way the jar is built.

I will comeback with an answer hopefully soon.

Meanwhile there's a agnostic fix to the log4j problem with running an agent. Use that.

Sorry for the inconvenience.

@nomemory
Copy link
Owner

nomemory commented Dec 15, 2021

Tried to submit another fix to maven central:

maven2): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/net/andreinc/mapneat/0.9.9/mapneat-0.9.9.pom.asc. Return code is: 405, ReasonPhrase: Not Allowed.

Method not allowed during maintenance

Things are getting more complicated...

I will retry again later or tomorrow.

@ReidWeb
Copy link
Contributor Author

ReidWeb commented Dec 15, 2021

Thanks for the update, we managed to bypass by enforcing a platform level dependency. I'll dig out the line tomorrow

@nomemory
Copy link
Owner

@ReidWeb can you please try again with:

0.9.9

If you are still experiencing problems (the constructor change should be backwards compatible), can you please:

@ReidWeb
Copy link
Contributor Author

ReidWeb commented Dec 16, 2021

All issues and concerns resolved with the implementation of 0.9.9. Thanks Andrei

@nomemory
Copy link
Owner

Happy to help.

@wafisher
Copy link

I think this broke again in 1.0.0:

e: /Users/wfisher/Desktop/Backend/backend/src/test/java/org/lirr/backend/test/helper/TestUtilsTest.kt: (61, 13): Cannot access 'org.apache.logging.log4j.kotlin.Logging' which is a supertype of 'net.andreinc.mapneat.dsl.MapNeat'. Check your module classpath for missing or conflicting dependencies

But it's working on 0.9.9 so I just dowgranded.

@nomemory nomemory reopened this Jun 14, 2022
@nomemory
Copy link
Owner

@wafisher i will take another look this week to see why it's broken. Had some terrible times with maven central and gradle lately, so I need to get a closer anyways.

Thank you for stopping by.

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