Pin and verify the FFmpeg shared-library archive - #134
Draft
Blackspirits wants to merge 3 commits into
Draft
Blackspirits wants to merge 3 commits into
Blackspirits wants to merge 3 commits into
Conversation
Blackspirits
commented
Sep 15, 2026
Blackspirits
left a comment
Owner
Author
There was a problem hiding this comment.
Final adversarial review on exact HEAD 88f1405ec15e2b73d9192c0307cb2efc3da65d3e after authoritative CI SubtitleEdit#267. Verified that the pinned BtbN URL no longer uses the mutable latest alias, the reviewed tag/asset/digest are fixed together, SHA-256 verification occurs inside DownloadFfmpegLibs() immediately after transfer and before the caller can extract the archive, and mismatch remains fail-closed even if best-effort deletion itself fails. Focused regression coverage pins both matching and mismatching digests. No correctness or supply-chain blocker found. PR remains draft; no merge/promotion performed.
Blackspirits
force-pushed
the
audit/ffmpeg-libs-download-integrity-3e4d
branch
from
September 15, 2026 19:29
552fc39 to
88f1405
Compare
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Independent supply-chain hardening for the FFmpeg shared-library downloader, kept on the common audited base
3e4d052adc78464e71bbd5154880d935fd592960.Current upstream
SubtitleEdit/subtitleeditmain was rechecked atd6917286e355976da953d0ee22208b4bf9461699; the latest upstream delta only changes the mpv preview subtitle margin setting and does not touch the FFmpeg downloader/player. The same rolling, unverified download remains present upstream. No open upstream PR was found for this pin/hash hardening.Finding fixed
Executable FFmpeg DLLs were downloaded from a mutable
latestrelease without integrity verificationThe Windows x64 FFmpeg-player setup previously downloaded:
https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n9.0-latest-win64-lgpl-shared-9.0.zipand, once the transfer completed, the ViewModel extracted every
/bin/*.dllinto Subtitle Edit's FFmpeg library folder with overwrite enabled.That archive contains native code loaded in-process by the FFmpeg player, but the download contract had neither a fixed release/tag, an exact asset identity, nor a SHA-256 check before extraction.
Reviewed upstream artifact
BtbN/FFmpeg-Buildsautobuild-2026-09-15-13-18ffmpeg-n9.0.1-30-g9258bacca5-win64-lgpl-shared-9.0.zip56574262676,400,262bytessha256:04d256aa477122949304a717bf61d8eec78e255c2c7c9be17fab1677227cb548immutable: false, so the digest remains mandatory even with a dated tag.Fix
FfmpegLibsDownloadServicenow pins the dated autobuild tag, exact asset name and reviewed SHA-256; downloads that exact URL instead of/latest/; computes SHA-256 with the existingSha256Util; succeeds only when the archive matches; and deletes a mismatching archive before throwing. The caller can therefore never extract unverified bytes.Regression coverage
Focused tests pin the non-
latestURL, reviewed tag/asset, 64-character lower-case digest, matching-digest success and mismatch fail-closed deletion.Scope / branch state
3e4d052adc78464e71bbd5154880d935fd592960d6917286e355976da953d0ee22208b4bf946169988f1405ec15e2b73d9192c0307cb2efc3da65d3eAI assistance: ChatGPT was used for current-upstream verification, BtbN release/asset provenance review, mutable-release threat modelling, reuse of Subtitle Edit's existing SHA-256 policy, and focused regression design.
Final CI
Authoritative latest run: SubtitleEdit#269 on
88f1405ec15e2b73d9192c0307cb2efc3da65d3eCI SubtitleEdit#267 had already passed on the same HEAD before the branch ref was restored after an accidental transient audit-only placeholder commit. The branch was reset exactly to this reviewed HEAD, and SubtitleEdit#269 independently revalidated the restored state. Final adversarial review remains anchored to this exact HEAD; no blocker found.