Skip to content

Commit 840834e

Browse files
owlcodefanatid
authored andcommitted
Update elliptic to 6.5.7 (CVE-2024-42461) (#206)
* Update elliptic to 6.5.7 (CVE-2024-42461) In the Elliptic package 6.5.6 for Node.js, ECDSA signature malleability occurs because BER-encoded signatures are allowed. See https://nvd.nist.gov/vuln/detail/CVE-2024-42461 https://security.snyk.io/vuln/SNYK-JS-ELLIPTIC-7577918
1 parent f73cd3a commit 840834e

File tree

3 files changed

+35
-46
lines changed

3 files changed

+35
-46
lines changed

.github/workflows/ci.yaml

+27-38
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,21 @@ jobs:
1818
- windows-latest
1919
steps:
2020
- name: Fetch code
21-
uses: actions/checkout@v1
21+
uses: actions/checkout@v4
2222
with:
2323
submodules: true
2424

25+
- name: Get minimal Node.js version from package.json
26+
id: node-version
27+
run: echo "::set-output name=version::$(node -p 'require("./package.json").engines.node.match(/(\d+)\..*$/)[1]')"
28+
29+
- name: Use Node.js ${{ steps.node-version.outputs.version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ steps.node-version.outputs.version }}
33+
2534
- name: Install dependencies
26-
run: yarn install --ignore-scripts
35+
run: npm install --ignore-scripts
2736

2837
- name: Build addon
2938
if: runner.os != 'Linux'
@@ -33,33 +42,11 @@ jobs:
3342
if: runner.os == 'Linux'
3443
run: make build-addon-linux
3544

36-
- name: Get minimal Node.js version from package.json (Linux & macOS)
37-
id: node-version-nix
38-
if: runner.os != 'Windows'
39-
run: echo "::set-output name=version::$(node -p 'require("./package.json").engines.node.match(/(\d.*)$/)[0]')"
40-
41-
- name: Use Node.js ${{ steps.node-version-nix.outputs.version }} (Linux & macOS)
42-
if: runner.os != 'Windows'
43-
uses: actions/setup-node@v1
44-
with:
45-
node-version: ${{ steps.node-version-nix.outputs.version }}
46-
47-
- name: Get minimal Node.js version from package.json (Windows)
48-
id: node-version-win
49-
if: runner.os == 'Windows'
50-
run: echo "::set-output name=version::$(node -p 'require(\"./package.json\").engines.node.match(/(\d.*)$/)[0]')"
51-
52-
- name: Use Node.js ${{ steps.node-version-win.outputs.version }} (Windows)
53-
if: runner.os == 'Windows'
54-
uses: actions/setup-node@v1
55-
with:
56-
node-version: ${{ steps.node-version-win.outputs.version }}
57-
5845
- name: Run tests for addon
5946
run: make test-tap
6047

6148
- name: Upload prebuilds
62-
uses: actions/upload-artifact@v1
49+
uses: actions/upload-artifact@v4
6350
with:
6451
name: addon-${{ runner.os }}
6552
path: prebuilds
@@ -70,30 +57,34 @@ jobs:
7057
runs-on: ubuntu-latest
7158
steps:
7259
- name: Fetch code
73-
uses: actions/checkout@v1
60+
uses: actions/checkout@v4
7461
with:
7562
submodules: true
7663

7764
- name: Install dependencies
78-
run: yarn install --ignore-scripts
65+
run: npm install --ignore-scripts
7966

8067
- name: Download macOS addon
81-
uses: actions/download-artifact@v1
68+
uses: actions/download-artifact@v4
8269
with:
8370
name: addon-macOS
8471

8572
- name: Download Linux addon
86-
uses: actions/download-artifact@v1
73+
uses: actions/download-artifact@v4
8774
with:
8875
name: addon-Linux
8976

9077
- name: Download Windows addon
91-
uses: actions/download-artifact@v1
78+
uses: actions/download-artifact@v4
9279
with:
9380
name: addon-Windows
9481

9582
- name: Move addons to one folder
96-
run: mkdir prebuilds && mv ./addon-*/* ./prebuilds/
83+
run: |
84+
mkdir prebuilds
85+
mv darwin-arm64 prebuilds
86+
mv linux-x64 prebuilds
87+
mv win32-x64 prebuilds
9788
9889
- name: Build package
9990
run: make package
@@ -103,7 +94,7 @@ jobs:
10394
run: echo "::set-output name=version::$(node -p 'require("./package.json").version')"
10495

10596
- name: Upload package
106-
uses: actions/upload-artifact@v1
97+
uses: actions/upload-artifact@v4
10798
with:
10899
name: package
109100
path: secp256k1-${{ steps.pkg-version.outputs.version }}.tgz
@@ -113,11 +104,11 @@ jobs:
113104
runs-on: ubuntu-latest
114105
steps:
115106
- name: Fetch code
116-
uses: actions/checkout@v1
107+
uses: actions/checkout@v4
117108
with:
118109
fetch-depth: 1
119110

120-
- uses: actions/cache@v1
111+
- uses: actions/cache@v4
121112
id: cache
122113
with:
123114
path: clang
@@ -137,12 +128,10 @@ jobs:
137128
runs-on: ubuntu-latest
138129
steps:
139130
- name: Fetch code
140-
uses: actions/checkout@v1
141-
with:
142-
fetch-depth: 1
131+
uses: actions/checkout@v4
143132

144133
- name: Install dependencies
145-
run: yarn install --ignore-scripts
134+
run: npm install --ignore-scripts
146135

147136
- name: Run lint command
148137
run: make lint-js

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ prebuildify-cross = ./node_modules/.bin/prebuildify-cross
99
# hack, otherwise GitHub Actions for Windows:
1010
# '.' is not recognized as an internal or external command, operable program or batch file.
1111
build-addon:
12-
$(prebuildify) --target node@10.0.0 --napi --strip && node -p "process.platform"
12+
$(prebuildify) --target node@18.0.0 --napi --strip && node -p "process.platform"
1313

1414
build-addon-linux:
15-
$(prebuildify-cross) -i centos7-devtoolset7 -i alpine --target node@10.0.0 --napi --strip
15+
$(prebuildify-cross) -i centos7-devtoolset7 -i alpine --target node@18.0.0 --napi --strip
1616

1717

1818
nyc = ./node_modules/.bin/nyc

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@
3232
"install": "node-gyp-build || exit 0"
3333
},
3434
"dependencies": {
35-
"elliptic": "^6.5.4",
36-
"node-addon-api": "^2.0.0",
35+
"elliptic": "^6.5.7",
36+
"node-addon-api": "^5.0.0",
3737
"node-gyp-build": "^4.2.0"
3838
},
3939
"devDependencies": {
40-
"node-gyp": "^5.0.7",
40+
"node-gyp": "=10.1.0",
4141
"nyc": "^15.0.0",
42-
"prebuildify": "^5.0.0",
43-
"prebuildify-cross": "^4.0.2",
42+
"prebuildify": "^6.0.1",
43+
"prebuildify-cross": "github:fanatid/prebuildify-cross#9f7af67698f06e07d42304d9813a6f19aee5812c",
4444
"standard": "^14.3.1",
4545
"tap-dot": "^2.0.0",
4646
"tape": "^4.10.1",
4747
"xorshift.js": "^1.0.3",
4848
"yargs": "^15.0.2"
4949
},
5050
"engines": {
51-
"node": ">=10.0.0"
51+
"node": ">=18.0.0"
5252
},
5353
"gypfile": true
5454
}

0 commit comments

Comments
 (0)