blitzstrike 2.4.122 → 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 +10 -0
- package/dist/index.js +220 -146
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ 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
|
+
|
|
8
18
|
## [2.4.122] — 2026-09-29
|
|
9
19
|
|
|
10
20
|
### Added — `param_surface` (autonomous parameter discovery + specialist hints)
|
package/dist/index.js
CHANGED
|
@@ -17452,9 +17452,9 @@ var init_variants = __esm(() => {
|
|
|
17452
17452
|
});
|
|
17453
17453
|
|
|
17454
17454
|
// src/sync.ts
|
|
17455
|
-
import { mkdirSync as
|
|
17456
|
-
import { join as
|
|
17457
|
-
import { homedir as
|
|
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
17458
|
import { fileURLToPath as fileURLToPath18 } from "node:url";
|
|
17459
17459
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
17460
17460
|
function dirExists(p) {
|
|
@@ -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(
|
|
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
|
-
|
|
17487
|
-
const payloadsPath =
|
|
17488
|
-
const templatesPath =
|
|
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 =
|
|
17499
|
-
const localTemplates =
|
|
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 =
|
|
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(
|
|
17520
|
+
copyDir(join31(tmp, "payloads"), payloadsPath);
|
|
17521
17521
|
payloadsSynced = true;
|
|
17522
17522
|
}
|
|
17523
17523
|
if (!dirExists(templatesPath) || countFiles(templatesPath) === 0) {
|
|
17524
|
-
copyDir(
|
|
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
|
-
|
|
17544
|
+
mkdirSync11(dst, { recursive: true });
|
|
17545
17545
|
for (const e of readdirSync9(src, { withFileTypes: true })) {
|
|
17546
|
-
const s =
|
|
17547
|
-
const d =
|
|
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
|
-
|
|
17551
|
+
writeFileSync10(d, readFileSync32(s));
|
|
17552
17552
|
}
|
|
17553
17553
|
}
|
|
17554
17554
|
var ROOT11, DATA_ROOT2, GITHUB_REPO = "https://github.com/shinthink/blitzstrike.git";
|
|
17555
17555
|
var init_sync = __esm(() => {
|
|
17556
|
-
ROOT11 =
|
|
17557
|
-
DATA_ROOT2 = process.env.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
|
|
17603
|
-
import { join as
|
|
17602
|
+
import { readFileSync as readFileSync34, existsSync as existsSync18 } from "node:fs";
|
|
17603
|
+
import { join as join32 } from "node:path";
|
|
17604
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 =
|
|
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({
|
|
@@ -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
|
|
17642
|
+
return existsSync18(join32(ROOT12, "package-lock.json")) || existsSync18(join32(ROOT12, "bun.lock")) || existsSync18(join32(ROOT12, "bun.lockb"));
|
|
17643
17643
|
}
|
|
17644
17644
|
var ROOT12;
|
|
17645
17645
|
var init_release = __esm(() => {
|
|
17646
17646
|
init_version();
|
|
17647
|
-
ROOT12 =
|
|
17647
|
+
ROOT12 = join32(fileURLToPath19(new URL(".", import.meta.url)), "..");
|
|
17648
17648
|
});
|
|
17649
17649
|
|
|
17650
17650
|
// src/dependency.ts
|
|
17651
|
-
import { readFileSync as
|
|
17652
|
-
import { join as
|
|
17651
|
+
import { readFileSync as readFileSync35 } from "node:fs";
|
|
17652
|
+
import { join as join33 } from "node:path";
|
|
17653
17653
|
import { fileURLToPath as fileURLToPath20 } from "node:url";
|
|
17654
17654
|
function checkDependencies() {
|
|
17655
17655
|
let pkg = {};
|
|
17656
17656
|
try {
|
|
17657
|
-
pkg = JSON.parse(
|
|
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
|
}
|
|
@@ -17677,13 +17677,13 @@ function checkDependencies() {
|
|
|
17677
17677
|
}
|
|
17678
17678
|
var ROOT13;
|
|
17679
17679
|
var init_dependency = __esm(() => {
|
|
17680
|
-
ROOT13 =
|
|
17680
|
+
ROOT13 = join33(fileURLToPath20(new URL(".", import.meta.url)), "..");
|
|
17681
17681
|
});
|
|
17682
17682
|
|
|
17683
17683
|
// src/cli.ts
|
|
17684
|
-
import { readFileSync as
|
|
17685
|
-
import { join as
|
|
17686
|
-
import { homedir as
|
|
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
17687
|
import { fileURLToPath as fileURLToPath21 } from "node:url";
|
|
17688
17688
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
17689
17689
|
function which(cmd) {
|
|
@@ -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 =
|
|
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 =
|
|
17782
|
-
if (which("bun") &&
|
|
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 =
|
|
17789
|
-
if (
|
|
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(
|
|
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 (!
|
|
17804
|
-
|
|
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
|
-
|
|
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 (!
|
|
17817
|
-
|
|
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
|
-
|
|
17823
|
+
writeFileSync11(p, JSON.stringify(existing, null, 2));
|
|
17824
17824
|
copyOpenCodeAgents();
|
|
17825
17825
|
};
|
|
17826
17826
|
}
|
|
17827
17827
|
function copyOpenCodeAgents() {
|
|
17828
|
-
const srcDir =
|
|
17829
|
-
const dstDir =
|
|
17830
|
-
if (!
|
|
17828
|
+
const srcDir = join34(ROOT14, "opencode-agents");
|
|
17829
|
+
const dstDir = join34(homedir13(), ".config", "opencode", "agents");
|
|
17830
|
+
if (!existsSync19(srcDir))
|
|
17831
17831
|
return;
|
|
17832
|
-
if (!
|
|
17833
|
-
|
|
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 =
|
|
17836
|
-
const dst =
|
|
17837
|
-
if (
|
|
17838
|
-
|
|
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 (!
|
|
17846
|
-
|
|
17847
|
-
let existing =
|
|
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
|
-
|
|
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 (!
|
|
17865
|
-
|
|
17866
|
-
let existing =
|
|
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
|
-
|
|
17887
|
+
writeFileSync11(p, existing);
|
|
17888
17888
|
};
|
|
17889
17889
|
}
|
|
17890
17890
|
function detectAgents() {
|
|
17891
|
-
const home =
|
|
17891
|
+
const home = homedir13();
|
|
17892
17892
|
const agents = [];
|
|
17893
|
-
const claudeJson =
|
|
17893
|
+
const claudeJson = join34(home, ".claude.json");
|
|
17894
17894
|
agents.push({
|
|
17895
17895
|
name: "Claude Code",
|
|
17896
17896
|
detectPath: claudeJson,
|
|
17897
|
-
installed: () =>
|
|
17897
|
+
installed: () => existsSync19(claudeJson) || which("claude"),
|
|
17898
17898
|
write: jsonMcpServersWrite(claudeJson)
|
|
17899
17899
|
});
|
|
17900
|
-
const claudeDesktop =
|
|
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: () =>
|
|
17904
|
+
installed: () => existsSync19(claudeDesktop),
|
|
17905
17905
|
write: jsonMcpServersWrite(claudeDesktop)
|
|
17906
17906
|
});
|
|
17907
|
-
const cursor =
|
|
17907
|
+
const cursor = join34(home, ".cursor", "mcp.json");
|
|
17908
17908
|
agents.push({
|
|
17909
17909
|
name: "Cursor",
|
|
17910
17910
|
detectPath: cursor,
|
|
17911
|
-
installed: () =>
|
|
17911
|
+
installed: () => existsSync19(join34(home, ".cursor")) || which("cursor"),
|
|
17912
17912
|
write: jsonMcpServersWrite(cursor)
|
|
17913
17913
|
});
|
|
17914
|
-
const opencode =
|
|
17914
|
+
const opencode = join34(home, ".config", "opencode", "opencode.jsonc");
|
|
17915
17915
|
agents.push({
|
|
17916
17916
|
name: "OpenCode",
|
|
17917
17917
|
detectPath: opencode,
|
|
17918
|
-
installed: () =>
|
|
17918
|
+
installed: () => existsSync19(join34(home, ".config", "opencode")) || which("opencode"),
|
|
17919
17919
|
write: opencodeWrite(opencode)
|
|
17920
17920
|
});
|
|
17921
|
-
const codex =
|
|
17921
|
+
const codex = join34(home, ".codex", "config.toml");
|
|
17922
17922
|
agents.push({
|
|
17923
17923
|
name: "Codex",
|
|
17924
17924
|
detectPath: codex,
|
|
17925
|
-
installed: () =>
|
|
17925
|
+
installed: () => existsSync19(join34(home, ".codex")) || which("codex"),
|
|
17926
17926
|
write: codexWrite(codex)
|
|
17927
17927
|
});
|
|
17928
|
-
const hermes =
|
|
17928
|
+
const hermes = join34(home, ".hermes", "config.yaml");
|
|
17929
17929
|
agents.push({
|
|
17930
17930
|
name: "Hermes",
|
|
17931
17931
|
detectPath: hermes,
|
|
17932
|
-
installed: () =>
|
|
17932
|
+
installed: () => existsSync19(join34(home, ".hermes")) || which("hermes"),
|
|
17933
17933
|
write: hermesWrite(hermes)
|
|
17934
17934
|
});
|
|
17935
|
-
const gemini =
|
|
17935
|
+
const gemini = join34(home, ".gemini", "settings.json");
|
|
17936
17936
|
agents.push({
|
|
17937
17937
|
name: "Gemini CLI",
|
|
17938
17938
|
detectPath: gemini,
|
|
17939
|
-
installed: () =>
|
|
17939
|
+
installed: () => existsSync19(join34(home, ".gemini")) || which("gemini"),
|
|
17940
17940
|
write: jsonMcpServersWrite(gemini)
|
|
17941
17941
|
});
|
|
17942
|
-
const windsurf =
|
|
17942
|
+
const windsurf = join34(home, ".codeium", "windsurf", "mcp_config.json");
|
|
17943
17943
|
agents.push({
|
|
17944
17944
|
name: "Windsurf",
|
|
17945
17945
|
detectPath: windsurf,
|
|
17946
|
-
installed: () =>
|
|
17946
|
+
installed: () => existsSync19(join34(home, ".codeium")) || which("windsurf"),
|
|
17947
17947
|
write: jsonMcpServersWrite(windsurf)
|
|
17948
17948
|
});
|
|
17949
|
-
const copilot =
|
|
17949
|
+
const copilot = join34(home, ".copilot", "mcp.json");
|
|
17950
17950
|
agents.push({
|
|
17951
17951
|
name: "Copilot",
|
|
17952
17952
|
detectPath: copilot,
|
|
17953
|
-
installed: () =>
|
|
17953
|
+
installed: () => existsSync19(join34(home, ".copilot")),
|
|
17954
17954
|
write: jsonMcpServersWrite(copilot)
|
|
17955
17955
|
});
|
|
17956
|
-
const cline =
|
|
17956
|
+
const cline = join34(home, ".cline", "mcp_settings.json");
|
|
17957
17957
|
agents.push({
|
|
17958
17958
|
name: "Cline",
|
|
17959
17959
|
detectPath: cline,
|
|
17960
|
-
installed: () =>
|
|
17960
|
+
installed: () => existsSync19(join34(home, ".cline")),
|
|
17961
17961
|
write: jsonMcpServersWrite(cline)
|
|
17962
17962
|
});
|
|
17963
17963
|
return agents;
|
|
@@ -18075,7 +18075,7 @@ var init_cli = __esm(() => {
|
|
|
18075
18075
|
init_release();
|
|
18076
18076
|
init_dependency();
|
|
18077
18077
|
init_mcp_status();
|
|
18078
|
-
ROOT14 =
|
|
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
|
|
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
|
|
@@ -60607,19 +60607,76 @@ async function paramSurface(target, class_) {
|
|
|
60607
60607
|
return { ...result, url: base, status_hint: status === 0 ? "fetch failed" : `http ${status}` };
|
|
60608
60608
|
}
|
|
60609
60609
|
|
|
60610
|
-
// src/
|
|
60611
|
-
import { readFileSync as readFileSync26,
|
|
60610
|
+
// src/circuit-breaker.ts
|
|
60611
|
+
import { readFileSync as readFileSync26, writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, existsSync as existsSync13 } from "node:fs";
|
|
60612
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";
|
|
60613
60670
|
import { fileURLToPath as fileURLToPath16 } from "node:url";
|
|
60614
|
-
import { tmpdir as tmpdir3, homedir as
|
|
60671
|
+
import { tmpdir as tmpdir3, homedir as homedir10 } from "node:os";
|
|
60615
60672
|
init_complex_bugs();
|
|
60616
|
-
var ROOT9 =
|
|
60617
|
-
var CORPUS =
|
|
60618
|
-
var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ??
|
|
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");
|
|
60619
60676
|
function parseCorpusFile(path) {
|
|
60620
60677
|
let text;
|
|
60621
60678
|
try {
|
|
60622
|
-
text =
|
|
60679
|
+
text = readFileSync27(path, "utf8");
|
|
60623
60680
|
} catch {
|
|
60624
60681
|
return null;
|
|
60625
60682
|
}
|
|
@@ -60675,7 +60732,7 @@ function loadDir(dir) {
|
|
|
60675
60732
|
for (const f of readdirSync7(dir)) {
|
|
60676
60733
|
if (!f.endsWith(".md"))
|
|
60677
60734
|
continue;
|
|
60678
|
-
const e = parseCorpusFile(
|
|
60735
|
+
const e = parseCorpusFile(join27(dir, f));
|
|
60679
60736
|
if (e)
|
|
60680
60737
|
entries.push(e);
|
|
60681
60738
|
}
|
|
@@ -60686,7 +60743,7 @@ function loadCorpus2() {
|
|
|
60686
60743
|
return [...loadDir(CORPUS), ...loadDir(CAPTURED_CORPUS_DIR)];
|
|
60687
60744
|
}
|
|
60688
60745
|
function captureFalsePositive(input) {
|
|
60689
|
-
|
|
60746
|
+
mkdirSync8(CAPTURED_CORPUS_DIR, { recursive: true });
|
|
60690
60747
|
const slug = (input.note ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40) || "captured";
|
|
60691
60748
|
const id = `fp-${slug}-${Date.now().toString(36)}`;
|
|
60692
60749
|
const ext = { php: "php", javascript: "js", typescript: "ts", python: "py", java: "java", js: "js" }[input.language.toLowerCase()] ?? input.language;
|
|
@@ -60702,8 +60759,8 @@ function captureFalsePositive(input) {
|
|
|
60702
60759
|
input.code,
|
|
60703
60760
|
"```"
|
|
60704
60761
|
].filter((l) => l !== null);
|
|
60705
|
-
const path =
|
|
60706
|
-
|
|
60762
|
+
const path = join27(CAPTURED_CORPUS_DIR, `${id}.md`);
|
|
60763
|
+
writeFileSync7(path, lines.join(`
|
|
60707
60764
|
`) + `
|
|
60708
60765
|
`, "utf8");
|
|
60709
60766
|
const entry = { id, language: input.language.toLowerCase(), vulnerable: false, detector: input.detector, note: input.note, sink_type: input.sink_type, code: input.code };
|
|
@@ -60724,8 +60781,8 @@ function detect(entry) {
|
|
|
60724
60781
|
}
|
|
60725
60782
|
const lang = entry.language;
|
|
60726
60783
|
if (lang === "php") {
|
|
60727
|
-
const tmp =
|
|
60728
|
-
|
|
60784
|
+
const tmp = join27(tmpdir3(), `blitzstrike-bench-${entry.id}-${process.pid}.php`);
|
|
60785
|
+
writeFileSync7(tmp, entry.code);
|
|
60729
60786
|
const r = analyzeDataFlow2(tmp);
|
|
60730
60787
|
rmSync3(tmp, { force: true });
|
|
60731
60788
|
if (r.findings.length > 0)
|
|
@@ -60793,25 +60850,25 @@ function runBenchmark() {
|
|
|
60793
60850
|
}
|
|
60794
60851
|
|
|
60795
60852
|
// src/obligations.ts
|
|
60796
|
-
import { readFileSync as
|
|
60797
|
-
import { join as
|
|
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";
|
|
60798
60855
|
import { createHash as createHash6 } from "node:crypto";
|
|
60799
|
-
import { homedir as
|
|
60800
|
-
var
|
|
60801
|
-
var OBLIGATION_PATH =
|
|
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");
|
|
60802
60859
|
function ensureDir3() {
|
|
60803
|
-
if (!
|
|
60804
|
-
|
|
60860
|
+
if (!existsSync14(HOME_DIR5))
|
|
60861
|
+
mkdirSync9(HOME_DIR5, { recursive: true });
|
|
60805
60862
|
}
|
|
60806
60863
|
function shortId2(claim) {
|
|
60807
60864
|
return `obl-${createHash6("sha256").update(`${claim}\x00${Date.now()}`).digest("hex").slice(0, 12)}`;
|
|
60808
60865
|
}
|
|
60809
60866
|
function loadObligations() {
|
|
60810
|
-
if (!
|
|
60867
|
+
if (!existsSync14(OBLIGATION_PATH))
|
|
60811
60868
|
return [];
|
|
60812
60869
|
try {
|
|
60813
60870
|
const out = [];
|
|
60814
|
-
for (const line of
|
|
60871
|
+
for (const line of readFileSync28(OBLIGATION_PATH, "utf8").split(`
|
|
60815
60872
|
`)) {
|
|
60816
60873
|
const t = line.trim();
|
|
60817
60874
|
if (!t)
|
|
@@ -60832,7 +60889,7 @@ function append3(o) {
|
|
|
60832
60889
|
}
|
|
60833
60890
|
function rewrite(entries) {
|
|
60834
60891
|
ensureDir3();
|
|
60835
|
-
|
|
60892
|
+
writeFileSync8(OBLIGATION_PATH, entries.map((e) => JSON.stringify(e)).join(`
|
|
60836
60893
|
`) + (entries.length ? `
|
|
60837
60894
|
` : ""));
|
|
60838
60895
|
}
|
|
@@ -60915,11 +60972,11 @@ init_framework_security();
|
|
|
60915
60972
|
// src/variant-scan.ts
|
|
60916
60973
|
init_scanner();
|
|
60917
60974
|
init_complex_bugs();
|
|
60918
|
-
import { readFileSync as
|
|
60975
|
+
import { readFileSync as readFileSync30 } from "node:fs";
|
|
60919
60976
|
|
|
60920
60977
|
// src/cross-file.ts
|
|
60921
60978
|
init_scanner();
|
|
60922
|
-
import { readFileSync as
|
|
60979
|
+
import { readFileSync as readFileSync29 } from "node:fs";
|
|
60923
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)/;
|
|
60924
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*\(/;
|
|
60925
60982
|
var ROLE_META_RE = /update_user_meta\s*\(\s*[^,]+,\s*['"](wp_capabilities|role|roles|capabilities|wp_user_level)['"]/;
|
|
@@ -60971,7 +61028,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
60971
61028
|
for (const file of files) {
|
|
60972
61029
|
let code;
|
|
60973
61030
|
try {
|
|
60974
|
-
code = stripComments(
|
|
61031
|
+
code = stripComments(readFileSync29(file, "utf8"));
|
|
60975
61032
|
} catch {
|
|
60976
61033
|
continue;
|
|
60977
61034
|
}
|
|
@@ -61012,7 +61069,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
61012
61069
|
for (const file of files) {
|
|
61013
61070
|
let code;
|
|
61014
61071
|
try {
|
|
61015
|
-
code = stripComments(
|
|
61072
|
+
code = stripComments(readFileSync29(file, "utf8"));
|
|
61016
61073
|
} catch {
|
|
61017
61074
|
continue;
|
|
61018
61075
|
}
|
|
@@ -61035,7 +61092,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
61035
61092
|
for (const file of files) {
|
|
61036
61093
|
let code;
|
|
61037
61094
|
try {
|
|
61038
|
-
code = stripComments(
|
|
61095
|
+
code = stripComments(readFileSync29(file, "utf8"));
|
|
61039
61096
|
} catch {
|
|
61040
61097
|
continue;
|
|
61041
61098
|
}
|
|
@@ -61150,7 +61207,7 @@ function variantScan(root, opts = {}) {
|
|
|
61150
61207
|
for (const file of files) {
|
|
61151
61208
|
let code;
|
|
61152
61209
|
try {
|
|
61153
|
-
code =
|
|
61210
|
+
code = readFileSync30(file, "utf8");
|
|
61154
61211
|
} catch {
|
|
61155
61212
|
continue;
|
|
61156
61213
|
}
|
|
@@ -61814,7 +61871,7 @@ import { spawn as spawn3, execSync as execSync2 } from "node:child_process";
|
|
|
61814
61871
|
import { createServer } from "node:http";
|
|
61815
61872
|
import { randomUUID } from "node:crypto";
|
|
61816
61873
|
import { networkInterfaces } from "node:os";
|
|
61817
|
-
import { existsSync as
|
|
61874
|
+
import { existsSync as existsSync15 } from "node:fs";
|
|
61818
61875
|
var sessions = new Map;
|
|
61819
61876
|
function sleep(ms) {
|
|
61820
61877
|
return new Promise((r) => setTimeout(r, ms));
|
|
@@ -61828,7 +61885,7 @@ function findInteractsh() {
|
|
|
61828
61885
|
const home = process.env.HOME ?? "/root";
|
|
61829
61886
|
const candidates = [`${home}/go/bin/interactsh-client`, "/usr/local/bin/interactsh-client", "/usr/bin/interactsh-client"];
|
|
61830
61887
|
for (const c of candidates)
|
|
61831
|
-
if (
|
|
61888
|
+
if (existsSync15(c))
|
|
61832
61889
|
return c;
|
|
61833
61890
|
return null;
|
|
61834
61891
|
}
|
|
@@ -62833,9 +62890,9 @@ function listPocTypes() {
|
|
|
62833
62890
|
|
|
62834
62891
|
// src/foundry-run.ts
|
|
62835
62892
|
import { execSync as execSync3 } from "node:child_process";
|
|
62836
|
-
import { mkdtempSync as mkdtempSync3, mkdirSync as
|
|
62893
|
+
import { mkdtempSync as mkdtempSync3, mkdirSync as mkdirSync10, writeFileSync as writeFileSync9, rmSync as rmSync4, existsSync as existsSync16 } from "node:fs";
|
|
62837
62894
|
import { tmpdir as tmpdir4 } from "node:os";
|
|
62838
|
-
import { join as
|
|
62895
|
+
import { join as join29 } from "node:path";
|
|
62839
62896
|
function findForge() {
|
|
62840
62897
|
try {
|
|
62841
62898
|
const p = execSync3("which forge 2>/dev/null", { encoding: "utf8", timeout: 3000 }).trim();
|
|
@@ -62845,7 +62902,7 @@ function findForge() {
|
|
|
62845
62902
|
const home = process.env.HOME ?? "/root";
|
|
62846
62903
|
const candidates = [`${home}/.foundry/bin/forge`, "/usr/local/bin/forge", "/usr/bin/forge"];
|
|
62847
62904
|
for (const c of candidates)
|
|
62848
|
-
if (
|
|
62905
|
+
if (existsSync16(c))
|
|
62849
62906
|
return c;
|
|
62850
62907
|
return null;
|
|
62851
62908
|
}
|
|
@@ -62884,14 +62941,14 @@ async function foundryRun(input) {
|
|
|
62884
62941
|
};
|
|
62885
62942
|
}
|
|
62886
62943
|
const poc = input.poc_code ?? foundryPoc(input.class_ ?? "missing_access_control", name);
|
|
62887
|
-
const dir = mkdtempSync3(
|
|
62944
|
+
const dir = mkdtempSync3(join29(tmpdir4(), "blitzstrike-foundry-"));
|
|
62888
62945
|
try {
|
|
62889
62946
|
try {
|
|
62890
62947
|
execSync3(`${forge} init --force --no-git ${dir}`, { stdio: "ignore", timeout: 60000 });
|
|
62891
62948
|
} catch {
|
|
62892
|
-
|
|
62893
|
-
|
|
62894
|
-
|
|
62949
|
+
mkdirSync10(join29(dir, "src"), { recursive: true });
|
|
62950
|
+
mkdirSync10(join29(dir, "test"), { recursive: true });
|
|
62951
|
+
writeFileSync9(join29(dir, "foundry.toml"), `[profile.default]
|
|
62895
62952
|
src = "src"
|
|
62896
62953
|
out = "out"
|
|
62897
62954
|
libs = ["lib"]
|
|
@@ -62901,12 +62958,12 @@ solc = "0.8.20"
|
|
|
62901
62958
|
for (const f of ["Counter.sol", "Counter.t.sol", "Counter.s.sol"]) {
|
|
62902
62959
|
for (const sub of ["src", "test", "script"]) {
|
|
62903
62960
|
try {
|
|
62904
|
-
rmSync4(
|
|
62961
|
+
rmSync4(join29(dir, sub, f), { force: true });
|
|
62905
62962
|
} catch {}
|
|
62906
62963
|
}
|
|
62907
62964
|
}
|
|
62908
|
-
|
|
62909
|
-
|
|
62965
|
+
writeFileSync9(join29(dir, "src", `${name}.sol`), input.contract_code);
|
|
62966
|
+
writeFileSync9(join29(dir, "test", `${name}.t.sol`), poc);
|
|
62910
62967
|
const { out } = runForge(forge, dir, input.timeout_ms ?? 60000);
|
|
62911
62968
|
const tests = parseTestResults(out);
|
|
62912
62969
|
const anyFail = tests.some((t) => t.status === "fail");
|
|
@@ -62924,18 +62981,18 @@ solc = "0.8.20"
|
|
|
62924
62981
|
}
|
|
62925
62982
|
|
|
62926
62983
|
// src/enterprise-benchmark.ts
|
|
62927
|
-
import { existsSync as
|
|
62928
|
-
import { join as
|
|
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";
|
|
62929
62986
|
import { fileURLToPath as fileURLToPath17 } from "node:url";
|
|
62930
62987
|
init_complex_bugs();
|
|
62931
62988
|
var ROOT10 = resolve(fileURLToPath17(new URL(".", import.meta.url)), "..", "bench", "enterprise");
|
|
62932
62989
|
var ENTERPRISE_FIXTURES = [
|
|
62933
|
-
{ id: "php-laravel", dir:
|
|
62934
|
-
{ id: "js-express", dir:
|
|
62935
|
-
{ id: "py-django", dir:
|
|
62936
|
-
{ id: "java-spring", dir:
|
|
62937
|
-
{ id: "wp-batch-route", dir:
|
|
62938
|
-
{ id: "php-complex", dir:
|
|
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 }
|
|
62939
62996
|
];
|
|
62940
62997
|
function sourceFiles(root) {
|
|
62941
62998
|
const out = [];
|
|
@@ -62947,7 +63004,7 @@ function sourceFiles(root) {
|
|
|
62947
63004
|
return;
|
|
62948
63005
|
}
|
|
62949
63006
|
for (const e of entries) {
|
|
62950
|
-
const p =
|
|
63007
|
+
const p = join30(dir, e);
|
|
62951
63008
|
let st;
|
|
62952
63009
|
try {
|
|
62953
63010
|
st = statSync5(p);
|
|
@@ -62968,7 +63025,7 @@ function detectFixture(dir) {
|
|
|
62968
63025
|
for (const f of sourceFiles(dir)) {
|
|
62969
63026
|
let code;
|
|
62970
63027
|
try {
|
|
62971
|
-
code =
|
|
63028
|
+
code = readFileSync31(f, "utf8");
|
|
62972
63029
|
} catch {
|
|
62973
63030
|
continue;
|
|
62974
63031
|
}
|
|
@@ -62986,7 +63043,7 @@ function detectFixture(dir) {
|
|
|
62986
63043
|
function runEnterpriseBenchmark() {
|
|
62987
63044
|
const fixtures = [];
|
|
62988
63045
|
for (const fx of ENTERPRISE_FIXTURES) {
|
|
62989
|
-
if (!
|
|
63046
|
+
if (!existsSync17(fx.dir)) {
|
|
62990
63047
|
fixtures.push({ id: fx.id, available: false, detected: 0, expected: fx.expected_vulns, recall: 0 });
|
|
62991
63048
|
continue;
|
|
62992
63049
|
}
|
|
@@ -63181,7 +63238,7 @@ function createServer2() {
|
|
|
63181
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).
|
|
63182
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.
|
|
63183
63240
|
|
|
63184
|
-
` + "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.\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:
|
|
63185
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.
|
|
63186
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.
|
|
63187
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."
|
|
@@ -64072,7 +64129,7 @@ ${statusLine}` : statusLine },
|
|
|
64072
64129
|
let src = code;
|
|
64073
64130
|
if (!src && path) {
|
|
64074
64131
|
try {
|
|
64075
|
-
src =
|
|
64132
|
+
src = readFileSync33(path, "utf8");
|
|
64076
64133
|
} catch {
|
|
64077
64134
|
return { content: [{ type: "text", text: JSON.stringify({ error: "unreadable path" }) }] };
|
|
64078
64135
|
}
|
|
@@ -64153,7 +64210,7 @@ ${statusLine}` : statusLine },
|
|
|
64153
64210
|
let src = code;
|
|
64154
64211
|
if (!src && path) {
|
|
64155
64212
|
try {
|
|
64156
|
-
src =
|
|
64213
|
+
src = readFileSync33(path, "utf8");
|
|
64157
64214
|
} catch {
|
|
64158
64215
|
return { content: [{ type: "text", text: JSON.stringify({ error: "unreadable path" }) }] };
|
|
64159
64216
|
}
|
|
@@ -64298,6 +64355,23 @@ ${statusLine}` : statusLine },
|
|
|
64298
64355
|
}, async ({ target, class_ }) => {
|
|
64299
64356
|
return { content: [{ type: "text", text: JSON.stringify(await paramSurface(target, class_)) }] };
|
|
64300
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
|
+
});
|
|
64301
64375
|
server.registerTool("jwt_forge", {
|
|
64302
64376
|
title: "Forge JWT confusion tokens and verify which is accepted live",
|
|
64303
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.",
|
|
@@ -64964,7 +65038,7 @@ ${statusLine}` : statusLine },
|
|
|
64964
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.",
|
|
64965
65039
|
inputSchema: { path: string2().describe("Source file path (PHP)") }
|
|
64966
65040
|
}, async ({ path }) => {
|
|
64967
|
-
const code =
|
|
65041
|
+
const code = readFileSync33(path, "utf8");
|
|
64968
65042
|
const findings = detectRouteConfusion(code, path);
|
|
64969
65043
|
return {
|
|
64970
65044
|
content: [{
|
|
@@ -64978,7 +65052,7 @@ ${statusLine}` : statusLine },
|
|
|
64978
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).",
|
|
64979
65053
|
inputSchema: { path: string2().describe("Source file path") }
|
|
64980
65054
|
}, async ({ path }) => {
|
|
64981
|
-
const code =
|
|
65055
|
+
const code = readFileSync33(path, "utf8");
|
|
64982
65056
|
const findings = detectComplexBugs(code, path);
|
|
64983
65057
|
return {
|
|
64984
65058
|
content: [{
|
|
@@ -65064,7 +65138,7 @@ ${statusLine}` : statusLine },
|
|
|
65064
65138
|
let lang = language;
|
|
65065
65139
|
if (path && !code) {
|
|
65066
65140
|
try {
|
|
65067
|
-
src =
|
|
65141
|
+
src = readFileSync33(path, "utf8");
|
|
65068
65142
|
} catch {
|
|
65069
65143
|
return { content: [{ type: "text", text: JSON.stringify({ error: `cannot read ${path}` }) }] };
|
|
65070
65144
|
}
|
|
@@ -65313,15 +65387,15 @@ async function serve() {
|
|
|
65313
65387
|
|
|
65314
65388
|
// src/index.ts
|
|
65315
65389
|
init_cli();
|
|
65316
|
-
import { readFileSync as
|
|
65317
|
-
import { join as
|
|
65390
|
+
import { readFileSync as readFileSync37, existsSync as existsSync20 } from "node:fs";
|
|
65391
|
+
import { join as join35 } from "node:path";
|
|
65318
65392
|
import { fileURLToPath as fileURLToPath22 } from "node:url";
|
|
65319
|
-
var ROOT15 =
|
|
65393
|
+
var ROOT15 = join35(fileURLToPath22(new URL(".", import.meta.url)), "..");
|
|
65320
65394
|
function readVersion() {
|
|
65321
65395
|
try {
|
|
65322
|
-
const p =
|
|
65323
|
-
if (
|
|
65324
|
-
return JSON.parse(
|
|
65396
|
+
const p = join35(ROOT15, "package.json");
|
|
65397
|
+
if (existsSync20(p))
|
|
65398
|
+
return JSON.parse(readFileSync37(p, "utf8")).version ?? "1.0.0";
|
|
65325
65399
|
} catch {}
|
|
65326
65400
|
return "1.0.0";
|
|
65327
65401
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blitzstrike",
|
|
3
|
-
"version": "2.4.
|
|
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": {
|