Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Switch ffmpeg from abandoned johnvansickle 7.0.2 to a pinned, checksum-verified BtbN 8.1.2 to fix CVE-2026-8461 (MagicYUV RCE)

Murtaza Nasir02ba95397593
diff --git a/Dockerfile b/Dockerfile
index b91bae3a..0fb04a9a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,17 +28,40 @@ RUN pip install --no-cache-dir requests && \
###############################################################################
# Stage 2: FFmpeg — download static binaries (much smaller than apt ffmpeg)
+#
+# Source: BtbN/FFmpeg-Builds. We moved off the johnvansickle static builds
+# because that mirror is frozen at 7.0.2 (2024) and therefore ships the MagicYUV
+# decoder flaw CVE-2026-8461 ("PixelSmash", heap out-of-bounds write, RCE via
+# crafted media), fixed upstream in 8.1.2.
+#
+# Supply-chain hardening: we pin an IMMUTABLE dated release (not BtbN's rolling
+# `latest` tag) and verify each arch tarball's SHA-256, so a rebuild is
+# reproducible and a swapped or tampered binary fails the build. To move to a
+# newer 8.1.x patch, bump BTBN_TAG, FFMPEG_VER and BOTH checksums together
+# (read the new values from the release's checksums.sha256). BtbN binaries nest
+# under bin/, hence the adjusted move paths.
###############################################################################
FROM python:3.11-slim AS ffmpeg-stage
+ARG BTBN_TAG=autobuild-2026-06-23-13-52
+ARG FFMPEG_VER=n8.1.2
+ARG FFMPEG_SHA256_amd64=0c6772b77fdbf127cc1498eca39a40e20b88817f36b66d553cebcfcca32b6d78
+ARG FFMPEG_SHA256_arm64=cd7ec4b2235189caa49d6cbe8e02b7546ba28c2a58248e099344bbfd35c5e70b
+
RUN apt-get update && apt-get install -y --no-install-recommends wget xz-utils \
&& rm -rf /var/lib/apt/lists/* \
- && ARCH=$(dpkg --print-architecture) \
- && wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${ARCH}-static.tar.xz -O /tmp/ff.tar.xz \
+ && case "$(dpkg --print-architecture)" in \
+ amd64) BTBN_ARCH=linux64; SHA256="${FFMPEG_SHA256_amd64}" ;; \
+ arm64) BTBN_ARCH=linuxarm64; SHA256="${FFMPEG_SHA256_arm64}" ;; \
+ *) echo "Unsupported architecture: $(dpkg --print-architecture)" >&2; exit 1 ;; \
+ esac \
+ && ASSET="ffmpeg-${FFMPEG_VER}-${BTBN_ARCH}-gpl-8.1.tar.xz" \
+ && wget -q "https://github.com/BtbN/FFmpeg-Builds/releases/download/${BTBN_TAG}/${ASSET}" -O /tmp/ff.tar.xz \
+ && echo "${SHA256} /tmp/ff.tar.xz" | sha256sum -c - \
&& mkdir -p /tmp/ffmpeg-dir \
&& tar xf /tmp/ff.tar.xz -C /tmp/ffmpeg-dir --strip-components=1 \
- && mv /tmp/ffmpeg-dir/ffmpeg /usr/local/bin/ffmpeg \
- && mv /tmp/ffmpeg-dir/ffprobe /usr/local/bin/ffprobe \
+ && mv /tmp/ffmpeg-dir/bin/ffmpeg /usr/local/bin/ffmpeg \
+ && mv /tmp/ffmpeg-dir/bin/ffprobe /usr/local/bin/ffprobe \
&& chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe \
&& rm -rf /tmp/ff.tar.xz /tmp/ffmpeg-dir