KeePassJava2 icon indicating copy to clipboard operation
KeePassJava2 copied to clipboard

[Bug] Issues with Dependencies

Open g2vinay opened this issue 4 years ago • 11 comments

There are following CVE issues with some of the dependencies used by KeePassJava2 that need to be addressed:

  1. commons-codec:commons-codec:jar:1.10: WS-2019-0379: This library is vulnerable to information disclosure due to Improper Input validation.
  2. org.simpleframework:simple-xml:jar:2.7.1: CVE-2017-1000190: SimpleXML (latest version 2.7.1) is vulnerable to an XXE vulnerability resulting SSRF, information disclosure, DoS and so on.
  3. com.google.guava:guava:jar:20.0: CVE-2018-10237 Unbounded memory allocation in Google Guava 11.0 through 24.x before 24.1.1 allows remote attackers to conduct denial of service attacks against servers that depend on this library and deserialize attacker-provided data, because the AtomicDoubleArray class (when serialized with Java serialization) and the CompoundOrdering class (when serialized with GWT serialization) perform eager allocation without appropriate checks on what a client has sent and whether the data size is reasonable.

These CVEs need to be addressed on KeePassJava2 library.

g2vinay avatar Oct 28 '20 23:10 g2vinay

@jorabin is there any update on this ?

g2vinay avatar Nov 25 '20 19:11 g2vinay

Concerning vulnerability with SimpleXML it related to external entities https://github.com/ngallagher/simplexml/issues/18 which could be embedded into XML resulting to possible attack using references to external files/resources. I think it's inapplicable to our case, since Keepass uses XML's to store data in encrypted way, it forms XML internally and I don't see a way for attacker how to exploit this vulnerability.

Pavel Ivanov Skype: ivanovpv [email protected]

On Thu, Oct 29, 2020 at 2:45 AM Vinay Gera [email protected] wrote:

There are following CVE issues with some of the dependencies used by KeePassJava2 that need to be addressed:

  1. commons-codec:commons-codec:jar:1.10: WS-2019-0379: This library is vulnerable to information disclosure due to Improper Input validation.
  2. org.simpleframework:simple-xml:jar:2.7.1: CVE-2017-1000190 https://nvd.nist.gov/vuln/detail/CVE-2017-1000190: SimpleXML (latest version 2.7.1) is vulnerable to an XXE vulnerability resulting SSRF, information disclosure, DoS and so on.
  3. com.google.guava:guava:jar:20.0: CVE-2018-10237 https://nvd.nist.gov/vuln/detail/CVE-2018-10237 Unbounded memory allocation in Google Guava 11.0 through 24.x before 24.1.1 allows remote attackers to conduct denial of service attacks against servers that depend on this library and deserialize attacker-provided data, because the AtomicDoubleArray class (when serialized with Java serialization) and the CompoundOrdering class (when serialized with GWT serialization) perform eager allocation without appropriate checks on what a client has sent and whether the data size is reasonable.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jorabin/KeePassJava2/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7UTC76L5MRH5SJ37HOJTSNCUKJANCNFSM4TDAFLNA .

ivanovpv avatar Nov 26 '20 13:11 ivanovpv

@jorabin is there any update on this ?

Thanks for the heads up @g2vinay and thanks @ivanovpv for the analysis. I'm planning to take a bit of down time over the holiday season and will try to address this (also to merge the V4 branch which is readonly right now)

jorabin avatar Dec 01 '20 13:12 jorabin

com.carrotsearch.thirdparty:simple-xml-safe:2.7.1 appears to have a fixed version of simple-xml maybe you can use that version?

Got that from here: https://github.com/ngallagher/simplexml/issues/18

rhuddleston avatar Dec 09 '20 16:12 rhuddleston

thanks for the heads up @rhuddleston

jorabin avatar Dec 12 '20 13:12 jorabin

@jorabin any updates on the resolution of the CVEs ?

g2vinay avatar Jan 29 '21 19:01 g2vinay

Hi @g2vinay - plan to do something on this over the next few weeks. Have been delayed by being unable to run VMWare Win 10 on macOS Catalina, but that's now sorted. What's not sorted is that Travis no longer supports Java 7 etc.

jorabin avatar Feb 02 '21 08:02 jorabin

@jorabin Just checking in, if there are any updates or any ETA for the new release with CVEs fixed.

g2vinay avatar Feb 19 '21 23:02 g2vinay

The recent version of SC (com.madgag.spongycastle:core dependency of KeyPassJava2) is 1.58, forked from on BC (Bouncy Castle) 1.58, released back in 2017. Since then, there are many bc releases happened, with the latest version being BC 1.68.

It seems SC is vulnerable to several exploits - including CVE-2016-1000343 and CVE-2020-26939; it seems SC is no longer maintained https://github.com/rtyley/spongycastle/issues/34

anuchandy avatar Apr 13 '21 20:04 anuchandy

Any news about migration to Bouncy Castle? At this time, it is 1.70 (2021-11-29):

  • https://www.bouncycastle.org/releasenotes.html

Neustradamus avatar Jan 24 '22 23:01 Neustradamus

Hi, thanks for this. I do still intend to update the dependencies, merge the feature branch for v4 files and more. However I quite simply don't have the time to say that will happen soon.

jorabin avatar Feb 06 '22 12:02 jorabin

I have "finally" pushed updates that address the various vulnerabilities pointed out in this issue and in this thread, including reverting to using bouncy castle and using version of simple-xml-safe per suggestion from @rhuddleston

That being the case, and although this version 2.2 not yet pushed to maven central, I think this issue can be closed, at last, OK with you @g2vinay ?

jorabin avatar May 06 '23 15:05 jorabin

@ng-23, @jorabin: Thanks for your changes!

But can you look for update Bouncy Castle to last version?

  • https://www.bouncycastle.org/releasenotes.html

Neustradamus avatar May 20 '23 22:05 Neustradamus

Hi @Neustradamus Bouncy Castle dependency is 1.70 which is the latest version: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on

Oh, did you mean that we should be using bcprov-jdk18on? I think that we should be, actually. latest releases at bouncycastle.org i.e. https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on, in which case it's 1.73.

jorabin avatar May 22 '23 13:05 jorabin

@jorabin: Yes, it is noted here: https://www.bouncycastle.org/latest_releases.html

Neustradamus avatar May 22 '23 15:05 Neustradamus

OK, that is now on main and snapshot build deployed to sonatype.

jorabin avatar May 23 '23 10:05 jorabin

Closed in 2.2.1

jorabin avatar Aug 22 '23 11:08 jorabin

@jorabin: Thanks but have you looked new Bouncy Castle version?

Now, it is 1.76 (there was a CVE fix in 1.74):

  • https://bouncycastle.org/releasenotes.html
  • https://bouncycastle.org/latest_releases.html

Neustradamus avatar Aug 22 '23 23:08 Neustradamus

Thanks. Will pick this up in next release, maybe a couple of weeks.

jorabin avatar Aug 23 '23 09:08 jorabin