Repository navigation
Conversation
Both WASM XOR lints returned an empty, non-refusing report when the module was larger than their 32 MiB window, so a caller could not tell a clean scan from one that never ran. Scan the window and set truncated with the same wording as the other scan-window fixes (qybaihe#283, qybaihe#310, qybaihe#332); the refusal verdict is unchanged because the window, not the finding, was cut.
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.
Summary
The two WASM XOR lints stop at 32 MiB. When a module was larger, they returned an empty report with
shouldRefuseBankrupt: falseand a single advice line, so a caller could not tell a clean module from one that was never examined. The report had notruncatedfield at all, while the other four lints that cap their input already carry one after the same fix. These two were the remaining pair.What changed
src/engine/wasm-xor-mask-sidecar-lint.tsandsrc/engine/wasm-seal-xor-known-plaintext-lint.ts: an oversized buffer is now linted over the first 32 MiB instead of skipped, and the report gains an optionaltruncated: true.shouldRefuseBankruptstays false and a project that passes today keeps passing.tests/lint-scan-window-honesty.test.ts: two new cases build a valid module just over the cap (the module header plus one oversized custom section) and asserttruncated, the advice text, and that the verdict did not move.Why it matters
Both lints exist to catch an entitlement pack that can be unmasked with no key: a masked blob stored beside its plaintext XOR mask, or a pack that puts
seal.revisionunder a repeating mask as known plaintext. If the pack sits past the 32 MiB window, the old code returned the same object a clean module produces, down tofindings: []andlooksExposed: false. A caller that checksshouldRefuseBankruptorfindings.lengthwould ship it. The window is still a limit, and the honest thing is to say the scan was cut rather than let silence read as a pass.Validation
Both new cases fail on the old reports because
truncatedis undefined. After the change, 33 tests pass across those files and the type check is clean.Compatibility
Modules at or below 32 MiB produce exactly the same findings and advice as before. A larger module now carries
truncated: trueand an advice line that names the window; the refusal verdict is untouched, so no existing build starts failing. The report types only gain an optional field, which leaves JSON consumers and the unified gate output working without changes.