Skip to content

Commit ba9825c

Browse files
force npm to use cross-spawn@7.0.5 fix CVE-2024-21538
1 parent 2c8b2c4 commit ba9825c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ RUN $APT_UPDATE && $APT_INSTALL \
2727
unzip software-properties-common apt-transport-https \
2828
openjdk-11-jdk xvfb siege apache2-utils git make nodejs locales tsung libtool libssl-dev libyaml-dev libxml2-dev libxslt-dev
2929

30+
31+
# force npm to use cross-spawn@7.0.5, this block can be removed when new version of nodejs uses cross-spawn@7.0.5
32+
RUN npm_root=$(npm root -g) \
33+
&& npm pack cross-spawn@7.0.5 -q \
34+
&& mkdir -p "$npm_root/npm/node_modules/cross-spawn" \
35+
&& tar -xzf cross-spawn-7.0.5.tgz \
36+
--strip-components=1 \
37+
-C "$npm_root/npm/node_modules/cross-spawn" \
38+
&& rm cross-spawn-7.0.5.tgz \
39+
3040
# Install .NET sdk
3141
# check this page for the links and hash
3242
# https://dotnetcli.azureedge.net/dotnet/release-metadata/8.0/releases.json

0 commit comments

Comments
 (0)