Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ RUN mkdir -p /home/cronos/data && mkdir -p /home/cronos/config
RUN apt-get update -y && apt-get install wget curl procps net-tools jq lz4 -y

# Download and verify tarball
RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.5.3/cronos_1.5.3_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.3_Linux_x86_64.tar.gz \
&& rm cronos_1.5.3_Linux_x86_64.tar.gz && mv ./* /home/cronos/
RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.5.1/cronos_1.5.3-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.3-testnet_Linux_x86_64.tar.gz \
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove --no-check-certificate flag for security.

Disabling certificate validation via --no-check-certificate introduces a man-in-the-middle attack vector, even in a trusted Docker build environment. This is a security best practice violation.

Apply this fix to remove the flag:

-RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.5.1/cronos_1.5.3-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.3-testnet_Linux_x86_64.tar.gz \
+RUN cd /tmp && wget https://github.com/crypto-org-chain/cronos/releases/download/v1.5.1/cronos_1.5.3-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.3-testnet_Linux_x86_64.tar.gz \

If certificate issues persist in your build environment, consider updating the base image (bullseye-slim includes current CA certificates) rather than disabling verification.

📝 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.

Suggested change
RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.5.1/cronos_1.5.3-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.3-testnet_Linux_x86_64.tar.gz \
RUN cd /tmp && wget https://github.com/crypto-org-chain/cronos/releases/download/v1.5.1/cronos_1.5.3-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.3-testnet_Linux_x86_64.tar.gz \
🧰 Tools
🪛 Checkov (3.2.334)

[high] 11-12: Ensure that certificate validation isn't disabled with wget

(CKV2_DOCKER_3)

🤖 Prompt for AI Agents
In Dockerfile around line 11, the wget invocation uses the insecure
--no-check-certificate flag; remove that flag from the RUN command and use plain
wget to fetch the tarball, and ensure the image has up-to-date CA certificates
by adding a package install (e.g., apt-get update && apt-get install -y
ca-certificates) earlier in the Dockerfile if necessary so TLS verification
succeeds during build.

&& rm cronos_1.5.3-testnet_Linux_x86_64.tar.gz && mv ./* /home/cronos/
Comment on lines +11 to +12
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify release version: PR claims v1.5.3 but URL downloads v1.5.1.

The PR objective states "Cronos testnet image upgrade to v1.5.3", but line 11 downloads from the v1.5.1 release tag. The tarball filename references 1.5.3-testnet, creating ambiguity about which version is actually being deployed. This mismatch between the PR objective and the release tag needs clarification—is v1.5.1 the correct version, or should the URL reference v1.5.3?

Run the following script to verify the release exists and inspect its contents:


🏁 Script executed:

#!/bin/bash
# Description: Verify the v1.5.1 release and check for the expected tarball

# Fetch release metadata
gh api repos/crypto-org-chain/cronos/releases/tags/v1.5.1 --jq '.assets[] | {name, download_count}'

# Check if v1.5.3 release also exists
echo "Checking for v1.5.3 release..."
gh api repos/crypto-org-chain/cronos/releases/tags/v1.5.3 --jq '.assets[] | {name, download_count}' 2>/dev/null || echo "v1.5.3 release not found or not accessible"

Length of output: 1697



Fix critical version mismatch: URL downloads v1.5.1 but requests v1.5.3 file that doesn't exist.

Line 11 contains a breaking error: the URL references the v1.5.1 release tag, but attempts to download cronos_1.5.3-testnet_Linux_x86_64.tar.gz. This file does not exist in the v1.5.1 release (which only contains cronos_1.5.1-testnet_* files). The v1.5.3 file exists in the v1.5.3 release. This mismatch will cause the build to fail. Change the download URL from v1.5.1 to v1.5.3 to match the PR objective and the requested filename:

RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.5.3/cronos_1.5.3-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.3-testnet_Linux_x86_64.tar.gz \
     && rm cronos_1.5.3-testnet_Linux_x86_64.tar.gz && mv ./* /home/cronos/

Additionally, remove the --no-check-certificate flag to avoid disabling SSL certificate verification (security risk flagged by Checkov CKV2_DOCKER_3).

🧰 Tools
🪛 Checkov (3.2.334)

[high] 11-12: Ensure that certificate validation isn't disabled with wget

(CKV2_DOCKER_3)

🤖 Prompt for AI Agents
In Dockerfile around lines 11-12, the wget URL uses release tag v1.5.1 but
attempts to fetch cronos_1.5.3-testnet_Linux_x86_64.tar.gz (causing a
nonexistent-file build failure); update the download URL to use the v1.5.3
release so the requested filename exists, and remove the --no-check-certificate
flag to avoid disabling SSL verification (ensure the tarball name and URL tag
match exactly and keep the subsequent tar, rm, and mv steps unchanged).


# Set permissions
RUN chown -R cronos:cronos /home/cronos && chmod 1777 /tmp
Expand Down