Skip to content

fix(skills): verify sha256 for download installer artifacts - #24712

Closed
markmusson wants to merge 1 commit into
openclaw:mainfrom
markmusson:mmusson/pr2-skill-download-sha256
Closed

markmusson wants to merge 1 commit into
openclaw:mainfrom
markmusson:mmusson/pr2-skill-download-sha256

Conversation

@markmusson

@markmusson markmusson commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add optional sha256 support to metadata.openclaw.install download specs
  • verify downloaded artifact SHA-256 before extraction or install success
  • fail closed on invalid checksum format and checksum mismatch
  • remove mismatched artifact file on verification failure
  • document the new sha256 field in English and Chinese skills docs

Why

Download installers already enforce extraction/path safety, but they did not validate artifact integrity. This adds manifest-driven integrity checks without breaking existing skills that omit checksums.

Behavior

  • sha256 accepts either:
    • 64 hex chars
    • sha256:<64 hex chars> (case-insensitive prefix)
  • if sha256 is invalid: installation fails before any network download
  • if checksum mismatches: installation fails before extraction, with mismatch details
  • if checksum matches: install continues normally

Tests

  • added/updated tests in src/agents/skills-install.download.test.ts:
    • rejects mismatched sha256 and prevents extraction
    • accepts valid sha256 and proceeds
    • rejects invalid sha256 format before download
  • ran targeted suite:
    • pnpm test -- src/agents/skills-install.download.test.ts src/agents/skills-install.test.ts src/agents/skills/frontmatter.test.ts src/agents/skills-status.test.ts
  • ran quality checks:
    • pnpm check

Greptile Summary

Adds optional SHA-256 checksum verification for download installer artifacts to prevent installation of tampered files. The implementation validates checksums before extraction, removes mismatched files, and documents the new field in both English and Chinese docs.

Key changes:

  • Validates checksum format (64 hex chars or sha256:<64 hex chars>) before download to fail fast
  • Computes SHA-256 after download and before extraction using streaming hash computation
  • Removes downloaded file if checksum mismatches to prevent leaving corrupted artifacts
  • Maintains backward compatibility (checksum is optional)
  • Adds comprehensive test coverage for mismatch, valid checksum, and invalid format scenarios

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is well-structured with proper validation, error handling, and comprehensive test coverage. The code follows the repository's style guidelines, includes both positive and negative test cases, validates inputs before network operations, properly cleans up failed downloads, and maintains backward compatibility by making checksums optional.
  • No files require special attention

Last reviewed commit: 8f37669

(5/5) You can turn off certain types of comments like style here!

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S labels Feb 23, 2026
@markmusson
markmusson force-pushed the mmusson/pr2-skill-download-sha256 branch from 59cf272 to cb03b85 Compare February 23, 2026 19:08
@markmusson

Copy link
Copy Markdown
Contributor Author

CI is green on the latest rebased head and this hardening change is ready to merge. Scope remains intentionally narrow: enforce SHA-256 verification in skills download installer paths, with focused test coverage and docs updates.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Mar 1, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

@openclaw-barnacle openclaw-barnacle Bot closed this Mar 4, 2026
@markmusson
markmusson deleted the mmusson/pr2-skill-download-sha256 branch March 5, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation size: S stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant