-
Notifications
You must be signed in to change notification settings - Fork 0
fix(security): establish canonical npm, PDF.js, Nanoid, and Undici baseline #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
93 commits
Select commit
Hold shift + click to select a range
4294ddc
test(supply-chain): require deterministic npm lock generator
seonghobae afb20be
fix(supply-chain): pin npm lock generator metadata
seonghobae e64c229
ci(supply-chain): prove npm version and lock reproduction
seonghobae ebbde9b
docs(supply-chain): record npm generator provenance
seonghobae 694ca83
docs(changelog): record npm generator contract
seonghobae 90dc2a0
fix(supply-chain): avoid serializing npm into runtime engines
seonghobae fecc36b
test(supply-chain): keep npm enforcement out of runtime engines
seonghobae 9eb83c3
docs(supply-chain): separate npm generator from runtime engines
seonghobae 5609b88
ci(supply-chain): publish deterministic lock reproduction evidence
seonghobae 032314d
test(supply-chain): require preserved lock reproduction evidence
seonghobae 0263ad4
test(security): require coordinated PDF.js and Undici baseline
seonghobae 2cbf767
test(security): disable PDF expression evaluation
seonghobae 475de96
fix(security): pin the patched Undici transitive version
seonghobae deb74ac
fix(security): pin the patched PDF.js release
seonghobae dc90d5b
fix(security): disable PDF expression evaluation
seonghobae b23b957
docs(security): record coordinated PDF and HTTP remediation
seonghobae 2e99f72
docs(changelog): record coordinated security remediation
seonghobae 8f50fe4
fix(security): anchor the Undici override to an exact root floor
seonghobae e2c0c2d
test(security): bind exact root floor and npm package locations
seonghobae dd93f96
ci(pr783): import exact npm 10.9.8 lock artifact
seonghobae dd8d1ac
fix(score): align PDF.js boundary with 6.2.108 API
seonghobae 988dc1d
test(score): prove the supported data-only PDF.js boundary
seonghobae a39e37f
docs(security): record the supported PDF.js 6.2.108 boundary
seonghobae 6b753e6
docs(changelog): describe the supported patched PDF boundary
seonghobae b773653
ci(pr783): rerun lock import after supported API repair
seonghobae 01cb39e
ci(pr783): publish the verified lock from the bounded importer
seonghobae ad558ac
ci(pr783): fetch complete lineage for verified lock publication
seonghobae 83865dc
fix(security): import verified npm 10.9.8 lock
github-actions[bot] e6b48ca
test(ci): preserve canonical npm provenance formatting
seonghobae 3edf173
ci(pr783): diagnose Ruff import ordering
seonghobae 2345219
style(ci): normalize security test imports
seonghobae dc7e8b4
style(ci): normalize npm provenance test imports
seonghobae c5ee630
chore(ci): remove completed Ruff diagnostic
seonghobae f0c9ad1
ci(pr783): finalize exact Ruff formatting
seonghobae 102a89f
chore(ci): remove temporary branch writer
seonghobae d4887ec
style(test): apply Ruff formatting to security contracts
seonghobae 459abdd
style(test): finish Ruff formatting for npm provenance
seonghobae ace4257
fix(security): refresh vulnerable npm transitive pins
seonghobae 63d0ae6
fix(deps): restore manifest-lock consistency
seonghobae 6bba612
ci: add one-shot canonical lock repair for PR 783
seonghobae ef938fa
fix(deps): regenerate canonical npm 10.9.8 lock
github-actions[bot] a48ff96
ci: retrigger exact-head validation after canonical lock generation
seonghobae fd9389a
ci: add one-shot Ruff formatter for PR 783
seonghobae afba132
style(test): apply canonical Ruff formatting
github-actions[bot] e214e96
ci: retrigger exact-head validation after canonical Ruff formatting
seonghobae 0cd6836
fix(test): verify canonical hoisted PDF.js lock record
seonghobae f4a5a19
ci: add final one-shot Ruff formatter for PR 783
seonghobae 219267e
style(test): apply final canonical Ruff formatting
github-actions[bot] db7b1c1
chore(ci): retrigger exact-head protected checks
seonghobae f4d8850
fix(ci): validate npm lock without mutable resolution
seonghobae 8a143ab
test(supply-chain): format npm toolchain contract
seonghobae b3ac826
test(supply-chain): satisfy ruff formatting gate
seonghobae 885c037
test(supply-chain): format npm toolchain contract
seonghobae de0cd6b
test(supply-chain): apply repository Ruff width
seonghobae f3cfae4
docs(security): align npm lock provenance with frozen validation
seonghobae de75178
fix(ci): disable persisted checkout credentials
seonghobae 164e6f2
docs(changelog): correct UI test coverage claim
seonghobae 07c1dd2
test(lock): reject esbuild peer metadata drift
seonghobae ad4551b
docs(lock): record esbuild metadata sentinel
seonghobae 6f81f52
docs(changelog): record lock metadata drift gate
seonghobae 6665f02
fix(security): make PDF XML boundary explicit
seonghobae bf5a3a3
test(security): lock down PDF parser options
seonghobae c65f5b1
docs(security): record PDF parser hardening evidence
seonghobae dae5d3c
docs(security): correct PDF.js advisory attribution
seonghobae d1d8641
test: measure Python branch coverage
seonghobae 2b543d5
test: cover previously hidden Python branch arcs
seonghobae 4ec36a6
refactor: remove impossible handoff membership branch
seonghobae e18894a
style: format branch-coverage source repair
seonghobae 42e0b16
chore: run one-shot Ruff formatter for PR 861
seonghobae f3a0c27
style: apply repository Python formatter
github-actions[bot] fcf7e52
test: revalidate formatted branch-coverage head
seonghobae 6afbc9f
test: cover flat novelty normalization branch
seonghobae ce35d3d
test(ci): require credential-free lock validation checkout
seonghobae 99e6be9
fix(ci): drop checkout credentials from lock validation
seonghobae 0130f7b
merge(quality): compose dependency security with branch coverage
seonghobae f8dc2e1
test(score): prove PDF byte-buffer isolation
seonghobae 06e060b
test(coverage): prove shared-hit scan reaches later stems
seonghobae 4fac4e7
test(supply-chain): validate npm CI structure fail-closed
seonghobae 4450416
test(supply-chain): reject vulnerable npm tar runtime
seonghobae b77ff7c
fix(supply-chain): verify patched npm tar runtime
seonghobae 1cd71db
fix(supply-chain): pin patched npm runtime
seonghobae f29622d
fix(ci): activate patched npm before dependency reads
seonghobae 9e06df0
docs(supply-chain): record patched npm runtime boundary
seonghobae ec40dda
docs(security): align dependency baseline with patched npm
seonghobae c516f1d
docs(changelog): record patched npm tar runtime
seonghobae 81b2901
test(ci): expose pre-Corepack npm cache bootstrap
seonghobae 27a633d
fix(ci): defer npm use until pinned Corepack runtime
seonghobae 05ca286
fix(release): activate pinned npm before dependency install
seonghobae cf1b728
fix(security): verify pinned npm before audit install
seonghobae 0facdbf
fix(build): use pinned npm after Corepack activation
seonghobae 96674b2
test(ci): accept combined npm activation audit step
seonghobae db4aa09
fix(ci): disable checkout credentials for npm consumers
seonghobae 1168c8f
chore(ci): re-trigger required checks after provider-prefix migration
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import { beforeEach, describe, expect, it, vi } from "vitest"; | ||
| import { getDocument, GlobalWorkerOptions } from "pdfjs-dist"; | ||
| import { configureScorePdfWorker, loadScorePdf } from "./pdfjs"; | ||
|
|
||
| vi.mock("pdfjs-dist", () => ({ | ||
| getDocument: vi.fn(() => ({ promise: Promise.resolve(), destroy: vi.fn() })), | ||
| GlobalWorkerOptions: { workerSrc: "" } | ||
| })); | ||
|
|
||
| vi.mock("pdfjs-dist/build/pdf.worker.min.mjs?url", () => ({ | ||
| default: "/assets/pdf.worker.min.mjs" | ||
| })); | ||
|
|
||
| describe("score PDF.js boundary", () => { | ||
| beforeEach(() => { | ||
| vi.mocked(getDocument).mockClear(); | ||
| GlobalWorkerOptions.workerSrc = ""; | ||
| }); | ||
|
|
||
| it("uses the locally bundled worker asset", () => { | ||
| configureScorePdfWorker(); | ||
|
|
||
| expect(GlobalWorkerOptions.workerSrc).toBe("/assets/pdf.worker.min.mjs"); | ||
|
|
||
| configureScorePdfWorker(); | ||
| expect(GlobalWorkerOptions.workerSrc).toBe("/assets/pdf.worker.min.mjs"); | ||
| }); | ||
|
|
||
| it("copies validated bytes through the hardened data-only API", () => { | ||
| const source = new Uint8Array([0x25, 0x50, 0x44, 0x46]); | ||
|
|
||
| loadScorePdf(source); | ||
|
|
||
| expect(getDocument).toHaveBeenCalledTimes(1); | ||
| const parameters = vi.mocked(getDocument).mock.calls[0]?.[0]; | ||
| expect(parameters).toBeTypeOf("object"); | ||
| expect(Object.keys(parameters as object)).toEqual([ | ||
| "data", | ||
| "enableXfa", | ||
| "useWorkerFetch" | ||
| ]); | ||
| const hardenedParameters = parameters as { | ||
| data: Uint8Array; | ||
| enableXfa: boolean; | ||
| useWorkerFetch: boolean; | ||
| }; | ||
| expect(hardenedParameters.data).toEqual(source); | ||
| expect(hardenedParameters.data).not.toBe(source); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| source[0] = 0x00; | ||
| expect(hardenedParameters.data[0]).toBe(0x25); | ||
| expect(hardenedParameters.enableXfa).toBe(false); | ||
| expect(hardenedParameters.useWorkerFetch).toBe(false); | ||
| }); | ||
| }); | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.