-
Notifications
You must be signed in to change notification settings - Fork 8.4k
fix: 1.8.0 security fixes #11449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: 1.8.0 security fixes #11449
Changes from 2 commits
a21bd55
0b67719
af83030
461f2ee
7b194af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -74,21 +74,31 @@ RUN --mount=type=cache,target=/root/.cache/uv \ | |||||||||||||||||||||||||||||||||||||||||||||||||||
| # RUNTIME | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Setup user, utilities and copy the virtual environment only | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ################################ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM python:3.12.3-slim AS runtime | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM python:3.12.12-slim-trixie AS runtime | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN apt-get update \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && apt-get upgrade -y \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && apt-get install -y git libpq5 curl gnupg \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && apt-get install -y nodejs \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && apt-get install --no-install-recommends -y curl git libpq5 gnupg xz-utils \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && apt-get clean \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && rm -rf /var/lib/apt/lists/* \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # and we use the venv at the root because workspaces | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| COPY --from=builder --chown=1000 /app/.venv /app/.venv | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN ARCH=$(dpkg --print-architecture) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && if [ "$ARCH" = "amd64" ]; then NODE_ARCH="x64"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| else NODE_ARCH="$ARCH"; fi \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| | head -1) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| | tar -xJ -C /usr/local --strip-components=1 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && npm install -g npm@latest \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| && npm cache clean --force | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+85
to
+95
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the Dockerfile
fd -type f -name "build_and_push_base.Dockerfile"Repository: langflow-ai/langflow Length of output: 234 🏁 Script executed: # Read the specific lines mentioned in the review (85-95)
sed -n '85,95p' docker/build_and_push_base.DockerfileRepository: langflow-ai/langflow Length of output: 689 🏁 Script executed: # Check if Node.js dist provides SHASUMS256.txt
# Test with a sample Node.js release URL
curl -fsSL --head https://nodejs.org/dist/latest-v22.x/SHASUMS256.txt | head -5Repository: langflow-ai/langflow Length of output: 205 🌐 Web query:
💡 Result: Best practices for verifying an official Node.js tarball with
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN ARCH=$(dpkg --print-architecture) \ | |
| && if [ "$ARCH" = "amd64" ]; then NODE_ARCH="x64"; \ | |
| elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ | |
| else NODE_ARCH="$ARCH"; fi \ | |
| && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ | |
| | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ | |
| | head -1) \ | |
| && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ | |
| | tar -xJ -C /usr/local --strip-components=1 \ | |
| && npm install -g npm@latest \ | |
| && npm cache clean --force | |
| RUN ARCH=$(dpkg --print-architecture) \ | |
| && if [ "$ARCH" = "amd64" ]; then NODE_ARCH="x64"; \ | |
| elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ | |
| else NODE_ARCH="$ARCH"; fi \ | |
| && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ | |
| | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ | |
| | head -1) \ | |
| && curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt" \ | |
| && curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ | |
| && grep " node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz$" SHASUMS256.txt | sha256sum -c - \ | |
| && tar -xJf "node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" -C /usr/local --strip-components=1 \ | |
| && rm -f "node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" SHASUMS256.txt \ | |
| && npm install -g npm@latest \ | |
| && npm cache clean --force |
🤖 Prompt for AI Agents
In `@docker/build_and_push_base.Dockerfile` around lines 85 - 95, Download the
matching SHASUMS256.txt for the selected NODE_VERSION and NODE_ARCH (the same
base URL used to fetch the tarball), compute the SHA256 of the downloaded
tarball and compare it against the expected checksum from SHASUMS256.txt before
running the tar -xJ extraction; update the block that sets
NODE_VERSION/NODE_ARCH and performs the curl | tar pipeline to first curl and
save the tarball and the SHASUMS256.txt, verify the tarball checksum matches the
entry for node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz, and only then extract
and run npm install; optionally add steps to download and verify
SHASUMS256.txt.sig with Node.js release GPG keys for stronger validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 46
🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 666
🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 499
🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 1081
🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 926
🌐 Web query:
Node.js official distribution SHASUMS256.txt verification downloads💡 Result:
Where to download the official checksum files (per release)
For a specific Node.js version
vX.Y.Z, the official artifacts live in the release directory, which includes:SHASUMS256.txt(SHA-256 checksums)SHASUMS256.txt.sig(GPG detached signature)SHASUMS256.txt.asc(ASCII-armored signature file)Example directory listing:
.../download/release/v24.0.0/shows these files. [1]Download + verify (recommended: verify the signed checksums, then verify your binary)
# 1) Download the Node.js binary you want + the checksum + signature curl -O https://nodejs.org/download/release/vX.Y.Z/node-vX.Y.Z-linux-x64.tar.xz curl -O https://nodejs.org/download/release/vX.Y.Z/SHASUMS256.txt curl -O https://nodejs.org/download/release/vX.Y.Z/SHASUMS256.txt.sig# 2) Get trusted release signing keys (recommended source: nodejs/release-keys) git clone https://github.com/nodejs/release-keys.git# 4) Verify your download matches the published checksum sha256sum -c SHASUMS256.txt --ignore-missingThe
gpg --verify ...flow and the checksum verification flow above are the standard Node.js instructions, andnodejs/release-keysprovides a ready-to-use keyring for verification. [2] [3]Notes
SHASUMS256.txt.sig) forSHASUMS256.txt. [2]Sources
[1] Node.js release directory listing (example) showing
SHASUMS256.txt,.sig,.ascfiles[2] Node.js README “Verifying binaries” instructions (download checksums + verify with
gpg+ verify withsha256sum)[3]
nodejs/release-keysrepository instructions for verifying release packages using the provided keyring🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 46
🏁 Script executed:
Repository: langflow-ai/langflow
Length of output: 4458
Verify Node.js tarball integrity before extraction.
Checksum verification is missing for the downloaded Node.js tarball. Node.js releases provide
SHASUMS256.txtfiles for this exact purpose, and integrity verification should be performed before extraction to ensure supply-chain security.🔐 Suggested checksum verification
RUN ARCH=$(dpkg --print-architecture) \ && if [ "$ARCH" = "amd64" ]; then NODE_ARCH="x64"; \ elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ else NODE_ARCH="$ARCH"; fi \ && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ | head -1) \ - && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - | tar -xJ -C /usr/local --strip-components=1 \ + && curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt" \ + && curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ + && grep " node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz$" SHASUMS256.txt | sha256sum -c - \ + && tar -xJf "node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" -C /usr/local --strip-components=1 \ + && rm -f "node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" SHASUMS256.txt \ && npm install -g npm@latest \ && npm cache clean --force📝 Committable suggestion
🤖 Prompt for AI Agents