You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model downloads skip SHA-256 verification for every model #1497
Every entry in the model catalog ships an empty sha256, and perform_download skips integrity verification when the hash is empty. Multi-GB GGUF files — including the locked default model — load into llama.cpp with integrity delegated entirely to HuggingFace transport, over a moving /resolve/main/ reference.
Problem Statement
The verification machinery exists (sha256_file, mismatch → delete) but is never armed because no catalog entry carries a hash. A MITM, a compromised/re-uploaded HuggingFace blob, or a wrong-file swap would be accepted and run silently.
Proposed Solution
Populate sha256 for the locked default plus promotion candidates; make an empty hash a hard error for non-trial models; pin the HuggingFace commit SHA in the URL instead of /resolve/main/.
Acceptance Criteria
Default/locked models carry a real sha256
Empty hash is a hard error for non-trial catalog entries
Download URLs pin a commit SHA (not a moving ref)
Code passes bun run quality:fix; tests pass
Technical Specifications
Reference Files
packages/agent/src/local_agent/model_manager.rs (catalog sha256: "", bypass around the empty-hash check)
Re-confirmed in the July 2026 security review (Critical). Decision + verification contract now documented: ADR-058 — Model Artifact Integrity Verification (nodespace-docs/decisions/058-model-artifact-integrity-verification.md): pin SHA-256 next to the model URL, verify-or-delete at download, and verify again at load. Note the review also confirmed the standalone scripts/download-models.ts path (curl -L, no digest) in addition to the catalog perform_download path.
Companion item (was S-19 in the review): also verify the on-disk GGUF against the pinned digest at load time (packages/nlp-engine/src/config.rs:70), not only at download — closes the post-install tamper window. Covered by ADR-058.
Activity
malibio commentedon Jul 6, 2026
Baseline (worktree issue-1497-model-sha256-verification): Frontend 3944 passed, 2 failed (architecture-benchmarks.test.ts performance variance, pre-existing/unrelated). Proceeding with Rust changes to model_manager.rs.
Verify SHA-256 for every model catalog entry, pin HF commit SHAs (#1543)
malibio commentedon Jul 23, 2026
Re-confirmed in the July 2026 security review (Critical). Decision + verification contract now documented: ADR-058 — Model Artifact Integrity Verification (
nodespace-docs/decisions/058-model-artifact-integrity-verification.md): pin SHA-256 next to the model URL, verify-or-delete at download, and verify again at load. Note the review also confirmed the standalonescripts/download-models.tspath (curl -L, no digest) in addition to the catalogperform_downloadpath.malibio commentedon Jul 23, 2026
Companion item (was S-19 in the review): also verify the on-disk GGUF against the pinned digest at load time (
packages/nlp-engine/src/config.rs:70), not only at download — closes the post-install tamper window. Covered by ADR-058.