-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
High CVE's Present in karate-core #1834
Comments
Great idea. We could also set it up in the GitHub actions pipeline to get the results easily available. |
@packleader as a first step, please submit a PR for the armeria upgrade, lets confirm if the build passes |
armeria became stricter which breaks mock + proxy functionality taking the hit for now assuming hardly anyone uses that mode
build failed after armeria upgrade, just noting here for future reference:
|
all: okay, I got the build to work, please validate. contributions for anything else welcome |
Thanks for proposing a fix. I had intended to work on this, but I've been having issues with my PC and haven't had time to fix them. I'll try to take a look at the PR between now and Saturday and provide any feedback. |
I merged the latest changes from This brings up my earlier point that it may not be possible to remove all the high-severity CVE's from Our team uses Karate to run functional and performance tests against live servers in our test environment, so we don't need the mock server functionality. In my experience, most CVE's are related to dependencies that enable running a simple server (Armeria, Thymeleaf, Netty, etc.) Moving those dependencies and the mock server code into another module would help isolate the CVE's and decouple them from the core test-execution capabilities of Karate. I recognize that this would be a significant change, so I'm curious to hear your thoughts. |
@packleader sure, I'm open to making this structural change. one addition is that thymeleaf is needed for the html reports, so we may be talking about 3 JARS - there is a proposed refactor to clean-up cookies that may be relevant: #1708 I have to say that I personally will not have the bandwidth to look at this over the next four or so months. perhaps the best thing is for someone to contribute the non-shading first (and the github action for CVEs is nice to have) and I can of course review and support. the |
@packleader note that thymeleaf just released a version 3.0.14 specifically for security fixes: https://www.thymeleaf.org/releasenotes.html#thymeleaf-3.0.14 I've updated, in case that helps. |
I've submitted a PR to fix another finding and add the Dependency Checker plugin. I hope to have another PR for the un-shaded JAR later this month. I can tackle the task of splitting up |
Issue #1834 - Fix for High Severity CVE's in karate-core
@packleader thank you. the build did seem to pass on the second try. I moved the plugin into a new maven profile, so to run it we can do:
I'll add it to our release process checklist |
@packleader we released 1.2.0.RC2 so please see if that looks good in your env: https://twitter.com/getkarate/status/1471710785051103233 |
Thanks. I have confirmed that If you're able to release |
@packleader great ! |
I finally got around to working on the non-shaded JAR, and here's what I found. If we want to publish both a shaded and non-shaded version of the JAR, the official documentation states that the plugin supports having the non-shaded JAR as the primary (or default) artifact in Maven Central. The shaded JAR would then be published as a secondary artifact. So the non-shaded JAR would be <dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-core</artifactId>
<version>1.2.0</version>
</dependency> And the shaded JAR would be <dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-core</artifactId>
<version>1.2.0</version>
<classifier>standalone</classifier>
</dependency> If that works for you, then I can submit a PR with the necessary changes. |
@packleader inviting comments from others. so for those who need the shaded JAR will the artifact-id be |
I'm flexible on the name; I think The artifact-id will still be Both JARs would be published to Maven Central under I've opened #1916 so that you can test out the changes if you want. |
Issue #1834 - Publish Non-Shaded JAR For karate-core
1.2.0 released |
Two high-severity CVE's are present in
1.2.0.RC1
ofkarate-core
. My company has a strict policy that we are not permitted to use any open source projects that have vulnerabilities with a score >= 7.0. As a result, we will be unable to continue using Karate until the issue is resolved. I can't say with certainty, but I would image that many large corporations have similar policies in place.Evidence
The official OWASP site recommends using the Dependency-Check Maven plugin to scan projects for vulnerabilities. This plugin can be applied two ways, as shown below.
Method 1: At compile-time, scan all of the dependencies used by Karate.
mvn clean verify
from the root.[ERROR] netty-transport-4.1.63.Final.jar: CVE-2021-37136, CVE-2021-37137
Method 2: Scan the
karate-core
library directly.pom.xml
into a clean directory.mvn clean verify
from the root.[ERROR] karate-core-1.2.0.RC1.jar\META-INF/maven/io.netty/netty-transport/pom.xml: CVE-2021-37136, CVE-2021-37137
Analysis
Karate depends on
io.netty:netty-transport:4.1.63.Final
which is the subject of CVE-2021-37136 and CVE-2021-37137. Becausekarate-core
is a shaded JAR, it inherits the CVE's of any JAR's which are packaged inside it. Thus, industry-standard scanners (such as Dependency-Check) will report thatcom.intuit.karate:karate-core:1.2.0.RC1
contains two CVE's.Proposed Solution
Required: Update Karate's dependency list to include a newer version of Netty which does not have any open CVE's. More specifically, I propose updating
com.linecorp.armeria:armeria
from version1.8.0
to1.12.0
or higher inkarate-core
.Optional: Build and publish two versions of the
karate-core
JAR - one standard, and one shaded. Providing a non-shaded version ofkarate-core
will allow users (like me) to optionally specify our dependencies at runtime. This adds some overhead to the Karate project but provides a future-proof solution. With a shaded JAR, the dependencies are tightly-coupled. So when a new CVE is discovered in a dependency, the shaded JAR inherits that CVE and there's no way I can work around it. With a non-shaded JAR, I can mitigate the new CVE by explicitly declaring a newer version of the dependency in my POM.Let me know your thoughts on the above, and I can start work on it.
The text was updated successfully, but these errors were encountered: