Repository navigation
fix(web): bundle crypto deps into app.js — no runtime CDN loads (#2 review debt) - #20
Merged
Merged
Conversation
…eview debt) The client-side demo resolved @scure/@noble/bech32 at runtime via an import map to esm.sh: anyone deriving from real seed material was exposed to supply-chain compromise or CDN tampering altering derivation logic or exfiltrating the seed (Codex P1 on #2). - build:web drops all --external flags: esbuild inlines the crypto deps (versions pinned by package-lock.json, same ones the CLI and tests use) into web/dist/app.js — 181 KB, single origin - index.html: the import map is gone - scripts/check-web-bundle.mjs guards the invariant in npm test: no import map, no external script origins, no --external in build:web, built bundle contains zero @scure/@noble/bech32 imports and no CDN references Verified end-to-end (demo mnemonic + AcmeCorp path): browser derivation output is byte-identical to the CLI oracle (path m/83696968'/67797668'/300742085'/1472905663'/816025947', age1n0upp…, AGE-SECRET-KEY-1UKTFS…) and performance.getEntriesByType('resource') records ZERO non-same-origin requests.
Amperstrand
marked this pull request as ready for review
November 2, 2026 18:27
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the P1 finding from the Codex review of #2 (inline thread on
index.html), verified STILL-ACTIONABLE at current main: the client-side demo resolved@scure/@noble/bech32at runtime via an import map to esm.sh — anyone deriving from real seed material was exposed to supply-chain compromise or CDN tampering that could alter derivation logic or exfiltrate the seed before derivation runs.Fix — bundle, don't fetch
build:webdrops all--externalflags: esbuild inlines the crypto deps intoweb/dist/app.js(181 KB, single origin; versions pinned bypackage-lock.json— the same ones the CLI and tests use)index.html: the import map is gonescripts/check-web-bundle.mjsguards the invariant insidenpm test(CI-enforced): no import map, no external script origins, no--externalin build:web, built bundle has zero@scure/@noble/bech32imports and no CDN referencesVerification
npm test: guard + 53/53 vitest;npm run typecheckcleanm/83696968'/67797668'/300742085'/1472905663'/816025947',age1n0upp…,AGE-SECRET-KEY-1UKTFS…;performance.getEntriesByType('resource')records zero non-same-origin requestsSeparate pre-existing gap (not this PR — workflow change is owner-review-only)
pages.ymluploads the raw checkout with no build step, andweb/dist/is untracked — the deployed Pages demo references./web/dist/app.jsthat isn't in the artifact. Filed as an issue for an owner decision.Audit tracker: Amperstrand/pr-review-audit#98