fix(guard-vectors): measure C2.through-302/307 arrival on guards that refuse addScript #350
All Vouch review confidence checks passed
Residual risk 0.43 = Change Risk (0.52) × (1 − Review Confidence (0.18)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 18% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #350"
general
weight: 0.35
chatgpt-codex-connector[bot]
Fixes #348.
What changes
C2.through-302andC2.through-307:protectedHopandlandedare fixture request-log observations (served, observerfixture). TheirdependsOnchanges from[refused.3, refused.4](Page.addScriptToEvaluateOnNewDocument,Page.setBypassCSP) to[].allowedBeacon,afterBeaconanddetachedstay tied to addScript.chainStarted: the stand-in served the chain's first hop,{ordinary}/hop?code=301(served: /hop, origin{ordinary}, observerfixture,dependsOn: []). Expectedtrueon the control and on the guarded leg.or: {served: {cross}/doc?n={tag}-after, observer: fixture}. When addScript is refused,settle()does not skip it:refused() && !altis false, soarrived()pollsthis.check(alt)and the leg waits for the landing before it observes. A mutant shows this: a leak whose protected hop arrives 700 ms late still fails, and the same mutant passes the leak once theoris removed.Runner rules (guard-runner.mjs, for the CDP owner)
1. Premise observations.
const premises = { chainStarted: 'first hop not observed' }. InobserveAll, an observation named inpremisesthat has nodependsOn, is expectedtrueon the leg, and whose check comes backfalsebecomesincompletewith the reasonchainStarted: first hop not observed. It never becomesfalseor a pass.- The rule does not apply when the leg expects
falseor"either", or to any other observation name.- Why:
chainStartedis the row's premise. If the first hop never happened,protectedHop: falseandlanded: falseon the guarded leg prove nothing. A plain expected-true mismatch would reportfail, but this is missing evidence, so it isincomplete.- It is keyed by name on purpose. No other
dependsOn: []observation that expectstrue(C2.chainhopped, C3committed/navigatedLater, X1served, ...) moves fromfailtoincomplete.2. A control that measured nothing. On the control leg, if every observation was skipped and at least one was excused by a refused step in its
dependsOn, the leg recordsmeasured nothing. The row then showsincomplete: control measured nothing.- Observations gated out as
not-supported, or alreadyincompletethrough a dependency, count as unmeasured. They do not trigger the rule on their own.- A control that would have passed becomes
incomplete. A control that fails staysfail. The guarded leg is unchanged.- This is the generic guard rail the owner approved.
No schema, Go, Rust or README change:
chainStartedis an ordinary observation name.Mutants (test/integration/guard-redirect-through.test.mjs, browser-free)
A fake CDP client in the style of
guard-incomplete/redirect-history-fixture. It is opt-in per test throughcut/delayoptions. Every guard in this file refusesPage.addScriptToEvaluateOnNewDocument. Each test runs on both through-302 and through-307, target seven:| mutant | control | guarded |
|---|---|---|
| lets the chain through the protected hop | pass; control measures chainStarted/protectedHop/landed
true| fail (protectedHop, landedtrue) || leaks, with the protected hop 700 ms late | pass | fail (the settle
orwaited) || cuts at the protected hop | pass | pass |
| cuts the first hop of a chain to a protected origin (chain never starts) | pass | incomplete:
guarded chainStarted: first hop not observed; summary not a pass || same row with every observation made dependent on refused.3 | incomplete:
control measured nothing; summary not a pass | pass (excused) |Every control assertion also checks that
allowedBeacon,afterBeaconanddetachedstay excused. All 10 tests fail onorigin/main: they were copied into a cleangit archivetree and run there.Audit: fixture-only observations with refused dependencies (C1–C5, E)
"Fixture-only" means every leaf of the check has observer
fixture, with no client or unguarded leg.Fixed:
| row | observation | dependsOn (before) | why not needed |
|---|---|---|---|
| C2.through-302 | protectedHop | refused.3 addScript, refused.4 setBypassCSP | The stand-in's request log records the
/hoprequest at{target}whether or not an init script or CSP bypass is installed. || C2.through-302 | landed | refused.3, refused.4 | Same: the
{cross}/doc?n={tag}-afterrequest is logged by the stand-in. || C2.through-307 | protectedHop | refused.3, refused.4 | same as through-302 |
| C2.through-307 | landed | refused.3, refused.4 | same as through-302 |
No other request-log (
served/hops/loaded/pre) observation in C1–C5 or E has a non-emptydependsOn. Every other fixture-only observation with a dependency is a beacon or a header, and in each case the dependency is the step that produces it:allowedBeacon/beacon/pageBeacon/afterBeaconin C1.script-nav, C1.href/replace/form, C2.chain-, C2.post-, C2.through-, C2.302/307/twohop, C3.popup, C3.popup-self-nav, C3.popup-on-redirect-, C4.-site, C4.iframe, E1.onload, E2.binding and E5.console. They depend on the addScript or addScriptToEvaluateOnLoad step that installs the beacon. For child targets they also depend onTarget.setAutoAttach.headerdepends onNetwork.setExtraHTTPHeaders. E6.ua-network(.iframe)agentdepends onNetwork.setUserAgentOverride, E6.ua-emulation(.iframe)agentonEmulation.setUserAgentOverride, and E6.cache-disabled(.iframe)uncachedonNetwork.setCacheDisabled.Not changed (for the owner):
| row | observation | dependsOn | reason |
|---|---|---|---|
| C4.static-cross-site, C4.script-cross-site | beacon | refused.3 page addScript, refused.7 child addScript, refused.8 setAutoAttach | The
{target}beacon can come from the child's init script (OOPIF) or from the page's (in-process frame). Refusing only refused.3 excuses an observation the child script could still measure. Which script fires depends on the process model, so this is a design call. It is a beacon row, so it is not touched here. || C5.guessed-id.continue-response | candidates, refused, answered, overridden | refused.2
Fetch.enable| These are client observations, not fixture-only. They are listed on request.refused.2isonlyProtected, so a guard that refuses Fetch.enable wholesale already fails its control ("a protected-only step was refused on the control"). Owner decision: this stays the design. No declared field and no schema change. || B2.headers, X1.after-exit (outside C1–C5/E) | header; instrumented/headed | refused.3 setExtraHTTPHeaders; initScript/extraHeaders | The dependency is the step that produces the header or beacon, so it is needed. |
Consumer effect
ownis not-applicable), on a guard that refuses addScript orPage.setBypassCSP(either one used to excuseprotectedHopandlanded):- It leaks the redirect-through: guarded pass → fail (intended).
- It blocks at the protected hop: stays pass.
- The first hop at the ordinary origin is never served (cut at the ordinary hop, or the href never navigates): pass → incomplete.
- On the control leg, the ordinary-origin chain is now measured. A control that never lands on
{cross}goes pass → fail, and one whose chain never starts goes pass → incomplete.chainStarted: trueand no change.- C5.guessed-id.continue-response (
onlyProtectedFetch.enable).- C8.browser-ui-listed (a
via: unguardedcontrol, which fails on any refusal).- Without this PR's dependsOn change, the invariant would have flipped C2.through-302/307 to incomplete.
Impact on the guards' reports
A throwaway script, not in the repo, read each per-row report as JSON only. It lists the rows whose control passed with every observation excused, under
origin/mainvectors and under this PR's vectors. It also lists the observations that were excused in the report and are measured with this PR's vectors.slicc-cdp, run 44609779996 (guard c40e5b64, slicc-browsers 1.28.1; guard-a..d, 964 rows):
refused.3: true, refused.4: trueon both legs.chainStarted,protectedHopandlandedon both legs. Their verdict under this head needs a slicc-cdp run. Today they pass with nothing measured.refused.2: false, every observation measured, pass/pass/pass on all four targets. No change.slicc-cdp, run 44620930162 (draft runCapabilities change c1eca024, autoAttach undeclared; guard-a..d): the same as above. 0 rows with this PR's vectors. The same 16 through rows would have been flipped by the invariant alone and are now measured.
slicc-cli, diagnostic runs (no per-row artifact yet), prompt and lagging,
SETTLEDIAG:settle:skipped-refusedon both legs, all pass/pass/pass: C1.script-nav ×5; C2.chain-301-302-303, C2.chain-307-308-302, C2.chain-303-301-308, C2.post-307-308 and C2.post-308-307 ×4 each; C2.through-302 and C2.through-307 ×4 each; C3.popup-self-nav ×5.loaded, plushoppedfor chain/post, bothdependsOn: []), so the invariant leaves them unchanged.chainStarted/protectedHop/landed.SETTLEDIAGlines (C3.tab-attach) are settle errors, not refusals.refused.values. To be refined when the per-row artifact arrives.bios: pending a per-row artifact.
Checks run locally
npm ci,npm run validate,npm run lint.