Skip to content

Commit 61fc700

Browse files
committed
fix(security): address CVE-2021-3749 - axios >=0.22.0
Ensured that axios is updated to >=0.22.0 in all packages that use it. The only place where it was not possible to upgrade it through upgrading transitive dependencies was the ubiquity connector package so for that one I forced the issue through the resolutions section of the root package.json. ----------------------------------------------- The GitHub Cacti security advisory: https://github.com/hyperledger/cacti/security/dependabot/361 The general GitHub security advisory: GHSA-cph5-m8f7-6c5x Weaknesses - [WeaknessCWE-400](https://cwe.mitre.org/data/definitions/400.html) - [WeaknessCWE-1333](https://cwe.mitre.org/data/definitions/1333.html) CVE ID: `CVE-2021-3749` GHSA ID: `GHSA-cph5-m8f7-6c5x` Fixes #2790 [skip ci] Signed-off-by: Peter Somogyvari <[email protected]>
1 parent 4e8b553 commit 61fc700

File tree

56 files changed

+259
-906
lines changed

Some content is hidden

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

56 files changed

+259
-906
lines changed

.cspell.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
"cactusf",
2121
"cafile",
2222
"caio",
23-
"cccs",
24-
"ccep",
25-
"cccg",
2623
"cbdc",
2724
"Cbdc",
25+
"cccg",
26+
"cccs",
27+
"ccep",
2828
"ccid",
2929
"celo",
3030
"cids",
@@ -69,6 +69,7 @@
6969
"immalleable",
7070
"ipaddress",
7171
"ipfs",
72+
"IPFSHTTP",
7273
"Iroha",
7374
"Irohad",
7475
"isready",
@@ -89,8 +90,8 @@
8990
"miekg",
9091
"mitchellh",
9192
"MSPCONFIGPATH",
92-
"Mspids",
9393
"MSPID",
94+
"Mspids",
9495
"MSPIDSCOPEALLFORTX",
9596
"MSPIDSCOPEANYFORTX",
9697
"Mtls",

examples/cactus-example-carbon-accounting-business-logic-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@hyperledger/cactus-plugin-ledger-connector-fabric": "2.0.0-alpha.2",
6565
"@hyperledger/cactus-plugin-ledger-connector-xdai": "2.0.0-alpha.2",
6666
"async-exit-hook": "2.0.1",
67-
"axios": "0.21.4",
67+
"axios": "1.5.1",
6868
"express": "4.18.2",
6969
"openapi-types": "9.1.0",
7070
"typescript-optional": "2.0.1",

examples/cactus-example-cbdc-bridging-backend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@openzeppelin/contracts": "4.9.3",
7171
"@openzeppelin/contracts-upgradeable": "4.9.3",
7272
"async-exit-hook": "2.0.1",
73-
"axios": "^0.27.2",
73+
"axios": "1.5.1",
7474
"crypto-js": "4.1.1",
7575
"dotenv": "^16.0.1",
7676
"fabric-network": "2.2.19",

examples/cactus-example-discounted-asset-trade/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@hyperledger/cactus-plugin-ledger-connector-fabric": "2.0.0-alpha.2",
2525
"@hyperledger/cactus-verifier-client": "2.0.0-alpha.2",
2626
"@types/node": "14.18.54",
27-
"axios": "0.24.0",
27+
"axios": "1.5.1",
2828
"body-parser": "1.20.2",
2929
"cookie-parser": "1.4.6",
3030
"debug": "3.1.0",

examples/cactus-example-supply-chain-backend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@hyperledger/cactus-plugin-ledger-connector-quorum": "2.0.0-alpha.2",
6565
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.2",
6666
"async-exit-hook": "2.0.1",
67-
"axios": "0.21.4",
67+
"axios": "1.5.1",
6868
"dotenv": "16.0.0",
6969
"express": "4.18.2",
7070
"express-jwt": "8.4.1",

examples/cactus-example-supply-chain-business-logic-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@hyperledger/cactus-plugin-ledger-connector-fabric": "2.0.0-alpha.2",
6666
"@hyperledger/cactus-plugin-ledger-connector-quorum": "2.0.0-alpha.2",
6767
"async-exit-hook": "2.0.1",
68-
"axios": "0.21.4",
68+
"axios": "1.5.1",
6969
"express": "4.18.2",
7070
"openapi-types": "9.1.0",
7171
"typescript-optional": "2.0.1",

extensions/cactus-plugin-htlc-coordinator-besu/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@hyperledger/cactus-plugin-htlc-eth-besu-erc20": "2.0.0-alpha.2",
6565
"@hyperledger/cactus-plugin-ledger-connector-besu": "2.0.0-alpha.2",
6666
"@hyperledger/cactus-test-plugin-htlc-eth-besu-erc20": "2.0.0-alpha.2",
67-
"axios": "0.21.4",
67+
"axios": "1.5.1",
6868
"body-parser": "1.20.2",
6969
"fast-safe-stringify": "2.1.1",
7070
"joi": "14.3.1",

extensions/cactus-plugin-object-store-ipfs/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hyperledger/cactus-plugin-object-store-ipfs",
33
"version": "2.0.0-alpha.2",
4-
"description": "IPFS backed objec store plugin implementation for Hyperledger Cactus",
4+
"description": "IPFS backed object store plugin implementation for Hyperledger Cactus",
55
"keywords": [
66
"Hyperledger",
77
"Cactus",
@@ -58,7 +58,7 @@
5858
"@hyperledger/cactus-common": "2.0.0-alpha.2",
5959
"@hyperledger/cactus-core": "2.0.0-alpha.2",
6060
"@hyperledger/cactus-core-api": "2.0.0-alpha.2",
61-
"axios": "0.21.4",
61+
"axios": "1.5.1",
6262
"ipfs-http-client": "60.0.1",
6363
"run-time-error": "1.4.0",
6464
"typescript-optional": "2.0.1",
@@ -68,7 +68,7 @@
6868
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.2",
6969
"@types/express": "4.17.19",
7070
"express": "4.18.2",
71-
"ipfs-core-types": "0.6.1",
71+
"ipfs-core-types": "0.14.1",
7272
"multiformats": "9.4.9"
7373
},
7474
"engines": {

extensions/cactus-plugin-object-store-ipfs/src/main/typescript/i-ipfs-http-client.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { IPFS } from "ipfs-core-types";
2-
import type { EndpointConfig } from "ipfs-http-client";
2+
import type { EndpointConfig, IPFSHTTPClient } from "ipfs-http-client";
33

44
export interface IIpfsHttpClient extends IPFS {
55
getEndpointConfig: () => EndpointConfig;
66
}
77

8-
export function isIpfsHttpClientOptions(x: unknown): x is IIpfsHttpClient {
8+
export function isIpfsHttpClientOptions(x: unknown): x is IPFSHTTPClient {
99
if (!x) {
1010
return false;
1111
}

extensions/cactus-plugin-object-store-ipfs/src/main/typescript/plugin-object-store-ipfs.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "path";
22
import type { Express } from "express";
3-
import { create } from "ipfs-http-client";
3+
import { create, IPFSHTTPClient } from "ipfs-http-client";
44
import type { Options } from "ipfs-http-client";
55
import { RuntimeError } from "run-time-error";
66
import { Logger, Checks, LoggerProvider } from "@hyperledger/cactus-common";
@@ -22,7 +22,6 @@ import OAS from "../json/openapi.json";
2222
import { GetObjectEndpointV1 } from "./web-services/get-object-endpoint-v1";
2323
import { SetObjectEndpointV1 } from "./web-services/set-object-endpoint-v1";
2424
import { HasObjectEndpointV1 } from "./web-services/has-object-endpoint-v1";
25-
import type { IIpfsHttpClient } from "./i-ipfs-http-client";
2625
import { isIpfsHttpClientOptions } from "./i-ipfs-http-client";
2726

2827
export const K_IPFS_JS_HTTP_ERROR_FILE_DOES_NOT_EXIST =
@@ -31,13 +30,13 @@ export const K_IPFS_JS_HTTP_ERROR_FILE_DOES_NOT_EXIST =
3130
export interface IPluginObjectStoreIpfsOptions extends ICactusPluginOptions {
3231
readonly logLevel?: LogLevelDesc;
3332
readonly parentDir: string;
34-
readonly ipfsClientOrOptions: Options | IIpfsHttpClient;
33+
readonly ipfsClientOrOptions: Options | IPFSHTTPClient;
3534
}
3635

3736
export class PluginObjectStoreIpfs implements IPluginObjectStore {
3837
public static readonly CLASS_NAME = "PluginObjectStoreIpfs";
3938

40-
private readonly ipfs: IIpfsHttpClient;
39+
private readonly ipfs: IPFSHTTPClient;
4140
private readonly log: Logger;
4241
private readonly instanceId: string;
4342
private readonly parentDir: string;

extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-http-client-mock.ts

-234
This file was deleted.

0 commit comments

Comments
 (0)