Skip to content

Commit 1148b9d

Browse files
Update dependencies to address security vulnerabilities (#314)
- CVE-2022-25647 - CVE-2023-2976 - CVE-2020-8908 Also: - Update Gradle wrapper version to resolve Gradle bug in handling certain dependency JAR files. - Update Gradle shadowJar plugin to v7.1.2 (except for bare-gradle contract, since builder uses Gradle v5 if no wrapper is provided). - Add mergeServiceFiles() to test chaincode shadowJar Gradle tasks to resolve an issue with incorrect class versions being loaded from dependencies. - Add ServicesResourceTransformer to test chaincode maven-shade-plugin Maven plugin configuration to resolve an issue with incorrect class versions being loaded from dependencies. - Tidy-up integration test contract dependencies. Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 3b5b2cb commit 1148b9d

File tree

43 files changed

+650
-474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+650
-474
lines changed

dependency-suppression.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3+
<suppress>
4+
<notes><![CDATA[
5+
Core Fabric Go implementation vulnerability, not fabric-protos.
6+
]]></notes>
7+
<packageUrl regex="true">^pkg:maven/org\.hyperledger\.fabric/fabric\-protos@.*$</packageUrl>
8+
<cve>CVE-2022-31121</cve>
9+
</suppress>
10+
<suppress>
11+
<notes><![CDATA[
12+
Core Fabric Go implementation vulnerability, not fabric-protos.
13+
]]></notes>
14+
<packageUrl regex="true">^pkg:maven/org\.hyperledger\.fabric/fabric\-protos@.*$</packageUrl>
15+
<cve>CVE-2022-36023</cve>
16+
</suppress>
17+
<suppress>
18+
<notes><![CDATA[
19+
Vulnerability in C++ gRPC implementation.
20+
]]></notes>
21+
<packageUrl regex="true">^pkg:maven/io\.opentelemetry\.instrumentation/opentelemetry\-grpc\-1\.6@.*$</packageUrl>
22+
<cve>CVE-2023-33953</cve>
23+
</suppress>
24+
<suppress>
25+
<notes><![CDATA[
26+
Vulnerability in C++ gRPC implementation.
27+
]]></notes>
28+
<packageUrl regex="true">^pkg:maven/io\.opentelemetry\.instrumentation/opentelemetry\-grpc\-1\.6@.*$</packageUrl>
29+
<cve>CVE-2023-32732</cve>
30+
</suppress>
31+
<suppress>
32+
<notes><![CDATA[
33+
Vulnerability in hutool-json, which is not used.
34+
]]></notes>
35+
<packageUrl regex="true">^pkg:maven/org\.json/json@.*$</packageUrl>
36+
<cve>CVE-2022-45688</cve>
37+
</suppress>
38+
</suppressions>

examples/fabric-contract-example-as-service/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'com.github.johnrengelman.shadow' version '2.0.3'
2+
id 'com.github.johnrengelman.shadow' version '7.1.2'
33
id 'java'
44
}
55

@@ -21,7 +21,7 @@ repositories {
2121

2222
dependencies {
2323
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.3.+'
24-
compile group: 'org.json', name: 'json', version: '20180813'
24+
compile 'org.json:json:20230618'
2525
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
2626
testImplementation 'org.assertj:assertj-core:3.11.1'
2727
testImplementation 'org.mockito:mockito-core:2.+'
@@ -31,6 +31,7 @@ shadowJar {
3131
baseName = 'chaincode'
3232
version = null
3333
classifier = null
34+
mergeServiceFiles()
3435

3536
manifest {
3637
attributes 'Main-Class': 'org.example.Application'

examples/fabric-contract-example-gradle-kotlin/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
55

66

77
plugins {
8-
id("com.github.johnrengelman.shadow") version "5.2.0"
8+
id("com.github.johnrengelman.shadow") version "7.1.2"
99
id("org.jetbrains.kotlin.jvm") version "1.3.41"
1010
}
1111

@@ -20,7 +20,7 @@ java {
2020

2121
dependencies {
2222
implementation("org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.0")
23-
implementation("org.json:json:20180813")
23+
implementation("org.json:json:20230618")
2424
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
2525

2626
testImplementation("org.junit.jupiter:junit-jupiter:5.4.2")
@@ -44,6 +44,7 @@ tasks {
4444
baseName = "chaincode"
4545
version = null
4646
classifier = null
47+
mergeServiceFiles()
4748
manifest {
4849
attributes(mapOf("Main-Class" to "org.hyperledger.fabric.contract.ContractRouter"))
4950
}
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)