blitzstrike 2.4.121 → 2.4.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ All notable changes to Blitz Strike are documented here.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [2.4.123] — 2026-09-29
9
+
10
+ ### Added — circuit breaker (`target_health` + `circuit_status`)
11
+
12
+ - New `target_health(target, limit?)`: probe a target (10s timeout) and track
13
+ consecutive failures in a persisted circuit-breaker state; after 5 consecutive
14
+ timeouts/5xx the circuit OPENS (PAUSE) and auto-closes on the next successful
15
+ probe. `circuit_status()` lists every tracked target's state. Tells the agent
16
+ to stop hammering an unresponsive target instead of burning requests. (156 MCP tools.)
17
+
18
+ ## [2.4.122] — 2026-09-29
19
+
20
+ ### Added — `param_surface` (autonomous parameter discovery + specialist hints)
21
+
22
+ - New `param_surface(target, class?)`: fetch a target and extract EVERY testable
23
+ parameter — URL query params, HTML form fields, path-segment identifiers
24
+ (/users/123 + UUIDs), and JS-referenced endpoints — then attach per-class
25
+ discovery + test hints so the agent tests the DISCOVERED params, not just the
26
+ hinted one. New `intelligence/specialist-discovery.json` maps 15 vuln classes
27
+ (xss/sqli/ssrf/idor/lfi/rce/xxe/jwt/open_redirect/prototype_pollution/csti/
28
+ mass_assignment/header_injection/api_security/file_upload) to where to look +
29
+ which tool to drive. (154 MCP tools.)
30
+
8
31
  ## [2.4.121] — 2026-09-29
9
32
 
10
33
  ### Added — empirical ledger auto-feed + benchmark coverage 30/30
package/dist/index.js CHANGED
@@ -17452,10 +17452,10 @@ var init_variants = __esm(() => {
17452
17452
  });
17453
17453
 
17454
17454
  // src/sync.ts
17455
- import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync9, readFileSync as readFileSync30, readdirSync as readdirSync9, statSync as statSync6, rmSync as rmSync5 } from "node:fs";
17456
- import { join as join29 } from "node:path";
17457
- import { homedir as homedir11 } from "node:os";
17458
- import { fileURLToPath as fileURLToPath17 } from "node:url";
17455
+ import { mkdirSync as mkdirSync11, writeFileSync as writeFileSync10, readFileSync as readFileSync32, readdirSync as readdirSync9, statSync as statSync6, rmSync as rmSync5 } from "node:fs";
17456
+ import { join as join31 } from "node:path";
17457
+ import { homedir as homedir12 } from "node:os";
17458
+ import { fileURLToPath as fileURLToPath18 } from "node:url";
17459
17459
  import { spawnSync as spawnSync4 } from "node:child_process";
17460
17460
  function dirExists(p) {
17461
17461
  try {
@@ -17470,7 +17470,7 @@ function countFiles(dir) {
17470
17470
  const walk = (d) => {
17471
17471
  for (const e of readdirSync9(d, { withFileTypes: true })) {
17472
17472
  if (e.isDirectory())
17473
- walk(join29(d, e.name));
17473
+ walk(join31(d, e.name));
17474
17474
  else
17475
17475
  n++;
17476
17476
  }
@@ -17483,9 +17483,9 @@ function countFiles(dir) {
17483
17483
  }
17484
17484
  function syncData() {
17485
17485
  if (!dirExists(DATA_ROOT2))
17486
- mkdirSync10(DATA_ROOT2, { recursive: true });
17487
- const payloadsPath = join29(DATA_ROOT2, "payloads");
17488
- const templatesPath = join29(DATA_ROOT2, "templates");
17486
+ mkdirSync11(DATA_ROOT2, { recursive: true });
17487
+ const payloadsPath = join31(DATA_ROOT2, "payloads");
17488
+ const templatesPath = join31(DATA_ROOT2, "templates");
17489
17489
  const hasPayloads = dirExists(payloadsPath) && countFiles(payloadsPath) > 0;
17490
17490
  const hasTemplates = dirExists(templatesPath) && countFiles(templatesPath) > 0;
17491
17491
  if (hasPayloads && hasTemplates) {
@@ -17495,8 +17495,8 @@ function syncData() {
17495
17495
  data_root: DATA_ROOT2
17496
17496
  };
17497
17497
  }
17498
- const localPayloads = join29(ROOT10, "payloads");
17499
- const localTemplates = join29(ROOT10, "templates");
17498
+ const localPayloads = join31(ROOT11, "payloads");
17499
+ const localTemplates = join31(ROOT11, "templates");
17500
17500
  let payloadsSynced = false;
17501
17501
  let templatesSynced = false;
17502
17502
  if (!hasPayloads && dirExists(localPayloads)) {
@@ -17509,7 +17509,7 @@ function syncData() {
17509
17509
  }
17510
17510
  const gitOk = spawnSync4("git", ["--version"]).status === 0;
17511
17511
  if (gitOk && (!dirExists(payloadsPath) || countFiles(payloadsPath) === 0 || !dirExists(templatesPath) || countFiles(templatesPath) === 0)) {
17512
- const tmp = join29(DATA_ROOT2, ".tmp-clone");
17512
+ const tmp = join31(DATA_ROOT2, ".tmp-clone");
17513
17513
  if (dirExists(tmp))
17514
17514
  rmSync5(tmp, { recursive: true, force: true });
17515
17515
  const r = spawnSync4("git", ["clone", "--depth", "1", "--filter=blob:none", "--sparse", GITHUB_REPO, tmp], { timeout: 120000 });
@@ -17517,11 +17517,11 @@ function syncData() {
17517
17517
  const sparse = spawnSync4("git", ["-C", tmp, "sparse-checkout", "set", "payloads", "templates"], { timeout: 120000 });
17518
17518
  if (sparse.status === 0) {
17519
17519
  if (!dirExists(payloadsPath) || countFiles(payloadsPath) === 0) {
17520
- copyDir(join29(tmp, "payloads"), payloadsPath);
17520
+ copyDir(join31(tmp, "payloads"), payloadsPath);
17521
17521
  payloadsSynced = true;
17522
17522
  }
17523
17523
  if (!dirExists(templatesPath) || countFiles(templatesPath) === 0) {
17524
- copyDir(join29(tmp, "templates"), templatesPath);
17524
+ copyDir(join31(tmp, "templates"), templatesPath);
17525
17525
  templatesSynced = true;
17526
17526
  }
17527
17527
  }
@@ -17541,20 +17541,20 @@ function copyDir(src, dst) {
17541
17541
  }
17542
17542
  }
17543
17543
  function manualCopy(src, dst) {
17544
- mkdirSync10(dst, { recursive: true });
17544
+ mkdirSync11(dst, { recursive: true });
17545
17545
  for (const e of readdirSync9(src, { withFileTypes: true })) {
17546
- const s = join29(src, e.name);
17547
- const d = join29(dst, e.name);
17546
+ const s = join31(src, e.name);
17547
+ const d = join31(dst, e.name);
17548
17548
  if (e.isDirectory())
17549
17549
  manualCopy(s, d);
17550
17550
  else
17551
- writeFileSync9(d, readFileSync30(s));
17551
+ writeFileSync10(d, readFileSync32(s));
17552
17552
  }
17553
17553
  }
17554
- var ROOT10, DATA_ROOT2, GITHUB_REPO = "https://github.com/shinthink/blitzstrike.git";
17554
+ var ROOT11, DATA_ROOT2, GITHUB_REPO = "https://github.com/shinthink/blitzstrike.git";
17555
17555
  var init_sync = __esm(() => {
17556
- ROOT10 = join29(fileURLToPath17(new URL(".", import.meta.url)), "..");
17557
- DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ?? join29(homedir11(), ".blitzstrike", "data");
17556
+ ROOT11 = join31(fileURLToPath18(new URL(".", import.meta.url)), "..");
17557
+ DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ?? join31(homedir12(), ".blitzstrike", "data");
17558
17558
  });
17559
17559
 
17560
17560
  // src/update.ts
@@ -17599,15 +17599,15 @@ var init_update = __esm(() => {
17599
17599
  });
17600
17600
 
17601
17601
  // src/release.ts
17602
- import { readFileSync as readFileSync32, existsSync as existsSync17 } from "node:fs";
17603
- import { join as join30 } from "node:path";
17604
- import { fileURLToPath as fileURLToPath18 } from "node:url";
17602
+ import { readFileSync as readFileSync34, existsSync as existsSync18 } from "node:fs";
17603
+ import { join as join32 } from "node:path";
17604
+ import { fileURLToPath as fileURLToPath19 } from "node:url";
17605
17605
  import { execSync as execSync4 } from "node:child_process";
17606
17606
  function validateRelease() {
17607
17607
  const checks = [];
17608
17608
  checks.push({ name: "package.json version", ok: true, detail: VERSION });
17609
17609
  try {
17610
- const changelog = readFileSync32(join30(ROOT11, "CHANGELOG.md"), "utf8");
17610
+ const changelog = readFileSync34(join32(ROOT12, "CHANGELOG.md"), "utf8");
17611
17611
  const m = changelog.match(/^##\s+\[([0-9]+\.[0-9]+\.[0-9]+)\]/m);
17612
17612
  const changelogVersion = m?.[1] ?? null;
17613
17613
  checks.push({
@@ -17619,7 +17619,7 @@ function validateRelease() {
17619
17619
  checks.push({ name: "CHANGELOG version", ok: false, detail: "CHANGELOG.md not found" });
17620
17620
  }
17621
17621
  try {
17622
- const tag = execSync4("git describe --tags --abbrev=0", { cwd: ROOT11, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
17622
+ const tag = execSync4("git describe --tags --abbrev=0", { cwd: ROOT12, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
17623
17623
  checks.push({ name: "Git tag", ok: tag === `v${VERSION}`, detail: tag, soft: true });
17624
17624
  } catch {
17625
17625
  checks.push({ name: "Git tag", ok: true, detail: "unavailable (no git/tags)", soft: true });
@@ -17639,22 +17639,22 @@ function validateRelease() {
17639
17639
  return { version: VERSION, checks, consistent: checks.filter((c) => !c.soft).every((c) => c.ok) };
17640
17640
  }
17641
17641
  function lockfilePresent() {
17642
- return existsSync17(join30(ROOT11, "package-lock.json")) || existsSync17(join30(ROOT11, "bun.lock")) || existsSync17(join30(ROOT11, "bun.lockb"));
17642
+ return existsSync18(join32(ROOT12, "package-lock.json")) || existsSync18(join32(ROOT12, "bun.lock")) || existsSync18(join32(ROOT12, "bun.lockb"));
17643
17643
  }
17644
- var ROOT11;
17644
+ var ROOT12;
17645
17645
  var init_release = __esm(() => {
17646
17646
  init_version();
17647
- ROOT11 = join30(fileURLToPath18(new URL(".", import.meta.url)), "..");
17647
+ ROOT12 = join32(fileURLToPath19(new URL(".", import.meta.url)), "..");
17648
17648
  });
17649
17649
 
17650
17650
  // src/dependency.ts
17651
- import { readFileSync as readFileSync33 } from "node:fs";
17652
- import { join as join31 } from "node:path";
17653
- import { fileURLToPath as fileURLToPath19 } from "node:url";
17651
+ import { readFileSync as readFileSync35 } from "node:fs";
17652
+ import { join as join33 } from "node:path";
17653
+ import { fileURLToPath as fileURLToPath20 } from "node:url";
17654
17654
  function checkDependencies() {
17655
17655
  let pkg = {};
17656
17656
  try {
17657
- pkg = JSON.parse(readFileSync33(join31(ROOT12, "package.json"), "utf8"));
17657
+ pkg = JSON.parse(readFileSync35(join33(ROOT13, "package.json"), "utf8"));
17658
17658
  } catch {
17659
17659
  return { install_scripts: [], git_dependencies: [], total_dependencies: 0, safe: false };
17660
17660
  }
@@ -17675,16 +17675,16 @@ function checkDependencies() {
17675
17675
  safe: installScripts.length === 0 && gitDependencies.length === 0
17676
17676
  };
17677
17677
  }
17678
- var ROOT12;
17678
+ var ROOT13;
17679
17679
  var init_dependency = __esm(() => {
17680
- ROOT12 = join31(fileURLToPath19(new URL(".", import.meta.url)), "..");
17680
+ ROOT13 = join33(fileURLToPath20(new URL(".", import.meta.url)), "..");
17681
17681
  });
17682
17682
 
17683
17683
  // src/cli.ts
17684
- import { readFileSync as readFileSync34, existsSync as existsSync18, writeFileSync as writeFileSync10, mkdirSync as mkdirSync11 } from "node:fs";
17685
- import { join as join32, dirname as dirname6 } from "node:path";
17686
- import { homedir as homedir12 } from "node:os";
17687
- import { fileURLToPath as fileURLToPath20 } from "node:url";
17684
+ import { readFileSync as readFileSync36, existsSync as existsSync19, writeFileSync as writeFileSync11, mkdirSync as mkdirSync12 } from "node:fs";
17685
+ import { join as join34, dirname as dirname6 } from "node:path";
17686
+ import { homedir as homedir13 } from "node:os";
17687
+ import { fileURLToPath as fileURLToPath21 } from "node:url";
17688
17688
  import { spawnSync as spawnSync5 } from "node:child_process";
17689
17689
  function which(cmd) {
17690
17690
  return spawnSync5("sh", ["-c", 'command -v "$1" >/dev/null 2>&1', "sh", cmd]).status === 0;
@@ -17727,7 +17727,7 @@ async function runDoctor() {
17727
17727
  detail: h1 ? `X-HackerOne-Research: ${h1}` : "H1_USERNAME not set",
17728
17728
  fix: h1 ? undefined : "export H1_USERNAME=<your-hackerone-username> (adds X-HackerOne-Research to outbound requests)"
17729
17729
  });
17730
- const dataOk = existsSync18(join32(ROOT13, "chains.json")) && existsSync18(join32(ROOT13, "tools-catalog.json"));
17730
+ const dataOk = existsSync19(join34(ROOT14, "chains.json")) && existsSync19(join34(ROOT14, "tools-catalog.json"));
17731
17731
  issues.push({
17732
17732
  name: "Data layers (chains + tools-catalog)",
17733
17733
  status: dataOk ? "ok" : "fail",
@@ -17778,21 +17778,21 @@ BlitzStrike — ${verdict}`);
17778
17778
  function resolveCommand() {
17779
17779
  if (which("blitzstrike"))
17780
17780
  return { command: "blitzstrike", args: ["serve", "--mcp"] };
17781
- const src = join32(ROOT13, "src", "index.ts");
17782
- if (which("bun") && existsSync18(src))
17781
+ const src = join34(ROOT14, "src", "index.ts");
17782
+ if (which("bun") && existsSync19(src))
17783
17783
  return { command: "bun", args: ["run", src, "serve", "--mcp"] };
17784
17784
  if (which("npx"))
17785
17785
  return { command: "npx", args: ["-y", "blitzstrike", "serve", "--mcp"] };
17786
17786
  if (which("bunx"))
17787
17787
  return { command: "bunx", args: ["blitzstrike", "serve", "--mcp"] };
17788
- const dist = join32(ROOT13, "dist", "index.js");
17789
- if (existsSync18(dist))
17788
+ const dist = join34(ROOT14, "dist", "index.js");
17789
+ if (existsSync19(dist))
17790
17790
  return { command: "bun", args: [dist, "serve", "--mcp"] };
17791
17791
  return { command: "npx", args: ["-y", "blitzstrike", "serve", "--mcp"] };
17792
17792
  }
17793
17793
  function readJson(p) {
17794
17794
  try {
17795
- return JSON.parse(readFileSync34(p, "utf8"));
17795
+ return JSON.parse(readFileSync36(p, "utf8"));
17796
17796
  } catch {
17797
17797
  return null;
17798
17798
  }
@@ -17800,51 +17800,51 @@ function readJson(p) {
17800
17800
  function jsonMcpServersWrite(p) {
17801
17801
  return (command, args) => {
17802
17802
  const dir = dirname6(p);
17803
- if (!existsSync18(dir))
17804
- mkdirSync11(dir, { recursive: true });
17803
+ if (!existsSync19(dir))
17804
+ mkdirSync12(dir, { recursive: true });
17805
17805
  const existing = readJson(p) ?? {};
17806
17806
  existing.mcpServers = {
17807
17807
  ...existing.mcpServers ?? {},
17808
17808
  blitzstrike: { command, args }
17809
17809
  };
17810
- writeFileSync10(p, JSON.stringify(existing, null, 2));
17810
+ writeFileSync11(p, JSON.stringify(existing, null, 2));
17811
17811
  };
17812
17812
  }
17813
17813
  function opencodeWrite(p) {
17814
17814
  return (command, args) => {
17815
17815
  const dir = dirname6(p);
17816
- if (!existsSync18(dir))
17817
- mkdirSync11(dir, { recursive: true });
17816
+ if (!existsSync19(dir))
17817
+ mkdirSync12(dir, { recursive: true });
17818
17818
  const existing = readJson(p) ?? {};
17819
17819
  existing.mcp = {
17820
17820
  ...existing.mcp ?? {},
17821
17821
  blitzstrike: { type: "local", command: [command, ...args], enabled: true }
17822
17822
  };
17823
- writeFileSync10(p, JSON.stringify(existing, null, 2));
17823
+ writeFileSync11(p, JSON.stringify(existing, null, 2));
17824
17824
  copyOpenCodeAgents();
17825
17825
  };
17826
17826
  }
17827
17827
  function copyOpenCodeAgents() {
17828
- const srcDir = join32(ROOT13, "opencode-agents");
17829
- const dstDir = join32(homedir12(), ".config", "opencode", "agents");
17830
- if (!existsSync18(srcDir))
17828
+ const srcDir = join34(ROOT14, "opencode-agents");
17829
+ const dstDir = join34(homedir13(), ".config", "opencode", "agents");
17830
+ if (!existsSync19(srcDir))
17831
17831
  return;
17832
- if (!existsSync18(dstDir))
17833
- mkdirSync11(dstDir, { recursive: true });
17832
+ if (!existsSync19(dstDir))
17833
+ mkdirSync12(dstDir, { recursive: true });
17834
17834
  for (const f of ["Blitz Strike.md", "Blitz.md", "Eagle Eye.md", "Strike.md"]) {
17835
- const src = join32(srcDir, f);
17836
- const dst = join32(dstDir, f);
17837
- if (existsSync18(src)) {
17838
- writeFileSync10(dst, readFileSync34(src, "utf8"));
17835
+ const src = join34(srcDir, f);
17836
+ const dst = join34(dstDir, f);
17837
+ if (existsSync19(src)) {
17838
+ writeFileSync11(dst, readFileSync36(src, "utf8"));
17839
17839
  }
17840
17840
  }
17841
17841
  }
17842
17842
  function codexWrite(p) {
17843
17843
  return (command, args) => {
17844
17844
  const dir = dirname6(p);
17845
- if (!existsSync18(dir))
17846
- mkdirSync11(dir, { recursive: true });
17847
- let existing = existsSync18(p) ? readFileSync34(p, "utf8") : "";
17845
+ if (!existsSync19(dir))
17846
+ mkdirSync12(dir, { recursive: true });
17847
+ let existing = existsSync19(p) ? readFileSync36(p, "utf8") : "";
17848
17848
  if (!existing.trimEnd().endsWith(`
17849
17849
  `))
17850
17850
  existing += `
@@ -17855,15 +17855,15 @@ function codexWrite(p) {
17855
17855
  command = "${command}"
17856
17856
  args = ${JSON.stringify(args)}
17857
17857
  `;
17858
- writeFileSync10(p, existing);
17858
+ writeFileSync11(p, existing);
17859
17859
  };
17860
17860
  }
17861
17861
  function hermesWrite(p) {
17862
17862
  return (command, args) => {
17863
17863
  const dir = dirname6(p);
17864
- if (!existsSync18(dir))
17865
- mkdirSync11(dir, { recursive: true });
17866
- let existing = existsSync18(p) ? readFileSync34(p, "utf8") : "";
17864
+ if (!existsSync19(dir))
17865
+ mkdirSync12(dir, { recursive: true });
17866
+ let existing = existsSync19(p) ? readFileSync36(p, "utf8") : "";
17867
17867
  existing = existing.replace(/^ blitzstrike:\n(?: .*\n?)*/m, "");
17868
17868
  if (!existing.trimEnd().endsWith(`
17869
17869
  `))
@@ -17884,80 +17884,80 @@ mcp_servers:
17884
17884
  args: ${JSON.stringify(args)}
17885
17885
  `;
17886
17886
  }
17887
- writeFileSync10(p, existing);
17887
+ writeFileSync11(p, existing);
17888
17888
  };
17889
17889
  }
17890
17890
  function detectAgents() {
17891
- const home = homedir12();
17891
+ const home = homedir13();
17892
17892
  const agents = [];
17893
- const claudeJson = join32(home, ".claude.json");
17893
+ const claudeJson = join34(home, ".claude.json");
17894
17894
  agents.push({
17895
17895
  name: "Claude Code",
17896
17896
  detectPath: claudeJson,
17897
- installed: () => existsSync18(claudeJson) || which("claude"),
17897
+ installed: () => existsSync19(claudeJson) || which("claude"),
17898
17898
  write: jsonMcpServersWrite(claudeJson)
17899
17899
  });
17900
- const claudeDesktop = join32(home, ".config", "Claude", "claude_desktop_config.json");
17900
+ const claudeDesktop = join34(home, ".config", "Claude", "claude_desktop_config.json");
17901
17901
  agents.push({
17902
17902
  name: "Claude Desktop",
17903
17903
  detectPath: claudeDesktop,
17904
- installed: () => existsSync18(claudeDesktop),
17904
+ installed: () => existsSync19(claudeDesktop),
17905
17905
  write: jsonMcpServersWrite(claudeDesktop)
17906
17906
  });
17907
- const cursor = join32(home, ".cursor", "mcp.json");
17907
+ const cursor = join34(home, ".cursor", "mcp.json");
17908
17908
  agents.push({
17909
17909
  name: "Cursor",
17910
17910
  detectPath: cursor,
17911
- installed: () => existsSync18(join32(home, ".cursor")) || which("cursor"),
17911
+ installed: () => existsSync19(join34(home, ".cursor")) || which("cursor"),
17912
17912
  write: jsonMcpServersWrite(cursor)
17913
17913
  });
17914
- const opencode = join32(home, ".config", "opencode", "opencode.jsonc");
17914
+ const opencode = join34(home, ".config", "opencode", "opencode.jsonc");
17915
17915
  agents.push({
17916
17916
  name: "OpenCode",
17917
17917
  detectPath: opencode,
17918
- installed: () => existsSync18(join32(home, ".config", "opencode")) || which("opencode"),
17918
+ installed: () => existsSync19(join34(home, ".config", "opencode")) || which("opencode"),
17919
17919
  write: opencodeWrite(opencode)
17920
17920
  });
17921
- const codex = join32(home, ".codex", "config.toml");
17921
+ const codex = join34(home, ".codex", "config.toml");
17922
17922
  agents.push({
17923
17923
  name: "Codex",
17924
17924
  detectPath: codex,
17925
- installed: () => existsSync18(join32(home, ".codex")) || which("codex"),
17925
+ installed: () => existsSync19(join34(home, ".codex")) || which("codex"),
17926
17926
  write: codexWrite(codex)
17927
17927
  });
17928
- const hermes = join32(home, ".hermes", "config.yaml");
17928
+ const hermes = join34(home, ".hermes", "config.yaml");
17929
17929
  agents.push({
17930
17930
  name: "Hermes",
17931
17931
  detectPath: hermes,
17932
- installed: () => existsSync18(join32(home, ".hermes")) || which("hermes"),
17932
+ installed: () => existsSync19(join34(home, ".hermes")) || which("hermes"),
17933
17933
  write: hermesWrite(hermes)
17934
17934
  });
17935
- const gemini = join32(home, ".gemini", "settings.json");
17935
+ const gemini = join34(home, ".gemini", "settings.json");
17936
17936
  agents.push({
17937
17937
  name: "Gemini CLI",
17938
17938
  detectPath: gemini,
17939
- installed: () => existsSync18(join32(home, ".gemini")) || which("gemini"),
17939
+ installed: () => existsSync19(join34(home, ".gemini")) || which("gemini"),
17940
17940
  write: jsonMcpServersWrite(gemini)
17941
17941
  });
17942
- const windsurf = join32(home, ".codeium", "windsurf", "mcp_config.json");
17942
+ const windsurf = join34(home, ".codeium", "windsurf", "mcp_config.json");
17943
17943
  agents.push({
17944
17944
  name: "Windsurf",
17945
17945
  detectPath: windsurf,
17946
- installed: () => existsSync18(join32(home, ".codeium")) || which("windsurf"),
17946
+ installed: () => existsSync19(join34(home, ".codeium")) || which("windsurf"),
17947
17947
  write: jsonMcpServersWrite(windsurf)
17948
17948
  });
17949
- const copilot = join32(home, ".copilot", "mcp.json");
17949
+ const copilot = join34(home, ".copilot", "mcp.json");
17950
17950
  agents.push({
17951
17951
  name: "Copilot",
17952
17952
  detectPath: copilot,
17953
- installed: () => existsSync18(join32(home, ".copilot")),
17953
+ installed: () => existsSync19(join34(home, ".copilot")),
17954
17954
  write: jsonMcpServersWrite(copilot)
17955
17955
  });
17956
- const cline = join32(home, ".cline", "mcp_settings.json");
17956
+ const cline = join34(home, ".cline", "mcp_settings.json");
17957
17957
  agents.push({
17958
17958
  name: "Cline",
17959
17959
  detectPath: cline,
17960
- installed: () => existsSync18(join32(home, ".cline")),
17960
+ installed: () => existsSync19(join34(home, ".cline")),
17961
17961
  write: jsonMcpServersWrite(cline)
17962
17962
  });
17963
17963
  return agents;
@@ -18069,13 +18069,13 @@ Failed (${failedList.length}) — reason per tool:`);
18069
18069
  Common causes: missing toolchain, pip/git network failures, or very heavy builds. ` + `Re-run after installing the missing toolchain — failed tools are skipped, not fatal.`);
18070
18070
  }
18071
18071
  }
18072
- var ROOT13;
18072
+ var ROOT14;
18073
18073
  var init_cli = __esm(() => {
18074
18074
  init_catalog();
18075
18075
  init_release();
18076
18076
  init_dependency();
18077
18077
  init_mcp_status();
18078
- ROOT13 = join32(fileURLToPath20(new URL(".", import.meta.url)), "..");
18078
+ ROOT14 = join34(fileURLToPath21(new URL(".", import.meta.url)), "..");
18079
18079
  });
18080
18080
 
18081
18081
  // node_modules/zod/v3/helpers/util.js
@@ -32713,7 +32713,7 @@ class StdioServerTransport {
32713
32713
 
32714
32714
  // src/server.ts
32715
32715
  init_scanner();
32716
- import { readFileSync as readFileSync31 } from "node:fs";
32716
+ import { readFileSync as readFileSync33 } from "node:fs";
32717
32717
  import { execFileSync as execFileSync8 } from "node:child_process";
32718
32718
 
32719
32719
  // src/review-harness.ts
@@ -60508,19 +60508,175 @@ async function nucleiScan(opts) {
60508
60508
  };
60509
60509
  }
60510
60510
 
60511
- // src/benchmark.ts
60512
- import { readFileSync as readFileSync25, readdirSync as readdirSync7, writeFileSync as writeFileSync6, rmSync as rmSync3, mkdirSync as mkdirSync7 } from "node:fs";
60511
+ // src/param-surface.ts
60512
+ import { readFileSync as readFileSync25 } from "node:fs";
60513
60513
  import { join as join25 } from "node:path";
60514
60514
  import { fileURLToPath as fileURLToPath15 } from "node:url";
60515
- import { tmpdir as tmpdir3, homedir as homedir9 } from "node:os";
60516
- init_complex_bugs();
60517
60515
  var ROOT8 = join25(fileURLToPath15(new URL(".", import.meta.url)), "..");
60518
- var CORPUS = join25(ROOT8, "bench", "corpus");
60519
- var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ?? join25(homedir9(), ".blitzstrike", "corpus");
60516
+ function loadSpecialists() {
60517
+ try {
60518
+ return JSON.parse(readFileSync25(join25(ROOT8, "intelligence", "specialist-discovery.json"), "utf8")).classes;
60519
+ } catch {
60520
+ return [];
60521
+ }
60522
+ }
60523
+ function formFields(html) {
60524
+ const out = new Set;
60525
+ const re = /<(?:input|select|textarea|button)\b[^>]*\bname\s*=\s*["']([^"']+)["']/gi;
60526
+ let m;
60527
+ while ((m = re.exec(html)) !== null)
60528
+ if (m[1] && !/^(csrf|_csrf|token|_token)$/i.test(m[1]))
60529
+ out.add(m[1]);
60530
+ return [...out];
60531
+ }
60532
+ function pathParams(urls) {
60533
+ const seen = new Set;
60534
+ const out = [];
60535
+ const uuidRe = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;
60536
+ for (const u of urls) {
60537
+ let path = "";
60538
+ try {
60539
+ path = new URL(u).pathname;
60540
+ } catch {
60541
+ continue;
60542
+ }
60543
+ const segs = path.split("/").filter(Boolean);
60544
+ for (let i = 0;i < segs.length; i++) {
60545
+ const s = segs[i];
60546
+ const prev = segs[i - 1] ?? "id";
60547
+ if (/^\d+$/.test(s)) {
60548
+ const name = prev.replace(/[^a-z0-9_]/gi, "").toLowerCase() || "id";
60549
+ const key = `${name}:id`;
60550
+ if (!seen.has(key)) {
60551
+ seen.add(key);
60552
+ out.push({ name, sample: s, kind: "id" });
60553
+ }
60554
+ } else if (uuidRe.test(s)) {
60555
+ const name = prev.replace(/[^a-z0-9_]/gi, "").toLowerCase() || "uuid";
60556
+ const key = `${name}:uuid`;
60557
+ if (!seen.has(key)) {
60558
+ seen.add(key);
60559
+ out.push({ name, sample: s, kind: "uuid" });
60560
+ }
60561
+ }
60562
+ }
60563
+ }
60564
+ return out;
60565
+ }
60566
+ function jsRefs(html) {
60567
+ const out = new Set;
60568
+ for (const m of html.matchAll(/(?:fetch|axios(?:\.get|\.post)?|XMLHttpRequest\.open)\s*\(\s*["'`]([^"'`]+)["'`]/gi)) {
60569
+ const u = m[1];
60570
+ if (/^https?:\/\//i.test(u) || u.startsWith("/"))
60571
+ out.add(u);
60572
+ }
60573
+ return [...out].slice(0, 50);
60574
+ }
60575
+ async function paramSurface(target, class_) {
60576
+ const base = target.replace(/\/$/, "");
60577
+ let html = "";
60578
+ let status = 0;
60579
+ try {
60580
+ const res = await fetch(target, { redirect: "follow", headers: { "User-Agent": "Mozilla/5.0 (compatible; BlitzStrike/2.4)" } });
60581
+ status = res.status;
60582
+ html = await res.text();
60583
+ } catch {}
60584
+ const { links, scripts } = crawlLinks(base, html);
60585
+ const allUrls = [target, ...links, ...scripts];
60586
+ const query = extractParams(allUrls);
60587
+ const fields = formFields(html);
60588
+ const paths = pathParams(allUrls);
60589
+ const js = jsRefs(html);
60590
+ const result = {
60591
+ target,
60592
+ url: base,
60593
+ query_params: query,
60594
+ form_fields: fields,
60595
+ path_params: paths,
60596
+ js_refs: js,
60597
+ total: query.length + fields.length + paths.length
60598
+ };
60599
+ if (class_) {
60600
+ const spec = loadSpecialists();
60601
+ const c = class_.toLowerCase().trim();
60602
+ const matched = spec.filter((s) => s.id === c || s.id.includes(c) || c.includes(s.id));
60603
+ result.specialist_hints = matched.length > 0 ? matched : spec.filter((s) => s.id.includes(c.slice(0, 3)));
60604
+ } else {
60605
+ result.specialist_hints = loadSpecialists();
60606
+ }
60607
+ return { ...result, url: base, status_hint: status === 0 ? "fetch failed" : `http ${status}` };
60608
+ }
60609
+
60610
+ // src/circuit-breaker.ts
60611
+ import { readFileSync as readFileSync26, writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, existsSync as existsSync13 } from "node:fs";
60612
+ import { join as join26 } from "node:path";
60613
+ import { homedir as homedir9 } from "node:os";
60614
+ var HOME_DIR4 = process.env.BLITZSTRIKE_HOME ?? join26(homedir9(), ".blitzstrike");
60615
+ var STATE_PATH = join26(HOME_DIR4, "circuit-breaker.json");
60616
+ function loadState() {
60617
+ try {
60618
+ if (existsSync13(STATE_PATH))
60619
+ return JSON.parse(readFileSync26(STATE_PATH, "utf8"));
60620
+ } catch {}
60621
+ return { targets: {} };
60622
+ }
60623
+ function saveState(s) {
60624
+ try {
60625
+ mkdirSync7(HOME_DIR4, { recursive: true });
60626
+ writeFileSync6(STATE_PATH, JSON.stringify(s, null, 2));
60627
+ } catch {}
60628
+ }
60629
+ async function targetHealth(target, limit = 5) {
60630
+ const state = loadState();
60631
+ const entry = state.targets[target] ?? { consecutive_failures: 0, last_checked: "", circuit: "closed" };
60632
+ let healthy = false;
60633
+ let status;
60634
+ const t0 = Date.now();
60635
+ try {
60636
+ const res = await fetch(target, { method: "GET", redirect: "follow", signal: AbortSignal.timeout(1e4), headers: { "User-Agent": "Mozilla/5.0 (compatible; BlitzStrike/2.4)" } });
60637
+ status = res.status;
60638
+ healthy = res.status < 500;
60639
+ } catch {
60640
+ healthy = false;
60641
+ }
60642
+ const responseMs = Date.now() - t0;
60643
+ if (healthy) {
60644
+ entry.consecutive_failures = 0;
60645
+ entry.circuit = "closed";
60646
+ entry.opened_at = undefined;
60647
+ } else {
60648
+ entry.consecutive_failures += 1;
60649
+ if (entry.consecutive_failures >= limit) {
60650
+ entry.circuit = "open";
60651
+ entry.opened_at = entry.opened_at ?? new Date().toISOString();
60652
+ }
60653
+ }
60654
+ entry.last_checked = new Date().toISOString();
60655
+ state.targets[target] = entry;
60656
+ saveState(state);
60657
+ const advice = entry.circuit === "open" ? `CIRCUIT OPEN after ${entry.consecutive_failures} consecutive failures — PAUSE this target and resume when it recovers (the circuit auto-closes on the next successful target_health probe).` : healthy ? `target responsive (HTTP ${status}) — safe to continue.` : `${entry.consecutive_failures}/${limit} consecutive failures — target degraded; consider slowing down or pausing before ${limit}.`;
60658
+ return { target, healthy, status_code: status, response_ms: responseMs, consecutive_failures: entry.consecutive_failures, circuit: entry.circuit, advice };
60659
+ }
60660
+ function circuitStatus() {
60661
+ const state = loadState();
60662
+ const targets = Object.entries(state.targets).map(([target, s]) => ({ target, ...s }));
60663
+ targets.sort((a, b) => b.consecutive_failures - a.consecutive_failures || (a.circuit === "open" ? -1 : 1));
60664
+ return { targets, open_count: targets.filter((t) => t.circuit === "open").length };
60665
+ }
60666
+
60667
+ // src/benchmark.ts
60668
+ import { readFileSync as readFileSync27, readdirSync as readdirSync7, writeFileSync as writeFileSync7, rmSync as rmSync3, mkdirSync as mkdirSync8 } from "node:fs";
60669
+ import { join as join27 } from "node:path";
60670
+ import { fileURLToPath as fileURLToPath16 } from "node:url";
60671
+ import { tmpdir as tmpdir3, homedir as homedir10 } from "node:os";
60672
+ init_complex_bugs();
60673
+ var ROOT9 = join27(fileURLToPath16(new URL(".", import.meta.url)), "..");
60674
+ var CORPUS = join27(ROOT9, "bench", "corpus");
60675
+ var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ?? join27(homedir10(), ".blitzstrike", "corpus");
60520
60676
  function parseCorpusFile(path) {
60521
60677
  let text;
60522
60678
  try {
60523
- text = readFileSync25(path, "utf8");
60679
+ text = readFileSync27(path, "utf8");
60524
60680
  } catch {
60525
60681
  return null;
60526
60682
  }
@@ -60576,7 +60732,7 @@ function loadDir(dir) {
60576
60732
  for (const f of readdirSync7(dir)) {
60577
60733
  if (!f.endsWith(".md"))
60578
60734
  continue;
60579
- const e = parseCorpusFile(join25(dir, f));
60735
+ const e = parseCorpusFile(join27(dir, f));
60580
60736
  if (e)
60581
60737
  entries.push(e);
60582
60738
  }
@@ -60587,7 +60743,7 @@ function loadCorpus2() {
60587
60743
  return [...loadDir(CORPUS), ...loadDir(CAPTURED_CORPUS_DIR)];
60588
60744
  }
60589
60745
  function captureFalsePositive(input) {
60590
- mkdirSync7(CAPTURED_CORPUS_DIR, { recursive: true });
60746
+ mkdirSync8(CAPTURED_CORPUS_DIR, { recursive: true });
60591
60747
  const slug = (input.note ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40) || "captured";
60592
60748
  const id = `fp-${slug}-${Date.now().toString(36)}`;
60593
60749
  const ext = { php: "php", javascript: "js", typescript: "ts", python: "py", java: "java", js: "js" }[input.language.toLowerCase()] ?? input.language;
@@ -60603,8 +60759,8 @@ function captureFalsePositive(input) {
60603
60759
  input.code,
60604
60760
  "```"
60605
60761
  ].filter((l) => l !== null);
60606
- const path = join25(CAPTURED_CORPUS_DIR, `${id}.md`);
60607
- writeFileSync6(path, lines.join(`
60762
+ const path = join27(CAPTURED_CORPUS_DIR, `${id}.md`);
60763
+ writeFileSync7(path, lines.join(`
60608
60764
  `) + `
60609
60765
  `, "utf8");
60610
60766
  const entry = { id, language: input.language.toLowerCase(), vulnerable: false, detector: input.detector, note: input.note, sink_type: input.sink_type, code: input.code };
@@ -60625,8 +60781,8 @@ function detect(entry) {
60625
60781
  }
60626
60782
  const lang = entry.language;
60627
60783
  if (lang === "php") {
60628
- const tmp = join25(tmpdir3(), `blitzstrike-bench-${entry.id}-${process.pid}.php`);
60629
- writeFileSync6(tmp, entry.code);
60784
+ const tmp = join27(tmpdir3(), `blitzstrike-bench-${entry.id}-${process.pid}.php`);
60785
+ writeFileSync7(tmp, entry.code);
60630
60786
  const r = analyzeDataFlow2(tmp);
60631
60787
  rmSync3(tmp, { force: true });
60632
60788
  if (r.findings.length > 0)
@@ -60694,25 +60850,25 @@ function runBenchmark() {
60694
60850
  }
60695
60851
 
60696
60852
  // src/obligations.ts
60697
- import { readFileSync as readFileSync26, appendFileSync as appendFileSync4, mkdirSync as mkdirSync8, existsSync as existsSync13, writeFileSync as writeFileSync7 } from "node:fs";
60698
- import { join as join26 } from "node:path";
60853
+ import { readFileSync as readFileSync28, appendFileSync as appendFileSync4, mkdirSync as mkdirSync9, existsSync as existsSync14, writeFileSync as writeFileSync8 } from "node:fs";
60854
+ import { join as join28 } from "node:path";
60699
60855
  import { createHash as createHash6 } from "node:crypto";
60700
- import { homedir as homedir10 } from "node:os";
60701
- var HOME_DIR4 = process.env.BLITZSTRIKE_HOME ?? join26(homedir10(), ".blitzstrike");
60702
- var OBLIGATION_PATH = join26(HOME_DIR4, "obligations.jsonl");
60856
+ import { homedir as homedir11 } from "node:os";
60857
+ var HOME_DIR5 = process.env.BLITZSTRIKE_HOME ?? join28(homedir11(), ".blitzstrike");
60858
+ var OBLIGATION_PATH = join28(HOME_DIR5, "obligations.jsonl");
60703
60859
  function ensureDir3() {
60704
- if (!existsSync13(HOME_DIR4))
60705
- mkdirSync8(HOME_DIR4, { recursive: true });
60860
+ if (!existsSync14(HOME_DIR5))
60861
+ mkdirSync9(HOME_DIR5, { recursive: true });
60706
60862
  }
60707
60863
  function shortId2(claim) {
60708
60864
  return `obl-${createHash6("sha256").update(`${claim}\x00${Date.now()}`).digest("hex").slice(0, 12)}`;
60709
60865
  }
60710
60866
  function loadObligations() {
60711
- if (!existsSync13(OBLIGATION_PATH))
60867
+ if (!existsSync14(OBLIGATION_PATH))
60712
60868
  return [];
60713
60869
  try {
60714
60870
  const out = [];
60715
- for (const line of readFileSync26(OBLIGATION_PATH, "utf8").split(`
60871
+ for (const line of readFileSync28(OBLIGATION_PATH, "utf8").split(`
60716
60872
  `)) {
60717
60873
  const t = line.trim();
60718
60874
  if (!t)
@@ -60733,7 +60889,7 @@ function append3(o) {
60733
60889
  }
60734
60890
  function rewrite(entries) {
60735
60891
  ensureDir3();
60736
- writeFileSync7(OBLIGATION_PATH, entries.map((e) => JSON.stringify(e)).join(`
60892
+ writeFileSync8(OBLIGATION_PATH, entries.map((e) => JSON.stringify(e)).join(`
60737
60893
  `) + (entries.length ? `
60738
60894
  ` : ""));
60739
60895
  }
@@ -60816,11 +60972,11 @@ init_framework_security();
60816
60972
  // src/variant-scan.ts
60817
60973
  init_scanner();
60818
60974
  init_complex_bugs();
60819
- import { readFileSync as readFileSync28 } from "node:fs";
60975
+ import { readFileSync as readFileSync30 } from "node:fs";
60820
60976
 
60821
60977
  // src/cross-file.ts
60822
60978
  init_scanner();
60823
- import { readFileSync as readFileSync27 } from "node:fs";
60979
+ import { readFileSync as readFileSync29 } from "node:fs";
60824
60980
  var PUBLIC_HOOK_RE = /(?:wp_ajax_nopriv_\w+|admin_post_nopriv_\w+|init|template_redirect|wp_loaded|parse_request|user_register|um_user_register|register_new_user|authenticate)/;
60825
60981
  var PRIV_SINK_RE = /\b(set_role|add_role|remove_role|set_user_role|wp_set_current_user|wp_set_auth_cookie|wp_insert_user|wp_create_user|wp_update_user)\s*\(/;
60826
60982
  var ROLE_META_RE = /update_user_meta\s*\(\s*[^,]+,\s*['"](wp_capabilities|role|roles|capabilities|wp_user_level)['"]/;
@@ -60872,7 +61028,7 @@ function detectCrossFilePrivesc(root) {
60872
61028
  for (const file of files) {
60873
61029
  let code;
60874
61030
  try {
60875
- code = stripComments(readFileSync27(file, "utf8"));
61031
+ code = stripComments(readFileSync29(file, "utf8"));
60876
61032
  } catch {
60877
61033
  continue;
60878
61034
  }
@@ -60913,7 +61069,7 @@ function detectCrossFilePrivesc(root) {
60913
61069
  for (const file of files) {
60914
61070
  let code;
60915
61071
  try {
60916
- code = stripComments(readFileSync27(file, "utf8"));
61072
+ code = stripComments(readFileSync29(file, "utf8"));
60917
61073
  } catch {
60918
61074
  continue;
60919
61075
  }
@@ -60936,7 +61092,7 @@ function detectCrossFilePrivesc(root) {
60936
61092
  for (const file of files) {
60937
61093
  let code;
60938
61094
  try {
60939
- code = stripComments(readFileSync27(file, "utf8"));
61095
+ code = stripComments(readFileSync29(file, "utf8"));
60940
61096
  } catch {
60941
61097
  continue;
60942
61098
  }
@@ -61051,7 +61207,7 @@ function variantScan(root, opts = {}) {
61051
61207
  for (const file of files) {
61052
61208
  let code;
61053
61209
  try {
61054
- code = readFileSync28(file, "utf8");
61210
+ code = readFileSync30(file, "utf8");
61055
61211
  } catch {
61056
61212
  continue;
61057
61213
  }
@@ -61715,7 +61871,7 @@ import { spawn as spawn3, execSync as execSync2 } from "node:child_process";
61715
61871
  import { createServer } from "node:http";
61716
61872
  import { randomUUID } from "node:crypto";
61717
61873
  import { networkInterfaces } from "node:os";
61718
- import { existsSync as existsSync14 } from "node:fs";
61874
+ import { existsSync as existsSync15 } from "node:fs";
61719
61875
  var sessions = new Map;
61720
61876
  function sleep(ms) {
61721
61877
  return new Promise((r) => setTimeout(r, ms));
@@ -61729,7 +61885,7 @@ function findInteractsh() {
61729
61885
  const home = process.env.HOME ?? "/root";
61730
61886
  const candidates = [`${home}/go/bin/interactsh-client`, "/usr/local/bin/interactsh-client", "/usr/bin/interactsh-client"];
61731
61887
  for (const c of candidates)
61732
- if (existsSync14(c))
61888
+ if (existsSync15(c))
61733
61889
  return c;
61734
61890
  return null;
61735
61891
  }
@@ -62734,9 +62890,9 @@ function listPocTypes() {
62734
62890
 
62735
62891
  // src/foundry-run.ts
62736
62892
  import { execSync as execSync3 } from "node:child_process";
62737
- import { mkdtempSync as mkdtempSync3, mkdirSync as mkdirSync9, writeFileSync as writeFileSync8, rmSync as rmSync4, existsSync as existsSync15 } from "node:fs";
62893
+ import { mkdtempSync as mkdtempSync3, mkdirSync as mkdirSync10, writeFileSync as writeFileSync9, rmSync as rmSync4, existsSync as existsSync16 } from "node:fs";
62738
62894
  import { tmpdir as tmpdir4 } from "node:os";
62739
- import { join as join27 } from "node:path";
62895
+ import { join as join29 } from "node:path";
62740
62896
  function findForge() {
62741
62897
  try {
62742
62898
  const p = execSync3("which forge 2>/dev/null", { encoding: "utf8", timeout: 3000 }).trim();
@@ -62746,7 +62902,7 @@ function findForge() {
62746
62902
  const home = process.env.HOME ?? "/root";
62747
62903
  const candidates = [`${home}/.foundry/bin/forge`, "/usr/local/bin/forge", "/usr/bin/forge"];
62748
62904
  for (const c of candidates)
62749
- if (existsSync15(c))
62905
+ if (existsSync16(c))
62750
62906
  return c;
62751
62907
  return null;
62752
62908
  }
@@ -62785,14 +62941,14 @@ async function foundryRun(input) {
62785
62941
  };
62786
62942
  }
62787
62943
  const poc = input.poc_code ?? foundryPoc(input.class_ ?? "missing_access_control", name);
62788
- const dir = mkdtempSync3(join27(tmpdir4(), "blitzstrike-foundry-"));
62944
+ const dir = mkdtempSync3(join29(tmpdir4(), "blitzstrike-foundry-"));
62789
62945
  try {
62790
62946
  try {
62791
62947
  execSync3(`${forge} init --force --no-git ${dir}`, { stdio: "ignore", timeout: 60000 });
62792
62948
  } catch {
62793
- mkdirSync9(join27(dir, "src"), { recursive: true });
62794
- mkdirSync9(join27(dir, "test"), { recursive: true });
62795
- writeFileSync8(join27(dir, "foundry.toml"), `[profile.default]
62949
+ mkdirSync10(join29(dir, "src"), { recursive: true });
62950
+ mkdirSync10(join29(dir, "test"), { recursive: true });
62951
+ writeFileSync9(join29(dir, "foundry.toml"), `[profile.default]
62796
62952
  src = "src"
62797
62953
  out = "out"
62798
62954
  libs = ["lib"]
@@ -62802,12 +62958,12 @@ solc = "0.8.20"
62802
62958
  for (const f of ["Counter.sol", "Counter.t.sol", "Counter.s.sol"]) {
62803
62959
  for (const sub of ["src", "test", "script"]) {
62804
62960
  try {
62805
- rmSync4(join27(dir, sub, f), { force: true });
62961
+ rmSync4(join29(dir, sub, f), { force: true });
62806
62962
  } catch {}
62807
62963
  }
62808
62964
  }
62809
- writeFileSync8(join27(dir, "src", `${name}.sol`), input.contract_code);
62810
- writeFileSync8(join27(dir, "test", `${name}.t.sol`), poc);
62965
+ writeFileSync9(join29(dir, "src", `${name}.sol`), input.contract_code);
62966
+ writeFileSync9(join29(dir, "test", `${name}.t.sol`), poc);
62811
62967
  const { out } = runForge(forge, dir, input.timeout_ms ?? 60000);
62812
62968
  const tests = parseTestResults(out);
62813
62969
  const anyFail = tests.some((t) => t.status === "fail");
@@ -62825,18 +62981,18 @@ solc = "0.8.20"
62825
62981
  }
62826
62982
 
62827
62983
  // src/enterprise-benchmark.ts
62828
- import { existsSync as existsSync16, readFileSync as readFileSync29, readdirSync as readdirSync8, statSync as statSync5 } from "node:fs";
62829
- import { join as join28, resolve } from "node:path";
62830
- import { fileURLToPath as fileURLToPath16 } from "node:url";
62984
+ import { existsSync as existsSync17, readFileSync as readFileSync31, readdirSync as readdirSync8, statSync as statSync5 } from "node:fs";
62985
+ import { join as join30, resolve } from "node:path";
62986
+ import { fileURLToPath as fileURLToPath17 } from "node:url";
62831
62987
  init_complex_bugs();
62832
- var ROOT9 = resolve(fileURLToPath16(new URL(".", import.meta.url)), "..", "bench", "enterprise");
62988
+ var ROOT10 = resolve(fileURLToPath17(new URL(".", import.meta.url)), "..", "bench", "enterprise");
62833
62989
  var ENTERPRISE_FIXTURES = [
62834
- { id: "php-laravel", dir: join28(ROOT9, "php-laravel"), expected_vulns: 4 },
62835
- { id: "js-express", dir: join28(ROOT9, "js-express"), expected_vulns: 2 },
62836
- { id: "py-django", dir: join28(ROOT9, "py-django"), expected_vulns: 2 },
62837
- { id: "java-spring", dir: join28(ROOT9, "java-spring"), expected_vulns: 2 },
62838
- { id: "wp-batch-route", dir: join28(ROOT9, "wp-batch-route"), expected_vulns: 3 },
62839
- { id: "php-complex", dir: join28(ROOT9, "php-complex"), expected_vulns: 4 }
62990
+ { id: "php-laravel", dir: join30(ROOT10, "php-laravel"), expected_vulns: 4 },
62991
+ { id: "js-express", dir: join30(ROOT10, "js-express"), expected_vulns: 2 },
62992
+ { id: "py-django", dir: join30(ROOT10, "py-django"), expected_vulns: 2 },
62993
+ { id: "java-spring", dir: join30(ROOT10, "java-spring"), expected_vulns: 2 },
62994
+ { id: "wp-batch-route", dir: join30(ROOT10, "wp-batch-route"), expected_vulns: 3 },
62995
+ { id: "php-complex", dir: join30(ROOT10, "php-complex"), expected_vulns: 4 }
62840
62996
  ];
62841
62997
  function sourceFiles(root) {
62842
62998
  const out = [];
@@ -62848,7 +63004,7 @@ function sourceFiles(root) {
62848
63004
  return;
62849
63005
  }
62850
63006
  for (const e of entries) {
62851
- const p = join28(dir, e);
63007
+ const p = join30(dir, e);
62852
63008
  let st;
62853
63009
  try {
62854
63010
  st = statSync5(p);
@@ -62869,7 +63025,7 @@ function detectFixture(dir) {
62869
63025
  for (const f of sourceFiles(dir)) {
62870
63026
  let code;
62871
63027
  try {
62872
- code = readFileSync29(f, "utf8");
63028
+ code = readFileSync31(f, "utf8");
62873
63029
  } catch {
62874
63030
  continue;
62875
63031
  }
@@ -62887,7 +63043,7 @@ function detectFixture(dir) {
62887
63043
  function runEnterpriseBenchmark() {
62888
63044
  const fixtures = [];
62889
63045
  for (const fx of ENTERPRISE_FIXTURES) {
62890
- if (!existsSync16(fx.dir)) {
63046
+ if (!existsSync17(fx.dir)) {
62891
63047
  fixtures.push({ id: fx.id, available: false, detected: 0, expected: fx.expected_vulns, recall: 0 });
62892
63048
  continue;
62893
63049
  }
@@ -63082,7 +63238,7 @@ function createServer2() {
63082
63238
  ` + `- A hard block (Cloudflare/WAF/IP-block/captcha) is NOT the end: mark the finding blocked + note the required vantage (residential / authorized / correct-SNI / --resolve direct-to-origin), then CONTINUE to the next lead (origin bypass, non-prod cluster, mobile APK, subdomain).
63083
63239
  ` + `- Keep trying every lead AND every chain step until each is verified/executed or blocked, THEN generate_report. Never deliver a bare surface map, and never stop at 'found X' when X enables more.
63084
63240
 
63085
- ` + "TWO PATHS:\\n" + "- Source path on disk -> blitz_scan / taint_file / eagle_eye2 (static).\\n" + "- Live URL -> live_recon / active_scan / strike_verify (web-hunting).\\n\\n" + "DEEPEN A FINDING: attack_plan(target, tech, params) to get the prioritized vector plan (decide what to test next with data); list_chains (escalation), chain_links (compose), technique_lookup(cls), payload_lookup, bypass_lookup (blocked). Ground any detector hit empirically with pattern_lookup(id) — it returns the class's CWE, real-world signature, escalation chains, citable references, per-class bypass techniques, and the high-value assets (crown jewels) that class hits, so a raw hit becomes a class-aware finding. Resolve free-form terminology first with synonym_lookup(term) (IDOR/BOLA/SQLi/prompt-injection → canonical id). For an llm_injection hit, its pattern carries a validation discipline — the RUN-TWICE RULE (reproduce token-for-token across two fresh sessions), NON-GUESSABLE ANCHOR (must leak a real key/URL, not a plausible guess), and OOB PROOF (a verifiable callback log) — apply all three before reporting. BEFORE generating a report, run submission_gate(...) and only ship a finding that passes all 7 questions (reproducible, in-scope, real-impact, no-privileged-assumption, verified-live, evidence-redacted, severity-derived); one false = kill it. Generate the concrete reproduction recipe with auto_poc(type, base_url, endpoint, param) — it emits the exact marker request + negative control + expected differential + Patchstack-style title, so 'reproducible' is executable, not abstract. Calibrate severity with severity_calibrate(type, cvss) to get a P1–P5 tier + VRT-style category. Start each engagement with engagement_scaffold(target, scope) for the folder + scope.md structure, and check data_refresh() to confirm the data layers are consistent. Phase doctrine: read_skill(bs-orchestrate-engagement | bs-web-hunting | bs-source-audit | bs-verify-finding). Campaign plan: read_playbook(target-type). On any failure call retry_guidance(signal) / model_fallback(signal) before giving up. HUNTING DOCTRINE (maximize payout rate): (1) SIBLING RULE — if one endpoint requires auth, check every sibling (/export /delete /share); ~30% of paid IDOR/auth bugs come from siblings — AUTOMATE it with sibling_scan(base_url, endpoint, token_a, token_b), the deterministic live logic-bug prober (sibling enumeration + differential IDOR + auth matrix + mass assignment + rate limit, evidence-first). (2) A→B SIGNAL — a confirmed bug signals a class of developer mistake; hunt B and C (20-min box) before reporting. (3) TWO-ACCOUNT IDOR — always test with attacker account A reading victim account B, and state it in the report. (4) PoC ESCALATION — IDOR shows victim data (not 200), XSS shows cookie exfil (not alert), SSRF shows internal response (not DNS), SQLi shows DB content (not error). (5) FOLLOW THE MONEY — billing/credits/refunds/wallet flows. (6) Kill weak findings with kill_list(type) BEFORE the gate — missing headers, self-XSS, open-redirect-alone, SSRF-DNS-only, GraphQL-introspection-alone are always N/A standalone. (7) CI/CD + SAML/SSO are critical attack surfaces (pull_request_target, expression injection, XML signature wrapping, comment injection). Full doctrine: hunting_doctrine(). WHAT TO HUNT NEXT: watchlist() returns the ranked CWE frequency + high-value CVEs with payout + a saturated flag (prioritize high-freq/high-payout/not-saturated: missing-authz, SQLi, SSRF, deserialization; skip saturated XSS/CSRF/open-redirect unless they chain into takeover). The CVE watchlist now spans 4,000+ product fingerprints (live from nuclei-templates when installed — refresh with sync_cve_corpus() before a big recon pass); live_recon's suggested_cves names the SPECIFIC CVE for the detected product/version — then cve_verify(cve, target) CONFIRMS it live by running the matching nuclei template (VERIFIED only when nuclei actually matches; a CVE is report-ready only after cve_verify, never from the fingerprint alone). For 'scan this target' automation, nuclei_scan(target) fingerprints the stack and runs the WHOLE matched template set (CVE templates + optional broad tech-tag) in one rate-limited pass — use it instead of verifying CVEs one-by-one. SURFACE-FIRST: surface_map(surface) maps an attack surface (image/redirect proxy, edge cache, payment portal, AI agent, file service, Electron, SSO) to its highest-value tests — map surfaces then test, don't spray payloads. PRECISION GUARD: resolve_check(host) detects when an ISP/country redirects the domain to a blocking/sinkhole page (gambling/adult/streaming niches) — audit the PUBLIC IP, never the sinkhole.\n" + "KNOWLEDGE BASE (discover, don't guess): skillLookup(topic) / listSkills for the 40 attack-path + hunting skills (ap-*, hp-*, bs-*); list_attack_vectors / attack_vectors(cat) for the 34-category vector taxonomy; taxonomy(kind) for OWASP/CWE/ASVS/API-top-10; read_playbook(type) for the 17 campaign playbooks; list_manuals / read_tool_manual for 317 tool references; list_tools / run_catalog_tool for the 141-tool catalog. Every tool, skill, and data layer is reachable from these. CROSS-TARGET INTELLIGENCE: strike_resolve auto-records confirmed/false_positive verdicts into the empirical ledger; query it with intelligence(action=hit_rates/top_vectors/recall) so a new target on a known tech inherits historical hit-rates (attack_plan already blends them into success_probability). intelligence(action=recall, tech, target) is the per-engagement pattern recall — it returns which patterns historically CONFIRMED on that tech (prioritize them) versus which only ever produced false positives (avoid them), so a new engagement starts from the empirical playbook of past ones. LIVE PENTEST + TARGETING (black-box, WAF-safe): cache_gap(base_url, endpoint) fuzzes path-normalization + static-extension variants for cache deception/poisoning; blind_oracle(base_url, param, value) detects which SINK a param reaches (sql/ssti/xss) via benign arithmetic (id=1+0, test${7*7}) WITHOUT a malicious payload; param_precedence(base_url, param, A, B) maps duplicate-parameter precedence (first/last-wins) for WAF-bypass; broken_link_scan(url) detects expired-domain takeover (crawls outbound refs → DNS/RDAP → flags claimable domains). Logic-bug live probers: jwt_forge(token, endpoint, …) forges JWT confusion tokens (alg:none / RS256→HS256 key-confusion / kid-jku-x5u) and proves which is ACCEPTED live; proto_pollution_probe(target, endpoint) sends __proto__ / constructor.prototype JSON canaries and reports VERIFIED only on reflection; smuggling_test(target) sends CL.TE / TE.CL desync probes over a raw connection. OOB (out-of-band) PROOF for BLIND vulns: oob_start() spins an interactsh listener (unique *.oast.* domain, streams DNS/HTTP interactions — the standard for public targets) or a local HTTP listener for local labs; inject the canary, then oob_poll(id) until the hit arrives; oob_stop(id) to clean up. A blind SSRF/XXE/SQLi/command-injection is CONFIRMED only when the canary actually arrives — never from a guess. SOURCE TARGETING: review_harness(path) FIRST for full coverage — it applies a fixed 5-signal rubric (entry_points/auth_gates/sinks/secrets/logic_bugs) to EVERY source file and sorts the signal-dense ones first (a complete map, not a partial scan); then action_surface(code) maps every wp_ajax_* action to its vuln class + DERIVED priority (what to look for WHERE); security_state(sanitizers, sink) gives a wrong-context sanitization verdict; framework_knowledge(framework) returns auth/nonce primitives for 9 frameworks; variant_scan(root, signature) mass-sweeps an install base for ONE bug family; patch_analyze(old, new) REVERSES a security patch into the 0-day, and its mine_signature feeds variant_scan to sweep unpatched copies. All of these are DETECTION HINTS — verify each live (strike_verify / browser_validate) before it enters the report. NEWEST DETECTORS — understand AND try them: variant_scan also emits priv_esc (privilege escalation — a role/capability/user change fed by request input, traced cross-file via reverse call-graph, e.g. set_role($id, sanitize_key($_POST['um-role'])) or update_user_meta(...,'wp_capabilities', $_POST[...])) and flags uploadAllow=>array('all') unrestricted-upload configs as file_upload (the file-manager/connector shape). TO TRY a priv_esc hit: submit the role field with 'administrator' (or send wp_capabilities meta) and confirm the account actually gains admin. TO TRY an unrestricted-upload hit: POST a .php/.phtml and confirm it lands web-reachable + executes. variant_scan also emits hardcoded_secret (CWE-798) in three tiers: a secret field (api_key/db_password/access_token/aws_*) assigned a literal (HIGH), a known secret FORMAT (JWT eyJ…/AWS AKIA…/GitHub ghp_…/Slack xoxb-…/…) regardless of name (HIGH), or a high-entropy suspect token (MEDIUM — verify before reporting). Verify a frontend/JS secret live via drive_devtools (inspect the JS bundle / network response and confirm the key is actually exposed), and for a backend secret confirm it is reachable/valid. A static hit is a HYPOTHESIS until verified live — never report unverified. For a repo, also scan_git_history(root) — secrets DELETED from HEAD still live in .git history (the removed-later-is-not-fixed trap), and it feeds every recovered pre-deletion blob through the same secret detector. Once you recover a credential, prove it is still ACTIVE with validate_leaked_key(apiBase, endpoints, key|blobUrl) — a READ-ONLY differential test (401-without-key vs 200-with-key = auth bypass PROVEN). Two supply-chain detectors: dependency_confusion (a manifest/build file resolving a package from a public registry — pypi.org/npmjs.org --extra-index-url, or a scoped @company/pkg with no private registry) and ml_supply_chain (torch.load without weights_only=True / joblib.load / np.load(allow_pickle=True) / keras load_model on an untrusted model → pickle RCE). Rust is supported end-to-end: the taint engine (blitz_scan / taint_file) maps Rust sinks (std::process::Command, sqlx/diesel, reqwest/hyper, std::fs, serde/bincode) to the classic classes, plus two Rust-specific detectors — rust_unsafe (transmute / assume_init / from_raw_parts / ptr::* — memory-unsafety surface, CWE-119) and rust_format_string (println!/format! with a variable as the format string — CWE-134). The sqlx query! compile-time macro is treated as safe (suppressed). Two more web-class detectors: jwt_alg_confusion (a JWT verifier that dispatches on the token's alg header and accepts BOTH RS256 and HS256, with the HS256 HMAC secret derived from public/shared key material — CWE-347; the attacker sets alg=HS256 and signs with the public key to forge admin tokens) and cache_deception (a reverse proxy caching static-extension URLs with a cache key that omits the session cookie, over a session-authenticated backend — CWE-525; the victim's cached private response is re-fetched anonymously). TO TRY a jwt_alg_confusion hit: fetch the public key (/.well-known/jwks.json), forge an HS256 token signed with that public key, and confirm admin access. TO TRY a cache_deception hit: request an authenticated path with a static extension appended (.css/.js) and re-fetch it anonymously. Three more detectors: cors_misconfiguration (Access-Control-Allow-Origin reflects the request Origin or is '*' while credentials are true — CWE-942; any site reads the victim's authenticated responses), xss (user input into a DOM sink — innerHTML / dangerouslySetInnerHTML / document.write / .html() / eval — CWE-79), and subdomain_takeover (a dangling CNAME/AliasTarget to a claimable service like *.github.io/*.herokuapp.com/*.amazonaws.com — CWE-404). TO TRY a cors hit: send an evil Origin + confirm the response echoes it with Allow-Credentials:true. TO TRY an xss hit: confirm the sink executes (drive_devtools). TO TRY a takeover hit: verify the CNAME target resolves to an unclaimed/not-found page. Two more client-side detectors: postmessage_no_origin_check (a window message listener that reads event.data but never validates event.origin — CWE-345; any site can drive the handler) and client_trusted_flag (a privilege/entitlement flag like isAdmin/withVip/premium read from request input and used in a security decision — CWE-807/639; derive the flag from server state, never the client). TO TRY a postMessage hit: send a crafted message from an attacker origin and confirm the handler acts on it. TO TRY a client-trusted-flag hit: flip the flag param to true and confirm the privilege is actually granted. WEB3: for Solidity/EVM, call web3_audit(code|path) — a deterministic 13-class smart-contract audit (reentrancy incl. ERC721/ERC1155 callback reentrancy, unchecked return, unchecked arithmetic, tx.origin auth, signature replay, unprotected selfdestruct, delegatecall-to-user-input, missing access control, timestamp dependence, spot-price oracle manipulation incl. slot0/latestRoundData, unbounded loop, abi.encodePacked hash collision, missing address(0) validation) returning ranked findings (class/CWE/severity/line), then foundry_poc(class, contract) to generate an executable Foundry test, and foundry_run(contract_code, poc_code|class_) to actually EXECUTE it — a PASSING PoC test is the proof that the exploit reproduces (deterministic: forge's own test verdict). A web3 hit is a HYPOTHESIS until the Foundry PoC reproduces it.\n" + `PRECISION ANALYSIS — chrome-devtools MCP is MANDATORY, not optional:
63241
+ ` + "TWO PATHS:\\n" + "- Source path on disk -> blitz_scan / taint_file / eagle_eye2 (static).\\n" + "- Live URL -> live_recon / active_scan / strike_verify (web-hunting).\\n\\n" + "DEEPEN A FINDING: attack_plan(target, tech, params) to get the prioritized vector plan (decide what to test next with data); list_chains (escalation), chain_links (compose), technique_lookup(cls), payload_lookup, bypass_lookup (blocked). Ground any detector hit empirically with pattern_lookup(id) — it returns the class's CWE, real-world signature, escalation chains, citable references, per-class bypass techniques, and the high-value assets (crown jewels) that class hits, so a raw hit becomes a class-aware finding. Resolve free-form terminology first with synonym_lookup(term) (IDOR/BOLA/SQLi/prompt-injection → canonical id). For an llm_injection hit, its pattern carries a validation discipline — the RUN-TWICE RULE (reproduce token-for-token across two fresh sessions), NON-GUESSABLE ANCHOR (must leak a real key/URL, not a plausible guess), and OOB PROOF (a verifiable callback log) — apply all three before reporting. BEFORE generating a report, run submission_gate(...) and only ship a finding that passes all 7 questions (reproducible, in-scope, real-impact, no-privileged-assumption, verified-live, evidence-redacted, severity-derived); one false = kill it. Generate the concrete reproduction recipe with auto_poc(type, base_url, endpoint, param) — it emits the exact marker request + negative control + expected differential + Patchstack-style title, so 'reproducible' is executable, not abstract. Calibrate severity with severity_calibrate(type, cvss) to get a P1–P5 tier + VRT-style category. Start each engagement with engagement_scaffold(target, scope) for the folder + scope.md structure, and check data_refresh() to confirm the data layers are consistent. Phase doctrine: read_skill(bs-orchestrate-engagement | bs-web-hunting | bs-source-audit | bs-verify-finding). Campaign plan: read_playbook(target-type). On any failure call retry_guidance(signal) / model_fallback(signal) before giving up. HUNTING DOCTRINE (maximize payout rate): (1) SIBLING RULE — if one endpoint requires auth, check every sibling (/export /delete /share); ~30% of paid IDOR/auth bugs come from siblings — AUTOMATE it with sibling_scan(base_url, endpoint, token_a, token_b), the deterministic live logic-bug prober (sibling enumeration + differential IDOR + auth matrix + mass assignment + rate limit, evidence-first). (2) A→B SIGNAL — a confirmed bug signals a class of developer mistake; hunt B and C (20-min box) before reporting. (3) TWO-ACCOUNT IDOR — always test with attacker account A reading victim account B, and state it in the report. (4) PoC ESCALATION — IDOR shows victim data (not 200), XSS shows cookie exfil (not alert), SSRF shows internal response (not DNS), SQLi shows DB content (not error). (5) FOLLOW THE MONEY — billing/credits/refunds/wallet flows. (6) Kill weak findings with kill_list(type) BEFORE the gate — missing headers, self-XSS, open-redirect-alone, SSRF-DNS-only, GraphQL-introspection-alone are always N/A standalone. (7) CI/CD + SAML/SSO are critical attack surfaces (pull_request_target, expression injection, XML signature wrapping, comment injection). Full doctrine: hunting_doctrine(). WHAT TO HUNT NEXT: watchlist() returns the ranked CWE frequency + high-value CVEs with payout + a saturated flag (prioritize high-freq/high-payout/not-saturated: missing-authz, SQLi, SSRF, deserialization; skip saturated XSS/CSRF/open-redirect unless they chain into takeover). The CVE watchlist now spans 4,000+ product fingerprints (live from nuclei-templates when installed — refresh with sync_cve_corpus() before a big recon pass); live_recon's suggested_cves names the SPECIFIC CVE for the detected product/version — then cve_verify(cve, target) CONFIRMS it live by running the matching nuclei template (VERIFIED only when nuclei actually matches; a CVE is report-ready only after cve_verify, never from the fingerprint alone). For 'scan this target' automation, nuclei_scan(target) fingerprints the stack and runs the WHOLE matched template set (CVE templates + optional broad tech-tag) in one rate-limited pass — use it instead of verifying CVEs one-by-one. SURFACE-FIRST: surface_map(surface) maps an attack surface (image/redirect proxy, edge cache, payment portal, AI agent, file service, Electron, SSO) to its highest-value tests — map surfaces then test, don't spray payloads; then param_surface(target, class) discovers EVERY testable parameter (URL query, form fields, /users/123 path ids + UUIDs, JS refs) + per-class specialist hints — test the DISCOVERED params, not just the hinted one. PRECISION GUARD: resolve_check(host) detects when an ISP/country redirects the domain to a blocking/sinkhole page (gambling/adult/streaming niches) — audit the PUBLIC IP, never the sinkhole. CIRCUIT BREAKER: target_health(target) probes the target and tracks consecutive failures — if the circuit OPENS (5 consecutive timeouts/5xx) PAUSE the target and resume when it recovers (auto-closes on a successful probe); circuit_status() lists every tracked target's state.\n" + "KNOWLEDGE BASE (discover, don't guess): skillLookup(topic) / listSkills for the 40 attack-path + hunting skills (ap-*, hp-*, bs-*); list_attack_vectors / attack_vectors(cat) for the 34-category vector taxonomy; taxonomy(kind) for OWASP/CWE/ASVS/API-top-10; read_playbook(type) for the 17 campaign playbooks; list_manuals / read_tool_manual for 317 tool references; list_tools / run_catalog_tool for the 141-tool catalog. Every tool, skill, and data layer is reachable from these. CROSS-TARGET INTELLIGENCE: strike_resolve auto-records confirmed/false_positive verdicts into the empirical ledger; query it with intelligence(action=hit_rates/top_vectors/recall) so a new target on a known tech inherits historical hit-rates (attack_plan already blends them into success_probability). intelligence(action=recall, tech, target) is the per-engagement pattern recall — it returns which patterns historically CONFIRMED on that tech (prioritize them) versus which only ever produced false positives (avoid them), so a new engagement starts from the empirical playbook of past ones. LIVE PENTEST + TARGETING (black-box, WAF-safe): cache_gap(base_url, endpoint) fuzzes path-normalization + static-extension variants for cache deception/poisoning; blind_oracle(base_url, param, value) detects which SINK a param reaches (sql/ssti/xss) via benign arithmetic (id=1+0, test${7*7}) WITHOUT a malicious payload; param_precedence(base_url, param, A, B) maps duplicate-parameter precedence (first/last-wins) for WAF-bypass; broken_link_scan(url) detects expired-domain takeover (crawls outbound refs → DNS/RDAP → flags claimable domains). Logic-bug live probers: jwt_forge(token, endpoint, …) forges JWT confusion tokens (alg:none / RS256→HS256 key-confusion / kid-jku-x5u) and proves which is ACCEPTED live; proto_pollution_probe(target, endpoint) sends __proto__ / constructor.prototype JSON canaries and reports VERIFIED only on reflection; smuggling_test(target) sends CL.TE / TE.CL desync probes over a raw connection. OOB (out-of-band) PROOF for BLIND vulns: oob_start() spins an interactsh listener (unique *.oast.* domain, streams DNS/HTTP interactions — the standard for public targets) or a local HTTP listener for local labs; inject the canary, then oob_poll(id) until the hit arrives; oob_stop(id) to clean up. A blind SSRF/XXE/SQLi/command-injection is CONFIRMED only when the canary actually arrives — never from a guess. SOURCE TARGETING: review_harness(path) FIRST for full coverage — it applies a fixed 5-signal rubric (entry_points/auth_gates/sinks/secrets/logic_bugs) to EVERY source file and sorts the signal-dense ones first (a complete map, not a partial scan); then action_surface(code) maps every wp_ajax_* action to its vuln class + DERIVED priority (what to look for WHERE); security_state(sanitizers, sink) gives a wrong-context sanitization verdict; framework_knowledge(framework) returns auth/nonce primitives for 9 frameworks; variant_scan(root, signature) mass-sweeps an install base for ONE bug family; patch_analyze(old, new) REVERSES a security patch into the 0-day, and its mine_signature feeds variant_scan to sweep unpatched copies. All of these are DETECTION HINTS — verify each live (strike_verify / browser_validate) before it enters the report. NEWEST DETECTORS — understand AND try them: variant_scan also emits priv_esc (privilege escalation — a role/capability/user change fed by request input, traced cross-file via reverse call-graph, e.g. set_role($id, sanitize_key($_POST['um-role'])) or update_user_meta(...,'wp_capabilities', $_POST[...])) and flags uploadAllow=>array('all') unrestricted-upload configs as file_upload (the file-manager/connector shape). TO TRY a priv_esc hit: submit the role field with 'administrator' (or send wp_capabilities meta) and confirm the account actually gains admin. TO TRY an unrestricted-upload hit: POST a .php/.phtml and confirm it lands web-reachable + executes. variant_scan also emits hardcoded_secret (CWE-798) in three tiers: a secret field (api_key/db_password/access_token/aws_*) assigned a literal (HIGH), a known secret FORMAT (JWT eyJ…/AWS AKIA…/GitHub ghp_…/Slack xoxb-…/…) regardless of name (HIGH), or a high-entropy suspect token (MEDIUM — verify before reporting). Verify a frontend/JS secret live via drive_devtools (inspect the JS bundle / network response and confirm the key is actually exposed), and for a backend secret confirm it is reachable/valid. A static hit is a HYPOTHESIS until verified live — never report unverified. For a repo, also scan_git_history(root) — secrets DELETED from HEAD still live in .git history (the removed-later-is-not-fixed trap), and it feeds every recovered pre-deletion blob through the same secret detector. Once you recover a credential, prove it is still ACTIVE with validate_leaked_key(apiBase, endpoints, key|blobUrl) — a READ-ONLY differential test (401-without-key vs 200-with-key = auth bypass PROVEN). Two supply-chain detectors: dependency_confusion (a manifest/build file resolving a package from a public registry — pypi.org/npmjs.org --extra-index-url, or a scoped @company/pkg with no private registry) and ml_supply_chain (torch.load without weights_only=True / joblib.load / np.load(allow_pickle=True) / keras load_model on an untrusted model → pickle RCE). Rust is supported end-to-end: the taint engine (blitz_scan / taint_file) maps Rust sinks (std::process::Command, sqlx/diesel, reqwest/hyper, std::fs, serde/bincode) to the classic classes, plus two Rust-specific detectors — rust_unsafe (transmute / assume_init / from_raw_parts / ptr::* — memory-unsafety surface, CWE-119) and rust_format_string (println!/format! with a variable as the format string — CWE-134). The sqlx query! compile-time macro is treated as safe (suppressed). Two more web-class detectors: jwt_alg_confusion (a JWT verifier that dispatches on the token's alg header and accepts BOTH RS256 and HS256, with the HS256 HMAC secret derived from public/shared key material — CWE-347; the attacker sets alg=HS256 and signs with the public key to forge admin tokens) and cache_deception (a reverse proxy caching static-extension URLs with a cache key that omits the session cookie, over a session-authenticated backend — CWE-525; the victim's cached private response is re-fetched anonymously). TO TRY a jwt_alg_confusion hit: fetch the public key (/.well-known/jwks.json), forge an HS256 token signed with that public key, and confirm admin access. TO TRY a cache_deception hit: request an authenticated path with a static extension appended (.css/.js) and re-fetch it anonymously. Three more detectors: cors_misconfiguration (Access-Control-Allow-Origin reflects the request Origin or is '*' while credentials are true — CWE-942; any site reads the victim's authenticated responses), xss (user input into a DOM sink — innerHTML / dangerouslySetInnerHTML / document.write / .html() / eval — CWE-79), and subdomain_takeover (a dangling CNAME/AliasTarget to a claimable service like *.github.io/*.herokuapp.com/*.amazonaws.com — CWE-404). TO TRY a cors hit: send an evil Origin + confirm the response echoes it with Allow-Credentials:true. TO TRY an xss hit: confirm the sink executes (drive_devtools). TO TRY a takeover hit: verify the CNAME target resolves to an unclaimed/not-found page. Two more client-side detectors: postmessage_no_origin_check (a window message listener that reads event.data but never validates event.origin — CWE-345; any site can drive the handler) and client_trusted_flag (a privilege/entitlement flag like isAdmin/withVip/premium read from request input and used in a security decision — CWE-807/639; derive the flag from server state, never the client). TO TRY a postMessage hit: send a crafted message from an attacker origin and confirm the handler acts on it. TO TRY a client-trusted-flag hit: flip the flag param to true and confirm the privilege is actually granted. WEB3: for Solidity/EVM, call web3_audit(code|path) — a deterministic 13-class smart-contract audit (reentrancy incl. ERC721/ERC1155 callback reentrancy, unchecked return, unchecked arithmetic, tx.origin auth, signature replay, unprotected selfdestruct, delegatecall-to-user-input, missing access control, timestamp dependence, spot-price oracle manipulation incl. slot0/latestRoundData, unbounded loop, abi.encodePacked hash collision, missing address(0) validation) returning ranked findings (class/CWE/severity/line), then foundry_poc(class, contract) to generate an executable Foundry test, and foundry_run(contract_code, poc_code|class_) to actually EXECUTE it — a PASSING PoC test is the proof that the exploit reproduces (deterministic: forge's own test verdict). A web3 hit is a HYPOTHESIS until the Foundry PoC reproduces it.\n" + `PRECISION ANALYSIS — chrome-devtools MCP is MANDATORY, not optional:
63086
63242
  ` + `- When a lead needs DOM/JS precision — DOM-XSS sink execution, AJAX endpoint + payload interception, JS runtime errors, redirect chains, SSO/token flow, or anything a static HTML glance cannot prove — call drive_devtools(target). It spawns chrome-devtools-mcp and drives a REAL headless browser (navigate -> list_network_requests -> list_console_messages -> evaluate_script), giving reproducible evidence instead of a guess.
63087
63243
  ` + `- Before calling it, check_mcp() to confirm the browser MCP is available; if not, blitzstrike install-tools or npm i -g chrome-devtools-mcp. Never substitute eyeballing minified JS or a static sink guess when a live browser can PROVE it. This is the precision + consistency layer.
63088
63244
  ` + "EXTERNAL MCP SERVERS (verified, connect them — NOT one-shot CLIs): chrome-devtools-mcp (29 tools: list_network_requests/get_network_request for raw HTTP interception, list_console_messages for JS errors + DOM-XSS, evaluate_script to run JS, take_screenshot) -> stdio chrome-devtools-mcp --headless --chromeArg=--no-sandbox --chromeArg=--disable-gpu (as root/container this is MANDATORY or the browser crashes; add --proxyServer http://127.0.0.1:8080 to route through Burp, --acceptInsecureCerts for bad TLS). burp-suite-mcp (proxy history + active scan + repeater) -> NOT npm: build the JAR (git clone https://github.com/PortSwigger/mcp-server.git && cd mcp-server && ./gradlew embedProxyJar), load it in Burp Extensions, then connect the client to http://127.0.0.1:9876 (SSE) or the stdio proxy java -jar mcp-proxy-all.jar --sse-url http://127.0.0.1:9876."
@@ -63973,7 +64129,7 @@ ${statusLine}` : statusLine },
63973
64129
  let src = code;
63974
64130
  if (!src && path) {
63975
64131
  try {
63976
- src = readFileSync31(path, "utf8");
64132
+ src = readFileSync33(path, "utf8");
63977
64133
  } catch {
63978
64134
  return { content: [{ type: "text", text: JSON.stringify({ error: "unreadable path" }) }] };
63979
64135
  }
@@ -64054,7 +64210,7 @@ ${statusLine}` : statusLine },
64054
64210
  let src = code;
64055
64211
  if (!src && path) {
64056
64212
  try {
64057
- src = readFileSync31(path, "utf8");
64213
+ src = readFileSync33(path, "utf8");
64058
64214
  } catch {
64059
64215
  return { content: [{ type: "text", text: JSON.stringify({ error: "unreadable path" }) }] };
64060
64216
  }
@@ -64189,6 +64345,33 @@ ${statusLine}` : statusLine },
64189
64345
  }
64190
64346
  return { content: [{ type: "text", text: JSON.stringify(r) }] };
64191
64347
  });
64348
+ server.registerTool("param_surface", {
64349
+ title: "Autonomous parameter discovery — extract every testable parameter",
64350
+ description: "Fetch a target and extract EVERY testable parameter (URL query params, HTML form fields, path-segment identifiers /users/123 + UUIDs, JS-referenced endpoints) — then attach per-class discovery + test hints. Pass a class (xss/sqli/ssrf/idor/lfi/rce/xxe/jwt/open_redirect/prototype_pollution/csti/mass_assignment/header_injection/api_security/file_upload) to filter the specialist hints, or no class to get all 15. Test the discovered params (not just the hinted one) — e.g. an XSS hint about ?category= may hide a vulnerable searchTerm form field.",
64351
+ inputSchema: {
64352
+ target: string2().describe("Target URL, e.g. https://target.com"),
64353
+ class_: string2().optional().describe("Vuln class to filter specialist hints (default: all)")
64354
+ }
64355
+ }, async ({ target, class_ }) => {
64356
+ return { content: [{ type: "text", text: JSON.stringify(await paramSurface(target, class_)) }] };
64357
+ });
64358
+ server.registerTool("target_health", {
64359
+ title: "Circuit breaker — probe target health and auto-pause when unresponsive",
64360
+ description: "Probe a target (GET with a 10s timeout) and track consecutive failures in a persisted circuit-breaker state. After 5 consecutive timeouts/5xx the circuit OPENS (PAUSE); it auto-closes on the next successful probe. Check this before a big scan and after repeated failures — do NOT keep hammering an unresponsive target.",
64361
+ inputSchema: {
64362
+ target: string2().describe("Target URL, e.g. https://target.com"),
64363
+ limit: number2().optional().describe("Consecutive-failure threshold (default 5)")
64364
+ }
64365
+ }, async ({ target, limit }) => {
64366
+ return { content: [{ type: "text", text: JSON.stringify(await targetHealth(target, limit ?? 5)) }] };
64367
+ });
64368
+ server.registerTool("circuit_status", {
64369
+ title: "List all circuit-breaker states across targets",
64370
+ description: "Return every tracked target's circuit state (consecutive failures, open/closed) so the agent can see which targets are paused and which are safe to resume.",
64371
+ inputSchema: {}
64372
+ }, async () => {
64373
+ return { content: [{ type: "text", text: JSON.stringify(circuitStatus()) }] };
64374
+ });
64192
64375
  server.registerTool("jwt_forge", {
64193
64376
  title: "Forge JWT confusion tokens and verify which is accepted live",
64194
64377
  description: "Turn a captured JWT into forged attack tokens (alg:none, HS256 with empty key, HS256 with the public key = RS256→HS256 key confusion, plus kid/jku/x5u hints) and — when an endpoint is given — send each one to prove which is ACCEPTED (status < 400). A JWT hit is report-ready only when a forged token is accepted, never from header analysis alone.",
@@ -64855,7 +65038,7 @@ ${statusLine}` : statusLine },
64855
65038
  description: "Route confusion (separate class from source→sink taint): detect attacker-controlled dispatch (call_user_func/forward/dispatch), dynamic method calls ($obj->$m()), dynamic include (LFI), batch/proxy forwarding without per-route auth re-check, and route matching without path normalization.",
64856
65039
  inputSchema: { path: string2().describe("Source file path (PHP)") }
64857
65040
  }, async ({ path }) => {
64858
- const code = readFileSync31(path, "utf8");
65041
+ const code = readFileSync33(path, "utf8");
64859
65042
  const findings = detectRouteConfusion(code, path);
64860
65043
  return {
64861
65044
  content: [{
@@ -64869,7 +65052,7 @@ ${statusLine}` : statusLine },
64869
65052
  description: "Complex-bug detection beyond taint: deserialization→POP gadget chain (unserialize + magic method), type juggling (loose ==/!= vs hash/secret), mass assignment (extract/parse_str without a safe flag), prototype pollution (unsafe merge of request data), CRLF/header injection (user input into a header), path confusion (user input into a file path without canonicalization), SSRF (user-controlled URL with no host allowlist), XXE (user XML parsed without disabling entities), SSTI (user input into a template render with no sandbox), wrong-context sanitization (sanitize_text_field() into a SQL query), missing authorization/nonce on WordPress entry points (wp_ajax_* / admin_post_* / register_rest_route without current_user_can, nonce verification, or permission_callback), CORS misconfiguration (reflected/wildcard origin + credentials), XSS (user input into a DOM sink: innerHTML / dangerouslySetInnerHTML / document.write / .html / eval), and subdomain takeover (CNAME/AliasTarget to a claimable service).",
64870
65053
  inputSchema: { path: string2().describe("Source file path") }
64871
65054
  }, async ({ path }) => {
64872
- const code = readFileSync31(path, "utf8");
65055
+ const code = readFileSync33(path, "utf8");
64873
65056
  const findings = detectComplexBugs(code, path);
64874
65057
  return {
64875
65058
  content: [{
@@ -64955,7 +65138,7 @@ ${statusLine}` : statusLine },
64955
65138
  let lang = language;
64956
65139
  if (path && !code) {
64957
65140
  try {
64958
- src = readFileSync31(path, "utf8");
65141
+ src = readFileSync33(path, "utf8");
64959
65142
  } catch {
64960
65143
  return { content: [{ type: "text", text: JSON.stringify({ error: `cannot read ${path}` }) }] };
64961
65144
  }
@@ -65204,15 +65387,15 @@ async function serve() {
65204
65387
 
65205
65388
  // src/index.ts
65206
65389
  init_cli();
65207
- import { readFileSync as readFileSync35, existsSync as existsSync19 } from "node:fs";
65208
- import { join as join33 } from "node:path";
65209
- import { fileURLToPath as fileURLToPath21 } from "node:url";
65210
- var ROOT14 = join33(fileURLToPath21(new URL(".", import.meta.url)), "..");
65390
+ import { readFileSync as readFileSync37, existsSync as existsSync20 } from "node:fs";
65391
+ import { join as join35 } from "node:path";
65392
+ import { fileURLToPath as fileURLToPath22 } from "node:url";
65393
+ var ROOT15 = join35(fileURLToPath22(new URL(".", import.meta.url)), "..");
65211
65394
  function readVersion() {
65212
65395
  try {
65213
- const p = join33(ROOT14, "package.json");
65214
- if (existsSync19(p))
65215
- return JSON.parse(readFileSync35(p, "utf8")).version ?? "1.0.0";
65396
+ const p = join35(ROOT15, "package.json");
65397
+ if (existsSync20(p))
65398
+ return JSON.parse(readFileSync37(p, "utf8")).version ?? "1.0.0";
65216
65399
  } catch {}
65217
65400
  return "1.0.0";
65218
65401
  }
@@ -0,0 +1,20 @@
1
+ {
2
+ "_comment": "Specialist discovery heuristics: per vulnerability class, WHERE to discover the parameters to test and WHAT tool/technique to drive. Derived from public multi-agent scanner methodology (generalized — no source brand).",
3
+ "classes": [
4
+ { "id": "xss", "discover": "every reflected param (URL query + form field) + JS template sinks (dangerouslySetInnerHTML, innerHTML)", "test": "blind_oracle (sink detection) + drive_devtools (confirm execution)", "tools": ["blind_oracle", "drive_devtools", "browser_validate"] },
5
+ { "id": "sqli", "discover": "every query param + hidden form fields + CSRF tokens (SQLi can live in token validation)", "test": "blind_oracle (arithmetic id=1+0 vs id=1+1) + boolean/time inference", "tools": ["blind_oracle", "active_scan"] },
6
+ { "id": "ssrf", "discover": "URL-typed params (callback, url, redirect, webhook, img, proxy, fetch) + webhook-verification callbacks", "test": "blind_oracle + oob_start (canary URL must arrive)", "tools": ["blind_oracle", "oob_start", "oob_poll"] },
7
+ { "id": "idor", "discover": "path segments (/users/123) + UUIDs + sequential numeric ids in URLs", "test": "sibling_scan (differential IDOR attacker A → victim B)", "tools": ["sibling_scan", "active_scan"] },
8
+ { "id": "lfi", "discover": "file/read/path/include params (file, page, template, include, lang, path)", "test": "path traversal ../ sequences + encoding bypass", "tools": ["blind_oracle", "active_scan"] },
9
+ { "id": "rce", "discover": "command/code params (cmd, exec, ping, host, ip, eval) + deserialization endpoints", "test": "command injection i'''d / brace expansion + deserialization gadgets", "tools": ["blind_oracle", "oob_start"] },
10
+ { "id": "xxe", "discover": "XML upload endpoints + multipart forms + Content-Type: application/xml", "test": "XXE file disclosure + SSRF via XML parser + blind XXE via oob", "tools": ["oob_start", "oob_poll"] },
11
+ { "id": "jwt", "discover": "JWT patterns in URL params, body, cookies, localStorage, Authorization header (eyJ…)", "test": "jwt_analyze (parse + vectors) + jwt_forge (alg:none / RS256→HS256) live", "tools": ["jwt_analyze", "jwt_forge"] },
12
+ { "id": "open_redirect", "discover": "redirect/next/return/url params + OAuth redirect_uri", "test": "redirect to attacker-controlled URL (/%09/ // /\\ @ prefixes)", "tools": ["blind_oracle", "active_scan"] },
13
+ { "id": "prototype_pollution", "discover": "JSON POST acceptance (Content-Type: application/json) + merge/deep-extend endpoints", "test": "proto_pollution_probe (__proto__ / constructor.prototype canary)", "tools": ["proto_pollution_probe"] },
14
+ { "id": "csti", "discover": "Angular/Vue/React template sinks + {{ }} interpolation in reflected params", "test": "{{7*7}} / ${7*7} arithmetic reflection", "tools": ["blind_oracle", "drive_devtools"] },
15
+ { "id": "mass_assignment", "discover": "user-create/update endpoints + profile/payment POST bodies", "test": "inject role/is_admin/permissions/price/total fields", "tools": ["sibling_scan", "active_scan"] },
16
+ { "id": "header_injection", "discover": "header-reflecting params (host, x-forwarded-for, location, redirect)", "test": "CRLF injection + host-header cache poisoning", "tools": ["param_precedence", "active_scan"] },
17
+ { "id": "api_security", "discover": "REST/GraphQL routes + method tampering (GET↔POST↔PUT) + GraphQL introspection", "test": "horizontal/vertical privilege + method override", "tools": ["sibling_scan", "active_scan", "discover_api"] },
18
+ { "id": "file_upload", "discover": "multipart upload endpoints + avatar/import/attachment forms", "test": "extension/content-type bypass → web-reachable .php/.phtml", "tools": ["active_scan", "strike_verify"] }
19
+ ]
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blitzstrike",
3
- "version": "2.4.121",
3
+ "version": "2.4.123",
4
4
  "description": "Blitz Strike — a universal MCP security-audit toolbelt. BLITZ sweeps the attack surface, EAGLE-EYE traces source-to-sink, STRIKE verifies live. 57 attack chains, 130-tool catalog, intelligence data layer. One server, every agent.",
5
5
  "type": "module",
6
6
  "bin": {