You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: stop a regex literal from blinding the live-caller scan
Three holes in the guard the previous commit rewrote, all found by reviewing
that commit rather than the branch.
The masker had no regex-literal awareness, and this suite is full of patterns
like /rel=["']modulepreload["']/ whose quote characters it read as string
delimiters. That desyncs the mask for the REST OF THE FILE, so every live call
below such a line vanished from the scan. Eighteen test files carry the shape,
including the app-boot tests. Demonstrated end to end: injecting a live fetch
after the regex on blog-smoke.test.js:115 left the guard fully green, while the
identical line above it redded. So the scan could report clean because it had
gone blind, which is the same class of hole the previous commit was written to
close. Telling a regex from a division needs the preceding token, so the usual
heuristic goes in, with character classes and escapes handled and division
still reading as division.
The host lookup used a 200-character raw window, which crosses statements. A
`fetch(localUrl)` followed two lines later by an assertion naming a jspm url
read as a live call, and so did a comment mentioning one. It reads the call's
actual argument list now, via the same paren matcher the guard ranges use.
And the allowlist's `live` flag was read as merely falsy, so an entry added
without the key skipped the *.live.test.* requirement while still collecting a
whole-file exemption. It must be an explicit boolean now.
Each of the three ships with the counterfactual that reproduces it, since the
previous round's lesson was that this guard's own tests were the thing not
being checked.
0 commit comments