Skip to content

Conversation

gjav92
Copy link

@gjav92 gjav92 commented Sep 18, 2025

Summary

This PR addresses critical security vulnerabilities (CVEs) in the Docker images by:

  • Fixing CVE-2019-10744 (lodash prototype pollution)
  • Fixing CVE-2022-41853 (hsqldb vulnerability)
  • Fixing CVE-2025-7783 (form-data unsafe random function)
  • Updating base image from Debian Bookworm to Trixie and Java from 17 to 21

Changes

Security Fixes

  1. Package-level resolutions (package.json)

    • Added yarn resolutions for [email protected] and form-data@^2.5.4 to fix vulnerabilities in transitive dependencies
  2. Docker-specific patches

    • CVE-2019-10744: Added targeted patch for jshs2 package's nested lodash dependency
      • jshs2 is unmaintained (last updated 2017) and bundles vulnerable lodash 3.10.1
      • Temporary fix until migration to modern hive-driver package
    • CVE-2022-41853: Patch JDBC hsqldb JAR from 2.3.2 to 2.7.1 (cannot be fixed via npm/yarn)
  3. Base image security updates

    • Updated Node.js base image from Debian Bookworm (12.11) to Trixie (13.1)
    • Upgraded OpenJDK from 17 to 21 for improved security and performance
    • Addresses additional critical CVEs resolved by newer Debian packages

Critical CVEs Fixed:

  • CVE-2019-10744: lodash prototype pollution (jshs2 patch)
  • CVE-2022-41853: hsqldb RCE vulnerability (JAR update)
  • CVE-2025-7783: form-data unsafe random function (resolutions)
  • Multiple OS-level CVEs resolved by Debian Trixie base image

Notes

  • The jshs2 lodash patch is a pragmatic temporary solution. A proper fix would involve migrating from the unmaintained jshs2 to the actively maintained hive-driver package, which would require code refactoring.
  • All security patches are clearly documented in the Dockerfiles for future maintainers
  • Base image update provides additional security hardening beyond application-level fixes

Fixes security vulnerabilities identified in Docker image scans with Trivy.

@gjav92 gjav92 requested a review from a team as a code owner September 18, 2025 05:38
@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Sep 18, 2025
…; upgrade OpenJDK to 21 in Dockerfile

Update debian base image in jdk Dockerfile
@gjav92 gjav92 force-pushed the security/jdk-dockerfile-cve-critical-fix branch from 2f2f023 to f609e02 Compare September 18, 2025 05:43
@gjav92 gjav92 closed this Sep 18, 2025
@gjav92 gjav92 reopened this Sep 18, 2025
cp -r /cube/node_modules/lodash /cube/node_modules/jshs2/node_modules/; \
fi

# FIX CVE-2022-41853: Update hsqldb from 2.3.2 to 2.7.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you trying to fix it here, kind of in the end of the store instead of fixing it in first place? I mean, this should be fixed in https://github.com/cube-js/node-jdbc with the updated versions/references here in cube


FROM node:22.18.0-bookworm-slim
&& yarn cache clean \
# FIX CVE-2019-10744: Patch lodash in unmaintained jshs2 package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really needed, as you already provided "jshs2/**/lodash": "4.17.21" in yarn resolutions?

# python3 package is necessary to install `python3` executable for node-gyp
# libpython3-dev is needed to trigger post-installer to download native with python
&& apt-get install -y python3 python3.11 libpython3.11-dev gcc g++ make cmake openjdk-17-jdk-headless \
&& apt-get install -y python3 python3-dev gcc g++ make cmake openjdk-21-jdk-headless wget \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain the reason for jumping to JDK 21?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:community Contribution from Cube.js community members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants