Skip to content

Commit d6cb78a

Browse files
committed
TUN-10216: TUN fix cloudflare vulnerabilities GO-2026-4340 and GO-2026-4341
* TUN-10216: TUN fix cloudflare vulnerabilities GO-2026-4340 and GO-2026-4341 Closes TUN-10216
1 parent d7c62ae commit d6cb78a

10 files changed

Lines changed: 66 additions & 59 deletions

.ci/image/Dockerfile

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@ ARG CLOUDFLARE_DOCKER_REGISTRY_HOST
22

33
FROM ${CLOUDFLARE_DOCKER_REGISTRY_HOST:-registry.cfdata.org}/stash/cf/debian-images/trixie/main:2026.1.0@sha256:e32092fd01520f5ae7de1fa6bb5a721720900ebeaa48e98f36f6f86168833cd7
44
RUN apt-get update && \
5-
apt-get upgrade -y && \
6-
apt-get install --no-install-recommends --allow-downgrades -y \
7-
build-essential \
8-
git \
9-
go-boring=1.24.11-1 \
10-
libffi-dev \
11-
procps \
12-
python3-dev \
13-
python3-pip \
14-
python3-setuptools \
15-
python3-venv \
16-
# tool to create msi packages
17-
wixl \
18-
# install ruby and rpm which are required to install fpm package builder
19-
rpm \
20-
ruby \
21-
ruby-dev \
22-
rubygems \
23-
# create deb and rpm repository files
24-
reprepro \
25-
createrepo-c \
26-
# gcc for cross architecture compilation in arm
27-
gcc-aarch64-linux-gnu \
28-
libc6-dev-arm64-cross && \
29-
rm -rf /var/lib/apt/lists/* && \
30-
# Install fpm gem
31-
gem install fpm --no-document && \
32-
# Initialize rpm repository, SQL Lite DB
33-
mkdir -p /var/lib/rpm && \
34-
rpm --initdb && \
35-
chmod -R 777 /var/lib/rpm && \
36-
# Create work directory
37-
mkdir -p opt
5+
apt-get upgrade -y && \
6+
apt-get install --no-install-recommends --allow-downgrades -y \
7+
build-essential \
8+
git \
9+
go-boring=1.24.13-1 \
10+
libffi-dev \
11+
procps \
12+
python3-dev \
13+
python3-pip \
14+
python3-setuptools \
15+
python3-venv \
16+
# tool to create msi packages
17+
wixl \
18+
# install ruby and rpm which are required to install fpm package builder
19+
rpm \
20+
ruby \
21+
ruby-dev \
22+
rubygems \
23+
# create deb and rpm repository files
24+
reprepro \
25+
createrepo-c \
26+
# gcc for cross architecture compilation in arm
27+
gcc-aarch64-linux-gnu \
28+
libc6-dev-arm64-cross && \
29+
rm -rf /var/lib/apt/lists/* && \
30+
# Install fpm gem
31+
gem install fpm --no-document && \
32+
# Initialize rpm repository, SQL Lite DB
33+
mkdir -p /var/lib/rpm && \
34+
rpm --initdb && \
35+
chmod -R 777 /var/lib/rpm && \
36+
# Create work directory
37+
mkdir -p opt
3838

3939
WORKDIR /opt

.ci/linux.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.golang-inputs: &golang_inputs
22
runOnMR: true
3-
runOnBranches: '^master$'
3+
runOnBranches: "^master$"
44
outputDir: artifacts
55
runner: linux-x86-8cpu-16gb
66
stage: build
77
golangVersion: "boring-1.24"
8-
imageVersion: "3393-947ec7a@sha256:f81acc2c8ecaa84acb290c43c080702ae3aba6464201a20f9d6eff619be7c878"
8+
imageVersion: "3462-0b23466e0715@sha256:42e8533370666a2463041572293a79e1449001ef803a993e6a860be00858c806"
99
CGO_ENABLED: 1
1010

1111
.default-packaging-job: &packaging-job-defaults
@@ -65,7 +65,7 @@ include:
6565
- component: $CI_SERVER_FQDN/cloudflare/ci/golang/boring-make@~latest
6666
inputs:
6767
<<: *golang_inputs
68-
runOnBranches: '^$'
68+
runOnBranches: "^$"
6969
stage: validate
7070
jobPrefix: vulncheck
7171
GOLANG_MAKE_TARGET: vulncheck

.ci/mac.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ macos-build-cloudflared: &mac-build
2828
- '[ "${RUNNER_ARCH}" = "intel" ] && export TARGET_ARCH=amd64'
2929
- ARCH=$(uname -m)
3030
- echo ARCH=$ARCH - TARGET_ARCH=$TARGET_ARCH
31-
- ./.ci/scripts/mac/install-go.sh
31+
- ./.ci/scripts/mac/install-go.sh "$MAC_GO_VERSION"
3232
- BUILD_SCRIPT=.ci/scripts/mac/build.sh
3333
- if [[ ! -x ${BUILD_SCRIPT} ]] ; then exit ; fi
3434
- set -euo pipefail

.ci/scripts/mac/install-go.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ rm -rf /tmp/go
22
export GOCACHE=/tmp/gocache
33
rm -rf $GOCACHE
44

5-
brew install go@1.24
5+
if [ -z "$1" ]
6+
then
7+
echo "No go version supplied"
8+
fi
9+
10+
brew install "$1"
611

712
go version
813
which go
914
go env
10-

.ci/scripts/vuln-check.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ set -e -u
44
# Define the file to store the list of vulnerabilities to ignore.
55
IGNORE_FILE=".vulnignore"
66

7+
go version
78
# Check if the ignored vulnerabilities file exists. If not, create an empty one.
89
if [ ! -f "$IGNORE_FILE" ]; then
9-
touch "$IGNORE_FILE"
10-
echo "Created an empty file to store ignored vulnerabilities: $IGNORE_FILE"
11-
echo "# Add vulnerability IDs (e.g., GO-2022-0450) to ignore, one per line." >> "$IGNORE_FILE"
12-
echo "# You can also add comments on the same line after the ID." >> "$IGNORE_FILE"
13-
echo "" >> "$IGNORE_FILE"
10+
touch "$IGNORE_FILE"
11+
echo "Created an empty file to store ignored vulnerabilities: $IGNORE_FILE"
12+
echo "# Add vulnerability IDs (e.g., GO-2022-0450) to ignore, one per line." >>"$IGNORE_FILE"
13+
echo "# You can also add comments on the same line after the ID." >>"$IGNORE_FILE"
14+
echo "" >>"$IGNORE_FILE"
1415
fi
1516

1617
# Run govulncheck and capture its output.
@@ -35,18 +36,18 @@ UNIGNORED_VULNS=$(echo "$VULN_OUTPUT" | grep 'Vulnerability')
3536

3637
# If the list of ignored vulnerabilities is not empty, filter them out.
3738
if [ -n "$CLEAN_IGNORES" ]; then
38-
UNIGNORED_VULNS=$(echo "$UNIGNORED_VULNS" | grep -vFf <(echo "$CLEAN_IGNORES") || true)
39+
UNIGNORED_VULNS=$(echo "$UNIGNORED_VULNS" | grep -vFf <(echo "$CLEAN_IGNORES") || true)
3940
fi
4041

4142
# If there are any vulnerabilities that were not in our ignore list, print them and exit with an error.
4243
if [ -n "$UNIGNORED_VULNS" ]; then
43-
echo "🚨 Found new, unignored vulnerabilities:"
44-
echo "-------------------------------------"
45-
echo "$UNIGNORED_VULNS"
46-
echo "-------------------------------------"
47-
echo "Exiting with an error. ❌"
48-
exit 1
44+
echo "🚨 Found new, unignored vulnerabilities:"
45+
echo "-------------------------------------"
46+
echo "$UNIGNORED_VULNS"
47+
echo "-------------------------------------"
48+
echo "Exiting with an error. ❌"
49+
exit 1
4950
else
50-
echo "🎉 No new vulnerabilities found. All clear! ✨"
51-
exit 0
51+
echo "🎉 No new vulnerabilities found. All clear! ✨"
52+
exit 0
5253
fi

.ci/windows.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ windows-build-cloudflared:
1818
<<: *windows-build-defaults
1919
stage: build
2020
script:
21-
- powershell -ExecutionPolicy Bypass -File ".\.ci\scripts\windows\go-wrapper.ps1" "${GO_VERSION}" ".\.ci\scripts\windows\builds.ps1"
21+
- powershell -ExecutionPolicy Bypass -File ".\.ci\scripts\windows\go-wrapper.ps1" "${WIN_GO_VERSION}" ".\.ci\scripts\windows\builds.ps1"
2222
artifacts:
2323
paths:
2424
- artifacts/*
@@ -73,7 +73,7 @@ windows-component-tests-cloudflared:
7373
script:
7474
# We have to decode the secret we encoded on the `windows-load-env-variables` job
7575
- $env:COMPONENT_TESTS_ORIGINCERT = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($env:COMPONENT_TESTS_ORIGINCERT))
76-
- powershell -ExecutionPolicy Bypass -File ".\.ci\scripts\windows\go-wrapper.ps1" "${GO_VERSION}" ".\.ci\scripts\windows\component-test.ps1"
76+
- powershell -ExecutionPolicy Bypass -File ".\.ci\scripts\windows\go-wrapper.ps1" "${WIN_GO_VERSION}" ".\.ci\scripts\windows\component-test.ps1"
7777
artifacts:
7878
reports:
7979
junit: report.xml

.gitlab-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
variables:
2-
GO_VERSION: "go1.24.11"
2+
GO_VERSION: "1.24.13"
3+
MAC_GO_VERSION: "go@$GO_VERSION"
4+
WIN_GO_VERSION: "go$GO_VERSION"
35
GIT_DEPTH: "0"
46

57
default:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# use a builder image for building cloudflare
22
ARG TARGET_GOOS
33
ARG TARGET_GOARCH
4-
FROM golang:1.24.11 AS builder
4+
FROM golang:1.24.13 AS builder
55
ENV GO111MODULE=on \
66
CGO_ENABLED=0 \
77
TARGET_GOOS=${TARGET_GOOS} \

Dockerfile.amd64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# use a builder image for building cloudflare
2-
FROM golang:1.24.11 AS builder
2+
FROM golang:1.24.13 AS builder
33
ENV GO111MODULE=on \
44
CGO_ENABLED=0 \
55
# the CONTAINER_BUILD envvar is used set github.com/cloudflare/cloudflared/metrics.Runtime=virtual

Dockerfile.arm64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# use a builder image for building cloudflare
2-
FROM golang:1.24.11 AS builder
2+
FROM golang:1.24.13 AS builder
33
ENV GO111MODULE=on \
44
CGO_ENABLED=0 \
55
# the CONTAINER_BUILD envvar is used set github.com/cloudflare/cloudflared/metrics.Runtime=virtual

0 commit comments

Comments
 (0)