R-5: Verify SHA-256 checksums on downloaded model files#146
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mirror the updater's checksum pattern for prebuilt model downloads: fetch a SHA256SUMS manifest next to the model asset, verify the digest before the temp file replaces the cached ONNX. A mismatch deletes the download and logs an error (existing fallback to ultralytics export applies); a missing manifest or missing entry logs a warning and proceeds (legacy releases without checksums still work; hard-fail is deferred). tools/fetch_models.py shares the same ModelManager._download_prebuilt path, so no separate wiring needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Model downloads had no integrity verification (security-audit finding); the updater already had the verified-secure pattern. Now every network-downloaded model verifies against a
SHA256SUMSmanifest published next to the assets:_download_prebuiltonly).tools/fetch_models.pydrivesModelManager, so both paths verify by construction; engine does not import updater code.Test plan
Release-process follow-up (not in this PR)
Publish
SHA256SUMSnext to the models-v1 assets at the next release cut — until then all releases take the legacy-warning path.🤖 Generated with Claude Code