Skip to content

Commit 2f2f023

Browse files
committed
chore(dependencies): Update lodash to 4.17.21 and patch jshs2 package; upgrade OpenJDK to 21 in Dockerfile
Update debian base image in jdk Dockerfile
1 parent 96908c3 commit 2f2f023

File tree

3 files changed

+357
-11888
lines changed

3 files changed

+357
-11888
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@
6767
},
6868
"resolutions": {
6969
"es5-ext": "0.10.53",
70-
"lodash": "^4.17.0",
70+
"lodash": "4.17.21",
71+
"**/lodash": "4.17.21",
72+
"jshs2/**/lodash": "4.17.21",
73+
"**/jshs2/lodash": "4.17.21",
74+
"**/form-data": "^2.5.4",
7175
"@types/node": "^20",
7276
"@types/ramda": "0.27.40",
7377
"thrift": "0.20.0"

packages/cubejs-docker/latest-debian-jdk.Dockerfile

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile-upstream:master-experimental
2-
FROM node:22.18.0-bookworm-slim AS builder
2+
FROM node:22-trixie-slim AS builder
33

44
WORKDIR /cube
55
COPY . .
@@ -12,17 +12,33 @@ RUN yarn config set network-timeout 120000 -g
1212
RUN apt-get update \
1313
# python3 package is necessary to install `python3` executable for node-gyp
1414
# libpython3-dev is needed to trigger post-installer to download native with python
15-
&& apt-get install -y python3 python3.11 libpython3.11-dev gcc g++ make cmake openjdk-17-jdk-headless \
15+
&& apt-get install -y python3 python3-dev gcc g++ make cmake openjdk-21-jdk-headless wget \
1616
&& rm -rf /var/lib/apt/lists/*
1717

1818
# We are copying root yarn.lock file to the context folder during the Publish GH
1919
# action. So, a process will use the root lock file here.
2020
RUN yarn install --prod \
2121
# Remove DuckDB sources to reduce image size
2222
&& rm -rf /cube/node_modules/duckdb/src \
23-
&& yarn cache clean
24-
25-
FROM node:22.18.0-bookworm-slim
23+
&& yarn cache clean \
24+
# FIX CVE-2019-10744: Patch lodash in unmaintained jshs2 package
25+
# jshs2 hasn't been updated since 2017 and bundles lodash 3.10.1 with critical vulnerabilities
26+
# This is a temporary fix until migration to hive-driver is completed
27+
&& if [ -d /cube/node_modules/jshs2/node_modules/lodash ]; then \
28+
echo "Patching lodash in jshs2 from 3.10.1 to 4.17.21 (CVE-2019-10744 fix)" && \
29+
rm -rf /cube/node_modules/jshs2/node_modules/lodash && \
30+
cp -r /cube/node_modules/lodash /cube/node_modules/jshs2/node_modules/; \
31+
fi
32+
33+
# FIX CVE-2022-41853: Update hsqldb from 2.3.2 to 2.7.1
34+
# Note: This is a JAR file that cannot be fixed via npm/yarn resolutions
35+
RUN wget -O /tmp/hsqldb-2.7.1.jar https://repo1.maven.org/maven2/org/hsqldb/hsqldb/2.7.1/hsqldb-2.7.1.jar \
36+
&& if [ -f /cube/node_modules/@cubejs-backend/jdbc/drivers-10.17/hsqldb.jar ]; then \
37+
mv /tmp/hsqldb-2.7.1.jar /cube/node_modules/@cubejs-backend/jdbc/drivers-10.17/hsqldb.jar; \
38+
fi \
39+
&& rm -f /tmp/hsqldb-2.7.1.jar
40+
41+
FROM node:22-trixie-slim
2642

2743
ARG IMAGE_VERSION=unknown
2844

@@ -32,7 +48,7 @@ ENV CUBEJS_DOCKER_IMAGE_TAG=latest
3248
RUN groupadd cube && useradd -ms /bin/bash -g cube cube \
3349
&& DEBIAN_FRONTEND=noninteractive \
3450
&& apt-get update \
35-
&& apt-get install -y --no-install-recommends libssl3 openjdk-17-jre-headless python3.11 libpython3.11-dev \
51+
&& apt-get install -y --no-install-recommends libssl3 openjdk-21-jre-headless python3 python3-dev \
3652
&& rm -rf /var/lib/apt/lists/* \
3753
&& mkdir cube \
3854
&& chown -R cube:cube /tmp /cube /usr

0 commit comments

Comments
 (0)