Repository navigation
fix(skills): reject altered download archives before extraction - #129486
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 1:23 AM ET / 05:23 UTC. ClawSweeper reviewWhat this changesAdds optional SHA-256 validation for skill download archives, exposes the normalized digest to install policy hooks, and extracts verified archives through a bound filesystem root. Merge readinessKeep open for explicit maintainer security review. No concrete patch defect was found, but this review could not independently inspect the required @openclaw/fs-safe 0.5.6 root-capability implementation that enforces the new pinned-root guarantee. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
Recorded live on the PR head ( How this fits togetherSkill manifests supply download installers, which the lifecycle service fetches and extracts into a per-skill tools directory. The new flow validates private downloaded bytes before publication and keeps archive extraction on the original filesystem-root capability. flowchart LR
A[Skill manifest] --> B[Manifest parser]
B --> C[Install policy hook]
C --> D[Bound tools root]
D --> E[Private archive download]
E --> F[SHA-256 validation]
F -->|match| G[Staged extraction]
F -->|mismatch| H[Discard bytes]
G --> I[Published skill tools]
Decision needed
Why: The changed security claim depends on an external filesystem-capability contract unavailable in this review environment, so automated review cannot safely treat it as independently proven. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch improves the archive trust boundary, but its root-rebinding claim requires direct verification of the pinned fs-safe capability contract before merge. PR surfaceSource +66, Tests +309, Docs +5. Total +380 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the manifest-bound digest and private-staging design, then have a maintainer verify the exact fs-safe 0.5.6 root-identity contract before merging. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main has no expected-digest check before publishing or reopening a downloaded archive. The branch’s focused tests describe the matching altered-byte and root-rebinding cases, but this read-only review did not execute them. Is this the best way to solve the issue? Unclear: parsing at the manifest boundary, hashing private bytes, and publishing only through a bound root is the right owner-level shape, but its final security guarantee depends on an uninspected fs-safe contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 647414e3e31b. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
bf34d78 to
f36b508
Compare
f36b508 to
4a5169a
Compare
4a5169a to
19bd382
Compare
aaf565a to
3d4ca2f
Compare
|
Land-ready at exact head Root cause and canonical repair. The shared Exact frozen-head proof.
ClawSweeper disposition. Every earlier P1/P2 finding and rank-up move is applied: prefetch Root binding, public Final exact-head LOC across 11 paths: production +151/-85 (net +66); tests +332/-23; docs/manifest +10/-5. Production growth protects the publisher-integrity and identity-bound extraction/publication security invariant. |
|
Merged via squash.
|
…claw#129486) * fix(skills): verify download archive SHA-256 * fix(skills): expose download digest to install hooks * fix(skills): bind download destination before fetch * fix(skills): bind archive extraction to verified root

Related: #129187
Prior related attempt: #24712
What Problem This Solves
Skill dependency installers using direct downloads could extract and later execute altered publisher archives because the shared manifest and installer contract had no expected digest. Destination-path replacement could also separate extraction from the verified archive or original tools root.
Why This Change Was Made
Adds one optional
sha256field to the sharedkind: "download"install contract, validates and normalizes it when parsing the manifest, and exposes the normalized value to install policy and the publicbefore_installhook. The additive optional hook field is intentional and accepted by the maintainer; existing digestless installers remain supported.Every download creates, canonicalizes, and binds the exact per-skill
@openclaw/fs-safeRootbefore network I/O. The existing 256 MiB streaming ceiling remains enforced. Publisher bytes are downloaded into private temporary storage and verified before the firstRoot.copyIn; a mismatch cannot create or replace the target archive or modify an existing installation.Extraction reads the same verified private archive into a private staging directory. Every extracted file and directory is published only through the originally bound
Root, preserving executable modes and rejecting replacement of the public tools pathname even after archive publication. No later step reopens the mutable public archive or trusts a rebound lexical destination.The bundled Sherpa macOS, Linux, and Windows executable runtime archives now carry publisher-confirmed SHA-256 pins. The separate voice model retains its existing digestless contract.
User Impact
Pinned skill downloads fail closed with the expected and actual digest plus an actionable remediation hint when publisher bytes change. Existing installations remain intact, successful downloads retain executable modes and empty directories, and existing installers without a declared digest continue to work. Policy plugins can inspect the normalized publisher digest before allowing installation.
Evidence
node scripts/run-vitest.mjs src/skills/lifecycle/install-download.test.ts src/skills/loading/frontmatter.test.ts src/skills/lifecycle/install.test.tsrerun passed 55 tests across three files and two Vitest shards.git diff --checkpassed. Earlier broader owner/parser/hook/policy/bundled-skill evidence passed 125 tests across nine suites;pnpm buildand docs checks also passed.before_installas one normalized lowercase digest before any install side effect.@openclaw/fs-safe0.5.6 source and types:dist/root-context.js:38-80captures device/inode identity and rejects replacement withpath-mismatch;dist/root-impl.js:270-275,316-323routesmkdirandcopyInthrough the same retained root context;dist/root-impl.d.ts:85-91exposes the exact capability contract.installSkillflow against the publisher-hosted Linux v1.13.5 archive:{"mismatch":{"rejected":true,"targetUntouched":true,"actionable":true},"success":{"installed":true,"extractedEntryCount":3,"installedArchiveSha256":"cb8943b10d286cc37831a69873d035ea285a26d639c8d687600cdbd5006bb00f"}}.1a89631e5975519dbdaf8e68ef5c8687693117e8b4155480c346601b1c3c6156; Linuxcb8943b10d286cc37831a69873d035ea285a26d639c8d687600cdbd5006bb00f; Windows4687600d9c5fbedd400db31a61424e0c2821a949f424e4a3b1a0d847daae8e7c.3d4ca2fb9a4fddd9675085296ec5eb9db633e874.AI-assisted; the maintainer inspected the complete owner path, direct dependency source/types, publisher metadata, current-main integration, and fail-first security regressions.