Skip to content

Validate frozen patch_hash pins for runtime originals - #252

Open
callumalpass wants to merge 1 commit into
mainfrom
supervisor/fix-runtime-patched-importer
Open

callumalpass wants to merge 1 commit into
mainfrom
supervisor/fix-runtime-patched-importer

Conversation

@callumalpass

Copy link
Copy Markdown
Member

Summary

  • Allow runtimeSourcePins() in scripts/lib/writer-runtime-originals.mjs to validate pnpm-lock.yaml importer pins of the form <version>(patch_hash=<sha256>) when a runtime package (such as pandoc-wasm@1.1.0, patched in Fix Writer Word media export, improve accessibility, and speed up manuscript assembly #251) carries a committed pnpm patch.
  • Enforce full frozen integrity for any patched runtime dependency:
    • patchedDependencies in pnpm-lock.yaml must record the exact <key>: <sha256> digest.
    • The committed regular file patches/<name>@<version>.patch (no symlinks) must match that SHA-256 digest.
    • The patch must not be binary, use .. path traversal, or touch the official WASM member (src/pandoc.wasm / pkg/typst_ts_web_compiler_bg.wasm) or package.json, keeping the R2-served WASM binary 100% bound to the official upstream npm tarball SRI.
  • Add tests in tests/writer-hosting-policy.test.mjs covering both the live repository's pnpm-lock.yaml / patches/ and refusal cases for missing/mismatched digests, symlinks, binary patches, WASM/manifest patches, traversal, and non-patch_hash suffixes.

Context

Fixes the Writer app-stop mdbase-dev/mdbase-cloud-ops#2337 (staging run 46151341942 on 5b22cbf52f2f failed in Unprivileged frozen Writer build with Error: Runtime original refusal: frozen importer pin).

Verification

  • node --test tests/writer-hosting-policy.test.mjs tests/native-publish-bytes.test.mjs — 106/106 passed
  • rpnpm run test:publisher — 187/187 passed

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant