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

fabric-chaincode-shim vulnerabilities #311

Closed
benjsmi opened this issue Jul 27, 2023 · 5 comments
Closed

fabric-chaincode-shim vulnerabilities #311

benjsmi opened this issue Jul 27, 2023 · 5 comments

Comments

@benjsmi
Copy link
Contributor

benjsmi commented Jul 27, 2023

Name Found in Code CVEs Due Date Status
bcprov-jdk15on-1.62.jar https://github.com/hyperledger/fabric-chaincode-java/blob/main/fabric-chaincode-shim/build.gradle#L46 https://nvd.nist.gov/vuln/detail/CVE-2019-17359, https://nvd.nist.gov/vuln/detail/CVE-2020-26939, https://nvd.nist.gov/vuln/detail/CVE-2023-33201, https://nvd.nist.gov/vuln/detail/CVE-2020-15522 Aug 21, 2023 Addressed by #310
json-20220320.jar Transitive dependency from fabric-chaincode-shim, which is imported here: https://github.com/hyperledger/fabric-chaincode-java/blob/main/fabric-chaincode-integration-test/build.gradle#L4, and then json-20220320.jar is imported here: https://github.com/hyperledger/fabric-chaincode-java/blob/main/fabric-chaincode-shim/build.gradle#L49 https://nvd.nist.gov/vuln/detail/CVE-2022-45688 Aug 21, 2023 Addressed by #310
guava-26.0-android.jar, guava-31.0.1-jre.jar Transitive dependency, in fabric-chaincode-integration-test (https://github.com/hyperledger/fabric-chaincode-java/blob/main/fabric-chaincode-integration-test/build.gradle#L4) this time the dependency is on fabric-chaincode-shim: https://github.com/hyperledger/fabric-chaincode-java/blob/main/fabric-chaincode-shim/build.gradle#L44C5-L44C5. Shim is dependent on org.hyperledger.fabric.fabric-protos v0.2.0, which is dependent on a vulnerable version of Guava: https://central.sonatype.com/artifact/org.hyperledger.fabric/fabric-protos/0.2.0/overview. https://nvd.nist.gov/vuln/detail/CVE-2023-2976, https://nvd.nist.gov/vuln/detail/CVE-2020-8908 Oct 10, 2023 Fixed in user-facing code in #314; examples still point to old shim
json-20180813.jar Direct dependency here: https://github.com/hyperledger/fabric-chaincode-java/blob/main/fabric-chaincode-integration-test/build.gradle#L4 https://nvd.nist.gov/vuln/detail/CVE-2022-45688 Aug 21, 2023 Fixed in https://github.com/hyperledger/fabric-chaincode-java/pull/314/files
protobuf-java-3.20.1.jar Direct dependency here:
implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.20.1'
, but ALSO,
implementation "io.opentelemetry:opentelemetry-proto:1.6.0-alpha"
includes io.opentelemetry:opentelemetry-protoat 1.6.0-alpha, which includes protobuf-java at 3.20.1 as shown here: https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-proto/1.6.0-alpha. and ALSO, shim includes grpc-protobuf at v1.46, as seen here
implementation 'io.grpc:grpc-protobuf:1.46.0'
which includes protobuf-java at v3.20.1 as shown here: https://mvnrepository.com/artifact/io.grpc/grpc-protobuf/1.46.0, and also includes fabric-protos at v0.2.0 as shown here:
implementation group: 'org.hyperledger.fabric', name:'fabric-protos', version:'0.2.0'
and fabric-protos at v0.2.0 includes protobuf-java at v3.20.1 as shown here: https://mvnrepository.com/artifact/org.hyperledger.fabric/fabric-protos/0.2.0 ... AND ALSO I also see a link from fabric-chaincode-java in several examples that go to fabric-protos v0.1.3, which includes protobuf-java at v3.19.4 -- example
<artifactId>fabric-protos</artifactId>
and second example and also
https://nvd.nist.gov/vuln/detail/CVE-2022-3509, https://nvd.nist.gov/vuln/detail/CVE-2022-3510, https://nvd.nist.gov/vuln/detail/CVE-2022-3171 Oct 20, 2023 #310 definitely helps. Moved the direct dependency to v3.19.6, which is not vulnerable. It also moved io.grpc.grpc-protobuf to v1.45.4, which uses protobuf-java v3.19.6. However, this change does not address the dependency on io.opentelemetry:opentelemetry-protoat 1.6.0-alpha, or the dependency on fabric-protos at v0.2.0.
@benjsmi benjsmi changed the title Shim vulnerabilities fabric-chaincode-shim vulnerabilities Jul 27, 2023
@benjsmi
Copy link
Contributor Author

benjsmi commented Jul 27, 2023

OK; I got a lot more precise in the above description. Two of these items have been addressed by the last PR, but two remain.

@benjsmi
Copy link
Contributor Author

benjsmi commented Sep 22, 2023

@benjsmi
Copy link
Contributor Author

benjsmi commented Sep 22, 2023

Do we want to force and/or hard-code fabric-chaincode-java to v2.5.0 in this example? https://github.com/hyperledger/fabric-chaincode-java/blob/main/examples/fabric-contract-example-maven/pom.xml#L15

Probably also a good idea to update the fabric-protos version from v0.1.3 to something in the v0.2.x range. https://github.com/hyperledger/fabric-chaincode-java/blob/main/examples/fabric-contract-example-maven/pom.xml#L51

@benjsmi
Copy link
Contributor Author

benjsmi commented Sep 22, 2023

@bestbeforetoday
Copy link
Member

I think all outstanding vulnerabilities in dependencies of fabric-chaincoide-shim have now been resolved.

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

No branches or pull requests

2 participants