detonate 0.1.5

Prove an injected web payload actually EXECUTES (alert(1) fires), not just reflects: a shared XSS-execution oracle over a jsdet sandbox.
Documentation

detonate - XSS execution oracle for web payloads

santh status

Prove an injected web payload actually executes (alert(1) or dangerous sink fires), not just reflects. WAF-bypass ≠ exploit, and reflection ≠ execution: a payload can pass a WAF and echo back in the response yet never reach a context where its JavaScript runs.

detonate separates "the bytes came back" from "the script ran". It parses HTML responses using an HTML5 spec parser (html5ever via scraper), extracts executable JavaScript while filtering out inert data blocks (<script type="text/plain">, <script type="application/json">, comments, and attribute values), and executes the script fragments through either a QuickJS-in-WASM sandbox (jsdet) or real headless Chrome. It reports whether a dialog sink (alert, confirm, prompt) or dangerous capability (fetch, eval, document.write, document.cookie) fired.

Quick start

Add detonate to your Cargo.toml:

[dependencies]
detonate = "0.1.2"

Prove execution of reflected HTML payload:

use detonate::{detonate_html, Engine};

fn main() {
    let proof = detonate_html(
        r#"<div><script>alert(1)</script></div>"#,
        "https://target.example/reflect",
    );

    if proof.proves("1") {
        println!("Execution proven! Alert message: {:?}", proof.message);
    }
}

Or invoke the out-of-process CLI:

echo '<div><script>alert(1)</script></div>' | detonate --url https://target.example/reflect --expect 1

When to use / when not to use

When to use

  • XSS Validation: Proving whether reflected user input in HTTP responses actually executes JavaScript.
  • WAF Evasion Verification: Ensuring generated bypass payloads fire without user interaction.
  • Mutation XSS (mXSS) Testing: Validating re-serialization DOM mutations via the optional headless Chrome engine.

When not to use

  • High-throughput Static Scanning: When checking millions of endpoints where parsing and sandboxing overhead is too high.
  • Interaction-only Payloads: When testing vectors that require explicit user interaction (onclick, onmouseover).

Compared to alternatives

Compared to Regex Reflection Matching

Regex reflection checkers treat reflected string matches as potential execution. This causes high false positive rates by flagging commented scripts, attribute text, and non-executable data blocks (<script type="text/plain">), while suffering false negatives on obfuscated or mXSS payloads. detonate uses a spec-compliant HTML parser and sandboxed JS engines to guarantee that only executing payloads are reported.

Compared to Heavy Browser Automation (Puppeteer / Playwright)

Full browser automation frameworks require ~500MB RAM per instance, full OS display/driver setup, and multi-second startup times. detonate defaults to an isolated QuickJS-in-WASM sandbox with sub-millisecond execution and strict fuel/memory bounds, degrading gracefully to headless Chrome only when mXSS DOM re-serialization proof is explicitly requested.

How it fits in Santh

detonate is an offensive execution oracle crate in libs/offensive/detonate. It isolates heavy WASM runtime dependencies (jsdet-core, jsdet-browser) and provides both library APIs and an out-of-process CLI binary consumed by scanner tools (such as wafrift).

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.