fix(updater): pin OS release archives with SHA256 - #2743
fix(updater): pin OS release archives with SHA256#2743Eli Bosley (elibosley) wants to merge 1 commit into
Conversation
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe plugin replaces MD5 release verification with SHA-256 verification. The install script validates the hash before extraction. New tests cover valid, invalid, missing, and failed hash checks. ChangesRelease archive integrity
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Release archives are now pinned and verified with SHA-256 before extraction, replacing the legacy MD5 check. The integrity gate is covered for successful and failing checksum cases, with no current merge-blocking risk identified. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Pin the OS release ZIP to the SHA256 stored in its published plugin manifest, and enforce that pin before extraction on older plugin managers too.
Why This Exists
The updater currently compares the ZIP with a separately downloaded MD5 file. Replacing both files defeats that check. The release publisher already fills a
sha256entity, but this template does not declare or use it.Resolution
Declare the existing
sha256entity, use it in the ZIP's<SHA256>element, and verify it explicitly in the install script before extraction. Remove the redundant MD5 sidecar download and comparison, including the legacy Unraid 5 download path.Reviewer Considerations
<SHA256>. The 6.8.3 plugin manager ignores it, so the inline check is necessary for compatibility.OsVersionFull::getPluginFile()andOsVersionBase::updateEntityTag()fill the new template without a publisher deployment. Older templates continue to generate with their existing MD5 behavior.Behavior Changes
A mismatched archive, absent/malformed digest, or failed SHA256 calculation stops the upgrade before archive extraction. The separate MD5 file is no longer fetched. Existing SHA256 checks of extracted boot files remain.
Implementation Summary
Verification
python3 tests/unraidserver-integrity.py: all 8 tests passed with Bash 5.3 and Bash 3.2.git diff --check: passed.Risk
This changes OS upgrade verification. No complete upgrade or Unraid 5 runtime test was performed. Older systems must provide
/usr/bin/sha256sum; if it is unavailable, installation stops. The hash pins the archive to the manifest; authenticity of the manifest remains a separate trust boundary.Summary by CodeRabbit
Security
Bug Fixes