-
Notifications
You must be signed in to change notification settings - Fork 29
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
The library contains vulnerabilities #166
Comments
The vulnerabilities have increased as of June 2024. |
The problem with upgrading XStream is that we would still probably use a tiny blacklist rather than a whitelist as we explicitly allow any Java object to be used as an annotation feature and so need to be able to save/load any type. Unless you are exposing the ability to load an xgapp to the internet you will have control over the xgapp files you load so it's unlikely the XStream vulnerabilities are actually a big issue for GATE, although I agree it would be nice to upgrade so that people don't worry about it when looking at the dependencies. The other libraries should be easier to update, and I will give those a try when I get the chance. We are open to PRs of course so if anyone else wants to try updating them and running the tests etc. then that would be great. |
I've upgraded jackson-databind as that was an easy fix (just a change in the gate-core pom.xml). It looks like commons-compress is pulled in by Tika as part of the support for Microsoft office documents. The problem is that the newer Tika version has a different package structure and so it's not just an easy version number update. Need to look into exactly how to upgrade to the latest version properly. |
Also note that the current development version does actually use XStream 1.4.20 (and has done since last November), but we've just not done a release since then. You can grab the latest snapshot build (which includes both the latest XStream and jackson-databind) from https://gate.ac.uk/download/#snapshots |
Thanks for the heads up! Although, I cannot find any snapshot build, the link point to version 9.0.0 but I am using 9.0.1 so I think that is the latest build.
This resolved the vulnerability check but has introduced runtime errors when I run GATE application
I believe this has to do with same class files getting imported multiple times from jar. |
We don't push SNAPSHOT builds to maven central, but we do publish them into our own repo: http://repo.gate.ac.uk/content/groups/public/ if you want to reference them in your own pom.xml. If you include that repo in your build then you should be able to use 9.1-SNAPSHOT of gate-core without needing to mess with it's dependencies. The link I gave in the previous comment was to the binary distributions for the full GATE Developer download rather than just the mavwen artifacts. As to the errors you get I can see two separate issues.
Best thing would be to use our repo and pull 9.1-SNAPSHOT and see if that works, and then see if some/all of the errors go away -- although I think that plugin still needs fixing. |
Also from a very quick test, if you upgrade tika-core to 1.28.5 you'll find you've broken the ability to open documents that require it (looks like an incompatibility with the version of |
I've just pushed an updated that uses newer tika-core, poi, and commons-io and, more importantly, passes all our tests. It's already been built by the github action and is in our snapshot repo, so that should fix most of the issues now. If you could give it a try and see what you think as any feedback would be most appreciated. |
Sure! |
…able in the way 1.21 is that was being pulled in by poi. see #166
looks like there is no issue with using commons-compress 1.26.2 (all the poi based tests pass anyway) so I've done the exclude and then depend explicitly inside the gate-core pom. It's currently rebuilding but there should be a new snapshot version in our repo shortly. |
The updated SNAPSHOT build shows no vulnerabilities, so it's good. I am still facing |
When you get a “cannot cast X to X” error it means you have the same class in two different classloaders. You either have two different versions of the GATE Stanford plugin being loaded by the same app and then something like a JAPE grammar trying to refer to the DependencyRelation class, or you have a If your plugin requires classes from the Stanford plugin then the correct way to do it is to declare the dependency (from your plugin on the Stanford one) as |
Hi, I am currently trying to use the 9.1-SNAPSHOT version (due to CVEs), but I also have ClassCastExceptions. We use a plugin (Creole), which was also moved to 9.1-SNAPSHOT. Any ideas how to fix this?
|
This looks like an error compiling a JAPE grammar. Is it possible you can figure out which JAPE file is triggering the error and then share it with us? It looks like there is an issue with inner classes and the compiler we use for JAPE grammers (looks like Tomcat had the same bug) but I can't immediately see how that would be triggered by JAPE so an example grammar would be exceptionally helpful. Also what version of Java are you using, just in case that is affecting something. |
Thanks for you fast response, yes I digged quite deep into it and found the jape file, which leads to that error. The java version is actually quite old, it's openjdk-11. |
I've now fixed this and can load your example grammar. The fix is actually in the ANNIE plugin so you need to make sure you are using version 9.2-SNAPSHOT of that plugin in order for it to work. If you could test it and let me know if that solves the problem that would be most appreciated. |
@greenwoodma That fix solved the problem. Thanks for your fast support and reply, really appriciated. |
From https://mvnrepository.com/artifact/uk.ac.gate/gate-core/9.0.1
The latest version of gate-core is depending on com.thoughtworks.xstream 1.4.15, which is vulnerable.
Is there any chance to upgrade the version to 1.4.20? (com.thoughtworks.xstream 1.4.20 is vulnerability free)
The text was updated successfully, but these errors were encountered: