blitzstrike 2.4.57 → 2.4.59
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 +34 -0
- package/dist/index.js +368 -108
- package/intelligence/patterns.json +151 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,40 @@ 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.59] — 2026-09-14
|
|
9
|
+
|
|
10
|
+
### Added — Severity calibration + engagement scaffold + data health
|
|
11
|
+
|
|
12
|
+
- New `severity_calibrate` MCP tool (src/severity.ts): maps a detector type to a
|
|
13
|
+
platform-neutral priority tier (P1–P5) + a VRT-style category + rationale, with
|
|
14
|
+
an optional CVSS cross-reference — a finding is reported at the severity a triager
|
|
15
|
+
would assign, not the detector's raw default.
|
|
16
|
+
- New `engagement_scaffold` MCP tool: opens an engagement and emits a deterministic
|
|
17
|
+
folder layout (scope.md, findings/, evidence/, reports/, notes/) + a pre-filled
|
|
18
|
+
scope.md template, so a hunt starts with structure instead of improvisation.
|
|
19
|
+
- New `data_refresh` MCP tool (src/datarefresh.ts): re-loads every data layer
|
|
20
|
+
(chains, patterns, CWE map) and verifies cross-references, surfacing stale/broken
|
|
21
|
+
data instead of silently producing bad grounding.
|
|
22
|
+
- System prompt updated to drive the full grounding→gate→calibrate→scaffold flow.
|
|
23
|
+
|
|
24
|
+
## [2.4.58] — 2026-09-14
|
|
25
|
+
|
|
26
|
+
### Added — Empirical grounding v1 (pattern library + submission gate)
|
|
27
|
+
|
|
28
|
+
- New `intelligence/patterns.json` — the empirical grounding layer: all 16 detector
|
|
29
|
+
types are traced to their CWE, real-world signature, the escalation chains they
|
|
30
|
+
compose into (cross-ref chains.json), and citable references (CWE/OWASP). Detection
|
|
31
|
+
is now derived from disclosed-report-class knowledge, not abstract heuristics alone.
|
|
32
|
+
- New `src/patterns.ts` + `pattern_lookup` MCP tool — returns a detector hit's empirical
|
|
33
|
+
grounding (CWE, real-world signature, chains, references) to turn a raw hit into a
|
|
34
|
+
class-aware finding.
|
|
35
|
+
- New `submission_gate` MCP tool — a deterministic 7-question gate (reproducible,
|
|
36
|
+
in-scope, real-impact, no-privileged-assumption, verified-live, evidence-redacted,
|
|
37
|
+
severity-derived); one false = the finding does not ship. Formally enforces
|
|
38
|
+
"never report unverified".
|
|
39
|
+
- Inventory self-test extended: every detector type must be empirically grounded in
|
|
40
|
+
patterns.json AND CWE-mapped (drift fails at build time).
|
|
41
|
+
|
|
8
42
|
## [2.4.57] — 2026-09-14
|
|
9
43
|
|
|
10
44
|
### Added — Secret detection v2 (single taxonomy + format + entropy tiers)
|
package/dist/index.js
CHANGED
|
@@ -15490,10 +15490,10 @@ async function checkMcpServers() {
|
|
|
15490
15490
|
var init_mcp_status = () => {};
|
|
15491
15491
|
|
|
15492
15492
|
// src/sync.ts
|
|
15493
|
-
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync8, readFileSync as
|
|
15494
|
-
import { join as
|
|
15493
|
+
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync8, readFileSync as readFileSync24, readdirSync as readdirSync7, statSync as statSync4, rmSync as rmSync4 } from "node:fs";
|
|
15494
|
+
import { join as join21 } from "node:path";
|
|
15495
15495
|
import { homedir as homedir10 } from "node:os";
|
|
15496
|
-
import { fileURLToPath as
|
|
15496
|
+
import { fileURLToPath as fileURLToPath11 } from "node:url";
|
|
15497
15497
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
15498
15498
|
function dirExists(p) {
|
|
15499
15499
|
try {
|
|
@@ -15508,7 +15508,7 @@ function countFiles(dir) {
|
|
|
15508
15508
|
const walk = (d) => {
|
|
15509
15509
|
for (const e of readdirSync7(d, { withFileTypes: true })) {
|
|
15510
15510
|
if (e.isDirectory())
|
|
15511
|
-
walk(
|
|
15511
|
+
walk(join21(d, e.name));
|
|
15512
15512
|
else
|
|
15513
15513
|
n++;
|
|
15514
15514
|
}
|
|
@@ -15522,8 +15522,8 @@ function countFiles(dir) {
|
|
|
15522
15522
|
function syncData() {
|
|
15523
15523
|
if (!dirExists(DATA_ROOT2))
|
|
15524
15524
|
mkdirSync9(DATA_ROOT2, { recursive: true });
|
|
15525
|
-
const payloadsPath =
|
|
15526
|
-
const templatesPath =
|
|
15525
|
+
const payloadsPath = join21(DATA_ROOT2, "payloads");
|
|
15526
|
+
const templatesPath = join21(DATA_ROOT2, "templates");
|
|
15527
15527
|
const hasPayloads = dirExists(payloadsPath) && countFiles(payloadsPath) > 0;
|
|
15528
15528
|
const hasTemplates = dirExists(templatesPath) && countFiles(templatesPath) > 0;
|
|
15529
15529
|
if (hasPayloads && hasTemplates) {
|
|
@@ -15533,8 +15533,8 @@ function syncData() {
|
|
|
15533
15533
|
data_root: DATA_ROOT2
|
|
15534
15534
|
};
|
|
15535
15535
|
}
|
|
15536
|
-
const localPayloads =
|
|
15537
|
-
const localTemplates =
|
|
15536
|
+
const localPayloads = join21(ROOT7, "payloads");
|
|
15537
|
+
const localTemplates = join21(ROOT7, "templates");
|
|
15538
15538
|
let payloadsSynced = false;
|
|
15539
15539
|
let templatesSynced = false;
|
|
15540
15540
|
if (!hasPayloads && dirExists(localPayloads)) {
|
|
@@ -15547,7 +15547,7 @@ function syncData() {
|
|
|
15547
15547
|
}
|
|
15548
15548
|
const gitOk = spawnSync4("git", ["--version"]).status === 0;
|
|
15549
15549
|
if (gitOk && (!dirExists(payloadsPath) || countFiles(payloadsPath) === 0 || !dirExists(templatesPath) || countFiles(templatesPath) === 0)) {
|
|
15550
|
-
const tmp =
|
|
15550
|
+
const tmp = join21(DATA_ROOT2, ".tmp-clone");
|
|
15551
15551
|
if (dirExists(tmp))
|
|
15552
15552
|
rmSync4(tmp, { recursive: true, force: true });
|
|
15553
15553
|
const r = spawnSync4("git", ["clone", "--depth", "1", "--filter=blob:none", "--sparse", GITHUB_REPO, tmp], { timeout: 120000 });
|
|
@@ -15555,11 +15555,11 @@ function syncData() {
|
|
|
15555
15555
|
const sparse = spawnSync4("git", ["-C", tmp, "sparse-checkout", "set", "payloads", "templates"], { timeout: 120000 });
|
|
15556
15556
|
if (sparse.status === 0) {
|
|
15557
15557
|
if (!dirExists(payloadsPath) || countFiles(payloadsPath) === 0) {
|
|
15558
|
-
copyDir(
|
|
15558
|
+
copyDir(join21(tmp, "payloads"), payloadsPath);
|
|
15559
15559
|
payloadsSynced = true;
|
|
15560
15560
|
}
|
|
15561
15561
|
if (!dirExists(templatesPath) || countFiles(templatesPath) === 0) {
|
|
15562
|
-
copyDir(
|
|
15562
|
+
copyDir(join21(tmp, "templates"), templatesPath);
|
|
15563
15563
|
templatesSynced = true;
|
|
15564
15564
|
}
|
|
15565
15565
|
}
|
|
@@ -15581,18 +15581,18 @@ function copyDir(src, dst) {
|
|
|
15581
15581
|
function manualCopy(src, dst) {
|
|
15582
15582
|
mkdirSync9(dst, { recursive: true });
|
|
15583
15583
|
for (const e of readdirSync7(src, { withFileTypes: true })) {
|
|
15584
|
-
const s =
|
|
15585
|
-
const d =
|
|
15584
|
+
const s = join21(src, e.name);
|
|
15585
|
+
const d = join21(dst, e.name);
|
|
15586
15586
|
if (e.isDirectory())
|
|
15587
15587
|
manualCopy(s, d);
|
|
15588
15588
|
else
|
|
15589
|
-
writeFileSync8(d,
|
|
15589
|
+
writeFileSync8(d, readFileSync24(s));
|
|
15590
15590
|
}
|
|
15591
15591
|
}
|
|
15592
15592
|
var ROOT7, DATA_ROOT2, GITHUB_REPO = "https://github.com/shinthink/blitzstrike.git";
|
|
15593
15593
|
var init_sync = __esm(() => {
|
|
15594
|
-
ROOT7 =
|
|
15595
|
-
DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ??
|
|
15594
|
+
ROOT7 = join21(fileURLToPath11(new URL(".", import.meta.url)), "..");
|
|
15595
|
+
DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ?? join21(homedir10(), ".blitzstrike", "data");
|
|
15596
15596
|
});
|
|
15597
15597
|
|
|
15598
15598
|
// src/update.ts
|
|
@@ -15637,15 +15637,15 @@ var init_update = __esm(() => {
|
|
|
15637
15637
|
});
|
|
15638
15638
|
|
|
15639
15639
|
// src/release.ts
|
|
15640
|
-
import { readFileSync as
|
|
15641
|
-
import { join as
|
|
15642
|
-
import { fileURLToPath as
|
|
15640
|
+
import { readFileSync as readFileSync26, existsSync as existsSync12 } from "node:fs";
|
|
15641
|
+
import { join as join22 } from "node:path";
|
|
15642
|
+
import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
15643
15643
|
import { execSync as execSync2 } from "node:child_process";
|
|
15644
15644
|
function validateRelease() {
|
|
15645
15645
|
const checks = [];
|
|
15646
15646
|
checks.push({ name: "package.json version", ok: true, detail: VERSION });
|
|
15647
15647
|
try {
|
|
15648
|
-
const changelog =
|
|
15648
|
+
const changelog = readFileSync26(join22(ROOT8, "CHANGELOG.md"), "utf8");
|
|
15649
15649
|
const m = changelog.match(/^##\s+\[([0-9]+\.[0-9]+\.[0-9]+)\]/m);
|
|
15650
15650
|
const changelogVersion = m?.[1] ?? null;
|
|
15651
15651
|
checks.push({
|
|
@@ -15677,22 +15677,22 @@ function validateRelease() {
|
|
|
15677
15677
|
return { version: VERSION, checks, consistent: checks.filter((c) => !c.soft).every((c) => c.ok) };
|
|
15678
15678
|
}
|
|
15679
15679
|
function lockfilePresent() {
|
|
15680
|
-
return existsSync12(
|
|
15680
|
+
return existsSync12(join22(ROOT8, "package-lock.json")) || existsSync12(join22(ROOT8, "bun.lock")) || existsSync12(join22(ROOT8, "bun.lockb"));
|
|
15681
15681
|
}
|
|
15682
15682
|
var ROOT8;
|
|
15683
15683
|
var init_release = __esm(() => {
|
|
15684
15684
|
init_version();
|
|
15685
|
-
ROOT8 =
|
|
15685
|
+
ROOT8 = join22(fileURLToPath12(new URL(".", import.meta.url)), "..");
|
|
15686
15686
|
});
|
|
15687
15687
|
|
|
15688
15688
|
// src/dependency.ts
|
|
15689
|
-
import { readFileSync as
|
|
15690
|
-
import { join as
|
|
15691
|
-
import { fileURLToPath as
|
|
15689
|
+
import { readFileSync as readFileSync27 } from "node:fs";
|
|
15690
|
+
import { join as join23 } from "node:path";
|
|
15691
|
+
import { fileURLToPath as fileURLToPath13 } from "node:url";
|
|
15692
15692
|
function checkDependencies() {
|
|
15693
15693
|
let pkg = {};
|
|
15694
15694
|
try {
|
|
15695
|
-
pkg = JSON.parse(
|
|
15695
|
+
pkg = JSON.parse(readFileSync27(join23(ROOT9, "package.json"), "utf8"));
|
|
15696
15696
|
} catch {
|
|
15697
15697
|
return { install_scripts: [], git_dependencies: [], total_dependencies: 0, safe: false };
|
|
15698
15698
|
}
|
|
@@ -15715,14 +15715,14 @@ function checkDependencies() {
|
|
|
15715
15715
|
}
|
|
15716
15716
|
var ROOT9;
|
|
15717
15717
|
var init_dependency = __esm(() => {
|
|
15718
|
-
ROOT9 =
|
|
15718
|
+
ROOT9 = join23(fileURLToPath13(new URL(".", import.meta.url)), "..");
|
|
15719
15719
|
});
|
|
15720
15720
|
|
|
15721
15721
|
// src/cli.ts
|
|
15722
|
-
import { readFileSync as
|
|
15723
|
-
import { join as
|
|
15722
|
+
import { readFileSync as readFileSync28, existsSync as existsSync13, writeFileSync as writeFileSync9, mkdirSync as mkdirSync10 } from "node:fs";
|
|
15723
|
+
import { join as join24, dirname as dirname4 } from "node:path";
|
|
15724
15724
|
import { homedir as homedir11 } from "node:os";
|
|
15725
|
-
import { fileURLToPath as
|
|
15725
|
+
import { fileURLToPath as fileURLToPath14 } from "node:url";
|
|
15726
15726
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
15727
15727
|
function which(cmd) {
|
|
15728
15728
|
return spawnSync5("sh", ["-c", 'command -v "$1" >/dev/null 2>&1', "sh", cmd]).status === 0;
|
|
@@ -15765,7 +15765,7 @@ async function runDoctor() {
|
|
|
15765
15765
|
detail: h1 ? `X-HackerOne-Research: ${h1}` : "H1_USERNAME not set",
|
|
15766
15766
|
fix: h1 ? undefined : "export H1_USERNAME=<your-hackerone-username> (adds X-HackerOne-Research to outbound requests)"
|
|
15767
15767
|
});
|
|
15768
|
-
const dataOk = existsSync13(
|
|
15768
|
+
const dataOk = existsSync13(join24(ROOT10, "chains.json")) && existsSync13(join24(ROOT10, "tools-catalog.json"));
|
|
15769
15769
|
issues.push({
|
|
15770
15770
|
name: "Data layers (chains + tools-catalog)",
|
|
15771
15771
|
status: dataOk ? "ok" : "fail",
|
|
@@ -15816,28 +15816,28 @@ BlitzStrike — ${verdict}`);
|
|
|
15816
15816
|
function resolveCommand() {
|
|
15817
15817
|
if (which("blitzstrike"))
|
|
15818
15818
|
return { command: "blitzstrike", args: ["serve", "--mcp"] };
|
|
15819
|
-
const src =
|
|
15819
|
+
const src = join24(ROOT10, "src", "index.ts");
|
|
15820
15820
|
if (which("bun") && existsSync13(src))
|
|
15821
15821
|
return { command: "bun", args: ["run", src, "serve", "--mcp"] };
|
|
15822
15822
|
if (which("npx"))
|
|
15823
15823
|
return { command: "npx", args: ["-y", "blitzstrike", "serve", "--mcp"] };
|
|
15824
15824
|
if (which("bunx"))
|
|
15825
15825
|
return { command: "bunx", args: ["blitzstrike", "serve", "--mcp"] };
|
|
15826
|
-
const dist =
|
|
15826
|
+
const dist = join24(ROOT10, "dist", "index.js");
|
|
15827
15827
|
if (existsSync13(dist))
|
|
15828
15828
|
return { command: "bun", args: [dist, "serve", "--mcp"] };
|
|
15829
15829
|
return { command: "npx", args: ["-y", "blitzstrike", "serve", "--mcp"] };
|
|
15830
15830
|
}
|
|
15831
15831
|
function readJson(p) {
|
|
15832
15832
|
try {
|
|
15833
|
-
return JSON.parse(
|
|
15833
|
+
return JSON.parse(readFileSync28(p, "utf8"));
|
|
15834
15834
|
} catch {
|
|
15835
15835
|
return null;
|
|
15836
15836
|
}
|
|
15837
15837
|
}
|
|
15838
15838
|
function jsonMcpServersWrite(p) {
|
|
15839
15839
|
return (command, args) => {
|
|
15840
|
-
const dir =
|
|
15840
|
+
const dir = dirname4(p);
|
|
15841
15841
|
if (!existsSync13(dir))
|
|
15842
15842
|
mkdirSync10(dir, { recursive: true });
|
|
15843
15843
|
const existing = readJson(p) ?? {};
|
|
@@ -15850,7 +15850,7 @@ function jsonMcpServersWrite(p) {
|
|
|
15850
15850
|
}
|
|
15851
15851
|
function opencodeWrite(p) {
|
|
15852
15852
|
return (command, args) => {
|
|
15853
|
-
const dir =
|
|
15853
|
+
const dir = dirname4(p);
|
|
15854
15854
|
if (!existsSync13(dir))
|
|
15855
15855
|
mkdirSync10(dir, { recursive: true });
|
|
15856
15856
|
const existing = readJson(p) ?? {};
|
|
@@ -15863,26 +15863,26 @@ function opencodeWrite(p) {
|
|
|
15863
15863
|
};
|
|
15864
15864
|
}
|
|
15865
15865
|
function copyOpenCodeAgents() {
|
|
15866
|
-
const srcDir =
|
|
15867
|
-
const dstDir =
|
|
15866
|
+
const srcDir = join24(ROOT10, "opencode-agents");
|
|
15867
|
+
const dstDir = join24(homedir11(), ".config", "opencode", "agents");
|
|
15868
15868
|
if (!existsSync13(srcDir))
|
|
15869
15869
|
return;
|
|
15870
15870
|
if (!existsSync13(dstDir))
|
|
15871
15871
|
mkdirSync10(dstDir, { recursive: true });
|
|
15872
15872
|
for (const f of ["Blitz Strike.md", "Blitz.md", "Eagle Eye.md", "Strike.md"]) {
|
|
15873
|
-
const src =
|
|
15874
|
-
const dst =
|
|
15873
|
+
const src = join24(srcDir, f);
|
|
15874
|
+
const dst = join24(dstDir, f);
|
|
15875
15875
|
if (existsSync13(src)) {
|
|
15876
|
-
writeFileSync9(dst,
|
|
15876
|
+
writeFileSync9(dst, readFileSync28(src, "utf8"));
|
|
15877
15877
|
}
|
|
15878
15878
|
}
|
|
15879
15879
|
}
|
|
15880
15880
|
function codexWrite(p) {
|
|
15881
15881
|
return (command, args) => {
|
|
15882
|
-
const dir =
|
|
15882
|
+
const dir = dirname4(p);
|
|
15883
15883
|
if (!existsSync13(dir))
|
|
15884
15884
|
mkdirSync10(dir, { recursive: true });
|
|
15885
|
-
let existing = existsSync13(p) ?
|
|
15885
|
+
let existing = existsSync13(p) ? readFileSync28(p, "utf8") : "";
|
|
15886
15886
|
if (!existing.trimEnd().endsWith(`
|
|
15887
15887
|
`))
|
|
15888
15888
|
existing += `
|
|
@@ -15898,10 +15898,10 @@ args = ${JSON.stringify(args)}
|
|
|
15898
15898
|
}
|
|
15899
15899
|
function hermesWrite(p) {
|
|
15900
15900
|
return (command, args) => {
|
|
15901
|
-
const dir =
|
|
15901
|
+
const dir = dirname4(p);
|
|
15902
15902
|
if (!existsSync13(dir))
|
|
15903
15903
|
mkdirSync10(dir, { recursive: true });
|
|
15904
|
-
let existing = existsSync13(p) ?
|
|
15904
|
+
let existing = existsSync13(p) ? readFileSync28(p, "utf8") : "";
|
|
15905
15905
|
existing = existing.replace(/^ blitzstrike:\n(?: .*\n?)*/m, "");
|
|
15906
15906
|
if (!existing.trimEnd().endsWith(`
|
|
15907
15907
|
`))
|
|
@@ -15928,74 +15928,74 @@ mcp_servers:
|
|
|
15928
15928
|
function detectAgents() {
|
|
15929
15929
|
const home = homedir11();
|
|
15930
15930
|
const agents = [];
|
|
15931
|
-
const claudeJson =
|
|
15931
|
+
const claudeJson = join24(home, ".claude.json");
|
|
15932
15932
|
agents.push({
|
|
15933
15933
|
name: "Claude Code",
|
|
15934
15934
|
detectPath: claudeJson,
|
|
15935
15935
|
installed: () => existsSync13(claudeJson) || which("claude"),
|
|
15936
15936
|
write: jsonMcpServersWrite(claudeJson)
|
|
15937
15937
|
});
|
|
15938
|
-
const claudeDesktop =
|
|
15938
|
+
const claudeDesktop = join24(home, ".config", "Claude", "claude_desktop_config.json");
|
|
15939
15939
|
agents.push({
|
|
15940
15940
|
name: "Claude Desktop",
|
|
15941
15941
|
detectPath: claudeDesktop,
|
|
15942
15942
|
installed: () => existsSync13(claudeDesktop),
|
|
15943
15943
|
write: jsonMcpServersWrite(claudeDesktop)
|
|
15944
15944
|
});
|
|
15945
|
-
const cursor =
|
|
15945
|
+
const cursor = join24(home, ".cursor", "mcp.json");
|
|
15946
15946
|
agents.push({
|
|
15947
15947
|
name: "Cursor",
|
|
15948
15948
|
detectPath: cursor,
|
|
15949
|
-
installed: () => existsSync13(
|
|
15949
|
+
installed: () => existsSync13(join24(home, ".cursor")) || which("cursor"),
|
|
15950
15950
|
write: jsonMcpServersWrite(cursor)
|
|
15951
15951
|
});
|
|
15952
|
-
const opencode =
|
|
15952
|
+
const opencode = join24(home, ".config", "opencode", "opencode.jsonc");
|
|
15953
15953
|
agents.push({
|
|
15954
15954
|
name: "OpenCode",
|
|
15955
15955
|
detectPath: opencode,
|
|
15956
|
-
installed: () => existsSync13(
|
|
15956
|
+
installed: () => existsSync13(join24(home, ".config", "opencode")) || which("opencode"),
|
|
15957
15957
|
write: opencodeWrite(opencode)
|
|
15958
15958
|
});
|
|
15959
|
-
const codex =
|
|
15959
|
+
const codex = join24(home, ".codex", "config.toml");
|
|
15960
15960
|
agents.push({
|
|
15961
15961
|
name: "Codex",
|
|
15962
15962
|
detectPath: codex,
|
|
15963
|
-
installed: () => existsSync13(
|
|
15963
|
+
installed: () => existsSync13(join24(home, ".codex")) || which("codex"),
|
|
15964
15964
|
write: codexWrite(codex)
|
|
15965
15965
|
});
|
|
15966
|
-
const hermes =
|
|
15966
|
+
const hermes = join24(home, ".hermes", "config.yaml");
|
|
15967
15967
|
agents.push({
|
|
15968
15968
|
name: "Hermes",
|
|
15969
15969
|
detectPath: hermes,
|
|
15970
|
-
installed: () => existsSync13(
|
|
15970
|
+
installed: () => existsSync13(join24(home, ".hermes")) || which("hermes"),
|
|
15971
15971
|
write: hermesWrite(hermes)
|
|
15972
15972
|
});
|
|
15973
|
-
const gemini =
|
|
15973
|
+
const gemini = join24(home, ".gemini", "settings.json");
|
|
15974
15974
|
agents.push({
|
|
15975
15975
|
name: "Gemini CLI",
|
|
15976
15976
|
detectPath: gemini,
|
|
15977
|
-
installed: () => existsSync13(
|
|
15977
|
+
installed: () => existsSync13(join24(home, ".gemini")) || which("gemini"),
|
|
15978
15978
|
write: jsonMcpServersWrite(gemini)
|
|
15979
15979
|
});
|
|
15980
|
-
const windsurf =
|
|
15980
|
+
const windsurf = join24(home, ".codeium", "windsurf", "mcp_config.json");
|
|
15981
15981
|
agents.push({
|
|
15982
15982
|
name: "Windsurf",
|
|
15983
15983
|
detectPath: windsurf,
|
|
15984
|
-
installed: () => existsSync13(
|
|
15984
|
+
installed: () => existsSync13(join24(home, ".codeium")) || which("windsurf"),
|
|
15985
15985
|
write: jsonMcpServersWrite(windsurf)
|
|
15986
15986
|
});
|
|
15987
|
-
const copilot =
|
|
15987
|
+
const copilot = join24(home, ".copilot", "mcp.json");
|
|
15988
15988
|
agents.push({
|
|
15989
15989
|
name: "Copilot",
|
|
15990
15990
|
detectPath: copilot,
|
|
15991
|
-
installed: () => existsSync13(
|
|
15991
|
+
installed: () => existsSync13(join24(home, ".copilot")),
|
|
15992
15992
|
write: jsonMcpServersWrite(copilot)
|
|
15993
15993
|
});
|
|
15994
|
-
const cline =
|
|
15994
|
+
const cline = join24(home, ".cline", "mcp_settings.json");
|
|
15995
15995
|
agents.push({
|
|
15996
15996
|
name: "Cline",
|
|
15997
15997
|
detectPath: cline,
|
|
15998
|
-
installed: () => existsSync13(
|
|
15998
|
+
installed: () => existsSync13(join24(home, ".cline")),
|
|
15999
15999
|
write: jsonMcpServersWrite(cline)
|
|
16000
16000
|
});
|
|
16001
16001
|
return agents;
|
|
@@ -16113,7 +16113,7 @@ var init_cli = __esm(() => {
|
|
|
16113
16113
|
init_release();
|
|
16114
16114
|
init_dependency();
|
|
16115
16115
|
init_mcp_status();
|
|
16116
|
-
ROOT10 =
|
|
16116
|
+
ROOT10 = join24(fileURLToPath14(new URL(".", import.meta.url)), "..");
|
|
16117
16117
|
});
|
|
16118
16118
|
|
|
16119
16119
|
// node_modules/zod/v3/helpers/util.js
|
|
@@ -30751,7 +30751,7 @@ class StdioServerTransport {
|
|
|
30751
30751
|
|
|
30752
30752
|
// src/server.ts
|
|
30753
30753
|
init_scanner();
|
|
30754
|
-
import { readFileSync as
|
|
30754
|
+
import { readFileSync as readFileSync25 } from "node:fs";
|
|
30755
30755
|
|
|
30756
30756
|
// src/recon.ts
|
|
30757
30757
|
var TIMEOUT_MS = 25000;
|
|
@@ -35526,6 +35526,41 @@ function engagementStatus() {
|
|
|
35526
35526
|
next_phase: next
|
|
35527
35527
|
};
|
|
35528
35528
|
}
|
|
35529
|
+
function scaffoldEngagement(target, scope = [], out_of_scope = []) {
|
|
35530
|
+
const state = startEngagement(target, "live");
|
|
35531
|
+
const scopeLines = (scope.length ? scope : [target]).map((s) => `- ${s}`).join(`
|
|
35532
|
+
`);
|
|
35533
|
+
const oosLines = (out_of_scope.length ? out_of_scope : ["(none declared)"]).map((s) => `- ${s}`).join(`
|
|
35534
|
+
`);
|
|
35535
|
+
const scopeMd = [
|
|
35536
|
+
`# Engagement scope`,
|
|
35537
|
+
``,
|
|
35538
|
+
`**Target:** ${target}`,
|
|
35539
|
+
``,
|
|
35540
|
+
`## In scope`,
|
|
35541
|
+
scopeLines,
|
|
35542
|
+
``,
|
|
35543
|
+
`## Out of scope`,
|
|
35544
|
+
oosLines,
|
|
35545
|
+
``,
|
|
35546
|
+
`## Accepted impact classes`,
|
|
35547
|
+
`- (paste the program's vulnerability-type / accepted-impact list here)`,
|
|
35548
|
+
``,
|
|
35549
|
+
`## Testing rules`,
|
|
35550
|
+
`- (paste rate limits, prohibited areas, and any special rules here)`,
|
|
35551
|
+
``
|
|
35552
|
+
].join(`
|
|
35553
|
+
`);
|
|
35554
|
+
return {
|
|
35555
|
+
id: state.id,
|
|
35556
|
+
target,
|
|
35557
|
+
scope,
|
|
35558
|
+
out_of_scope,
|
|
35559
|
+
structure: ["scope.md", "findings/", "evidence/", "reports/", "notes/"],
|
|
35560
|
+
scope_md: scopeMd,
|
|
35561
|
+
state
|
|
35562
|
+
};
|
|
35563
|
+
}
|
|
35529
35564
|
|
|
35530
35565
|
// src/incremental.ts
|
|
35531
35566
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
@@ -57195,18 +57230,181 @@ function nextSteps(ctx) {
|
|
|
57195
57230
|
return steps;
|
|
57196
57231
|
}
|
|
57197
57232
|
|
|
57198
|
-
// src/
|
|
57199
|
-
import { readFileSync as readFileSync17
|
|
57200
|
-
import { join as join16 } from "node:path";
|
|
57233
|
+
// src/patterns.ts
|
|
57234
|
+
import { readFileSync as readFileSync17 } from "node:fs";
|
|
57235
|
+
import { join as join16, dirname as dirname2 } from "node:path";
|
|
57201
57236
|
import { fileURLToPath as fileURLToPath8 } from "node:url";
|
|
57237
|
+
var __dirname2 = dirname2(fileURLToPath8(import.meta.url));
|
|
57238
|
+
var _doc = null;
|
|
57239
|
+
function load3() {
|
|
57240
|
+
if (_doc)
|
|
57241
|
+
return _doc;
|
|
57242
|
+
try {
|
|
57243
|
+
_doc = JSON.parse(readFileSync17(join16(__dirname2, "..", "intelligence", "patterns.json"), "utf8"));
|
|
57244
|
+
} catch {
|
|
57245
|
+
_doc = { patterns: [] };
|
|
57246
|
+
}
|
|
57247
|
+
return _doc;
|
|
57248
|
+
}
|
|
57249
|
+
function patternLookup(id) {
|
|
57250
|
+
const p = load3().patterns.find((x) => x.id === id.toLowerCase());
|
|
57251
|
+
return p ?? null;
|
|
57252
|
+
}
|
|
57253
|
+
function listPatterns() {
|
|
57254
|
+
return load3().patterns;
|
|
57255
|
+
}
|
|
57256
|
+
function submissionGate(input) {
|
|
57257
|
+
const questions = [
|
|
57258
|
+
{
|
|
57259
|
+
q: "Reproducible — a copy-paste-ready request or step list triggers it?",
|
|
57260
|
+
pass: input.reproducible !== false,
|
|
57261
|
+
reason: "Without an exact reproduction the finding is a hypothesis, not a result."
|
|
57262
|
+
},
|
|
57263
|
+
{
|
|
57264
|
+
q: "In scope — the vulnerable asset is in the engagement scope?",
|
|
57265
|
+
pass: input.in_scope !== false,
|
|
57266
|
+
reason: "Out-of-scope assets must not be submitted."
|
|
57267
|
+
},
|
|
57268
|
+
{
|
|
57269
|
+
q: "Real impact — maps to an accepted-impact class, not informational?",
|
|
57270
|
+
pass: input.real_impact !== false,
|
|
57271
|
+
reason: "Informational-only findings dilute the validity ratio."
|
|
57272
|
+
},
|
|
57273
|
+
{
|
|
57274
|
+
q: "No privileged assumption — works without unrealistic attacker prerequisites?",
|
|
57275
|
+
pass: input.no_privileged_assumption !== false,
|
|
57276
|
+
reason: "'Admin can do X' is a centralization risk, not a vulnerability."
|
|
57277
|
+
},
|
|
57278
|
+
{
|
|
57279
|
+
q: "Verified live — confirmed with a marker + negative control, not just a static hint?",
|
|
57280
|
+
pass: input.verified_live !== false,
|
|
57281
|
+
reason: "A static hit is a hypothesis until verified live (strike_verify / browser_validate)."
|
|
57282
|
+
},
|
|
57283
|
+
{
|
|
57284
|
+
q: "Evidence attached AND redacted — secrets/PII stripped, integrity-tagged?",
|
|
57285
|
+
pass: input.evidence_redacted !== false,
|
|
57286
|
+
reason: "Evidence must carry SHA-256-tagged, redacted records — no leaked secrets or victim PII."
|
|
57287
|
+
},
|
|
57288
|
+
{
|
|
57289
|
+
q: "Severity derived — CVSS/confidence computed, not guessed?",
|
|
57290
|
+
pass: input.severity_derived !== false,
|
|
57291
|
+
reason: "Severity is not confidence; derive it, don't assert it."
|
|
57292
|
+
}
|
|
57293
|
+
];
|
|
57294
|
+
const failed = questions.find((q) => !q.pass);
|
|
57295
|
+
return {
|
|
57296
|
+
verdict: failed ? "fail" : "pass",
|
|
57297
|
+
passed: questions.filter((q) => q.pass).length,
|
|
57298
|
+
total: questions.length,
|
|
57299
|
+
questions,
|
|
57300
|
+
...failed ? { blocker: failed.q } : {}
|
|
57301
|
+
};
|
|
57302
|
+
}
|
|
57303
|
+
|
|
57304
|
+
// src/severity.ts
|
|
57305
|
+
var VRT_MAP = {
|
|
57306
|
+
sql_injection: { vrt: "injection > sql_injection", priority: "P1", severity: "critical", rationale: "SQL injection reaches sensitive data or enables admin takeover." },
|
|
57307
|
+
ssti: { vrt: "injection > server_side_template_injection", priority: "P1", severity: "critical", rationale: "SSTI evaluates expressions server-side → code execution." },
|
|
57308
|
+
deserialization: { vrt: "injection > insecure_deserialization", priority: "P1", severity: "critical", rationale: "Deserialization escalated via a gadget chain → code execution." },
|
|
57309
|
+
xxe: { vrt: "injection > xml_external_entity", priority: "P1", severity: "critical", rationale: "XXE reads local files or reaches internal services." },
|
|
57310
|
+
file_upload: { vrt: "insecure_design > unrestricted_file_upload", priority: "P1", severity: "critical", rationale: "A web-reachable uploaded file of an executable type → code execution." },
|
|
57311
|
+
priv_esc: { vrt: "broken_access_control > privilege_escalation", priority: "P1", severity: "critical", rationale: "A user self-assigns an elevated role → full account/tenant takeover." },
|
|
57312
|
+
path_confusion: { vrt: "broken_access_control > path_traversal", priority: "P2", severity: "high", rationale: "Path traversal reads files or writes outside the intended directory; P1 if it reaches an RCE chain." },
|
|
57313
|
+
ssrf: { vrt: "insecure_design > server_side_request_forgery", priority: "P2", severity: "high", rationale: "SSRF reaches internal services; P1 when it hits cloud metadata and exfiltrates credentials." },
|
|
57314
|
+
mass_assignment: { vrt: "broken_access_control > mass_assignment", priority: "P2", severity: "high", rationale: "Attacker sets a privileged field (role/is_admin) → privilege escalation." },
|
|
57315
|
+
missing_authz: { vrt: "broken_access_control > missing_authorization", priority: "P2", severity: "high", rationale: "A state-changing action lacks a capability/ownership check." },
|
|
57316
|
+
type_juggling: { vrt: "authentication > authentication_bypass", priority: "P2", severity: "high", rationale: "Loose comparison collapses a hash/secret → authentication bypass." },
|
|
57317
|
+
hardcoded_secret: { vrt: "sensitive_data_exposure > hardcoded_credentials", priority: "P2", severity: "high", rationale: "A committed credential is usable by anyone with repo access → account/cloud takeover." },
|
|
57318
|
+
prototype_pollution: { vrt: "injection > prototype_pollution", priority: "P2", severity: "high", rationale: "Object prototype corruption can escalate to code execution in gadget-heavy runtimes." },
|
|
57319
|
+
crlf_injection: { vrt: "injection > crlf_injection", priority: "P3", severity: "medium", rationale: "Header injection enables cookie poisoning or cache poisoning." },
|
|
57320
|
+
missing_nonce: { vrt: "broken_access_control > cross_site_request_forgery", priority: "P3", severity: "medium", rationale: "A state-changing action lacks an anti-CSRF token." },
|
|
57321
|
+
wrong_sanitizer: { vrt: "injection > improper_input_validation", priority: "P3", severity: "medium", rationale: "A value sanitized for the wrong context still reaches the sink; severity follows the sink." }
|
|
57322
|
+
};
|
|
57323
|
+
function severityCalibrate(input) {
|
|
57324
|
+
const type = input.type?.toLowerCase() ?? "";
|
|
57325
|
+
const entry = VRT_MAP[type];
|
|
57326
|
+
if (input.informational) {
|
|
57327
|
+
return {
|
|
57328
|
+
type,
|
|
57329
|
+
vrt_category: "informational",
|
|
57330
|
+
priority: "P5",
|
|
57331
|
+
severity: "informational",
|
|
57332
|
+
rationale: "Marked informational — excluded from the validity ratio.",
|
|
57333
|
+
...input.cvss != null ? { cvss_severity: cvssSeverity(input.cvss) } : {}
|
|
57334
|
+
};
|
|
57335
|
+
}
|
|
57336
|
+
if (!entry) {
|
|
57337
|
+
return {
|
|
57338
|
+
type,
|
|
57339
|
+
vrt_category: "unclassified",
|
|
57340
|
+
priority: "P4",
|
|
57341
|
+
severity: "low",
|
|
57342
|
+
rationale: `No VRT mapping for '${type}'; defaulting to low until classified.`,
|
|
57343
|
+
...input.cvss != null ? { cvss_severity: cvssSeverity(input.cvss) } : {}
|
|
57344
|
+
};
|
|
57345
|
+
}
|
|
57346
|
+
return {
|
|
57347
|
+
type,
|
|
57348
|
+
vrt_category: entry.vrt,
|
|
57349
|
+
priority: entry.priority,
|
|
57350
|
+
severity: entry.severity,
|
|
57351
|
+
rationale: entry.rationale,
|
|
57352
|
+
...input.cvss != null ? { cvss_severity: cvssSeverity(input.cvss) } : {}
|
|
57353
|
+
};
|
|
57354
|
+
}
|
|
57355
|
+
function listSeverityMap() {
|
|
57356
|
+
return Object.entries(VRT_MAP).map(([type, e]) => ({ type, priority: e.priority, vrt: e.vrt }));
|
|
57357
|
+
}
|
|
57358
|
+
|
|
57359
|
+
// src/datarefresh.ts
|
|
57360
|
+
import { readFileSync as readFileSync18 } from "node:fs";
|
|
57361
|
+
import { join as join17, dirname as dirname3 } from "node:path";
|
|
57362
|
+
import { fileURLToPath as fileURLToPath9 } from "node:url";
|
|
57363
|
+
var __dirname3 = dirname3(fileURLToPath9(import.meta.url));
|
|
57364
|
+
function loadJson2(rel) {
|
|
57365
|
+
try {
|
|
57366
|
+
return JSON.parse(readFileSync18(join17(__dirname3, "..", rel), "utf8"));
|
|
57367
|
+
} catch {
|
|
57368
|
+
return null;
|
|
57369
|
+
}
|
|
57370
|
+
}
|
|
57371
|
+
function dataRefresh() {
|
|
57372
|
+
const chains = loadJson2("chains.json");
|
|
57373
|
+
const patterns = loadJson2("intelligence/patterns.json");
|
|
57374
|
+
const cwe = loadJson2("intelligence/cwe_map.json");
|
|
57375
|
+
const chainList = chains?.chains ?? [];
|
|
57376
|
+
const patternList = patterns?.patterns ?? [];
|
|
57377
|
+
const cweList = cwe?.mapping ?? [];
|
|
57378
|
+
const chainIds = new Set(chainList.map((c) => c.id));
|
|
57379
|
+
const cweIds = new Set(cweList.map((m) => m.id));
|
|
57380
|
+
const brokenChainRefs = patternList.flatMap((p) => (p.chain_templates ?? []).filter((c) => !chainIds.has(c)).map((c) => `${p.id} -> ${c}`));
|
|
57381
|
+
const missingCwe = patternList.map((p) => p.id).filter((id) => !cweIds.has(id));
|
|
57382
|
+
return {
|
|
57383
|
+
layers: {
|
|
57384
|
+
chains: chainIds.size,
|
|
57385
|
+
patterns: patternList.length,
|
|
57386
|
+
cwe: cweIds.size
|
|
57387
|
+
},
|
|
57388
|
+
consistency: {
|
|
57389
|
+
ok: brokenChainRefs.length === 0 && missingCwe.length === 0,
|
|
57390
|
+
broken_chain_refs: brokenChainRefs,
|
|
57391
|
+
missing_cwe: missingCwe
|
|
57392
|
+
}
|
|
57393
|
+
};
|
|
57394
|
+
}
|
|
57395
|
+
|
|
57396
|
+
// src/benchmark.ts
|
|
57397
|
+
import { readFileSync as readFileSync19, readdirSync as readdirSync5, writeFileSync as writeFileSync6, rmSync as rmSync3, mkdirSync as mkdirSync7 } from "node:fs";
|
|
57398
|
+
import { join as join18 } from "node:path";
|
|
57399
|
+
import { fileURLToPath as fileURLToPath10 } from "node:url";
|
|
57202
57400
|
import { tmpdir as tmpdir3, homedir as homedir8 } from "node:os";
|
|
57203
|
-
var ROOT5 =
|
|
57204
|
-
var CORPUS =
|
|
57205
|
-
var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ??
|
|
57401
|
+
var ROOT5 = join18(fileURLToPath10(new URL(".", import.meta.url)), "..");
|
|
57402
|
+
var CORPUS = join18(ROOT5, "bench", "corpus");
|
|
57403
|
+
var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ?? join18(homedir8(), ".blitzstrike", "corpus");
|
|
57206
57404
|
function parseCorpusFile(path) {
|
|
57207
57405
|
let text;
|
|
57208
57406
|
try {
|
|
57209
|
-
text =
|
|
57407
|
+
text = readFileSync19(path, "utf8");
|
|
57210
57408
|
} catch {
|
|
57211
57409
|
return null;
|
|
57212
57410
|
}
|
|
@@ -57262,7 +57460,7 @@ function loadDir(dir) {
|
|
|
57262
57460
|
for (const f of readdirSync5(dir)) {
|
|
57263
57461
|
if (!f.endsWith(".md"))
|
|
57264
57462
|
continue;
|
|
57265
|
-
const e = parseCorpusFile(
|
|
57463
|
+
const e = parseCorpusFile(join18(dir, f));
|
|
57266
57464
|
if (e)
|
|
57267
57465
|
entries.push(e);
|
|
57268
57466
|
}
|
|
@@ -57289,7 +57487,7 @@ function captureFalsePositive(input) {
|
|
|
57289
57487
|
input.code,
|
|
57290
57488
|
"```"
|
|
57291
57489
|
].filter((l) => l !== null);
|
|
57292
|
-
const path =
|
|
57490
|
+
const path = join18(CAPTURED_CORPUS_DIR, `${id}.md`);
|
|
57293
57491
|
writeFileSync6(path, lines.join(`
|
|
57294
57492
|
`) + `
|
|
57295
57493
|
`, "utf8");
|
|
@@ -57311,7 +57509,7 @@ function detect(entry) {
|
|
|
57311
57509
|
}
|
|
57312
57510
|
const lang = entry.language;
|
|
57313
57511
|
if (lang === "php") {
|
|
57314
|
-
const tmp =
|
|
57512
|
+
const tmp = join18(tmpdir3(), `blitzstrike-bench-${entry.id}-${process.pid}.php`);
|
|
57315
57513
|
writeFileSync6(tmp, entry.code);
|
|
57316
57514
|
const r = analyzeDataFlow2(tmp);
|
|
57317
57515
|
rmSync3(tmp, { force: true });
|
|
@@ -57380,12 +57578,12 @@ function runBenchmark() {
|
|
|
57380
57578
|
}
|
|
57381
57579
|
|
|
57382
57580
|
// src/obligations.ts
|
|
57383
|
-
import { readFileSync as
|
|
57384
|
-
import { join as
|
|
57581
|
+
import { readFileSync as readFileSync20, appendFileSync as appendFileSync4, mkdirSync as mkdirSync8, existsSync as existsSync10, writeFileSync as writeFileSync7 } from "node:fs";
|
|
57582
|
+
import { join as join19 } from "node:path";
|
|
57385
57583
|
import { createHash as createHash6 } from "node:crypto";
|
|
57386
57584
|
import { homedir as homedir9 } from "node:os";
|
|
57387
|
-
var HOME_DIR4 = process.env.BLITZSTRIKE_HOME ??
|
|
57388
|
-
var OBLIGATION_PATH =
|
|
57585
|
+
var HOME_DIR4 = process.env.BLITZSTRIKE_HOME ?? join19(homedir9(), ".blitzstrike");
|
|
57586
|
+
var OBLIGATION_PATH = join19(HOME_DIR4, "obligations.jsonl");
|
|
57389
57587
|
function ensureDir3() {
|
|
57390
57588
|
if (!existsSync10(HOME_DIR4))
|
|
57391
57589
|
mkdirSync8(HOME_DIR4, { recursive: true });
|
|
@@ -57398,7 +57596,7 @@ function loadObligations() {
|
|
|
57398
57596
|
return [];
|
|
57399
57597
|
try {
|
|
57400
57598
|
const out = [];
|
|
57401
|
-
for (const line of
|
|
57599
|
+
for (const line of readFileSync20(OBLIGATION_PATH, "utf8").split(`
|
|
57402
57600
|
`)) {
|
|
57403
57601
|
const t = line.trim();
|
|
57404
57602
|
if (!t)
|
|
@@ -57497,11 +57695,11 @@ function openCount() {
|
|
|
57497
57695
|
|
|
57498
57696
|
// src/variant-scan.ts
|
|
57499
57697
|
init_scanner();
|
|
57500
|
-
import { readFileSync as
|
|
57698
|
+
import { readFileSync as readFileSync22 } from "node:fs";
|
|
57501
57699
|
|
|
57502
57700
|
// src/cross-file.ts
|
|
57503
57701
|
init_scanner();
|
|
57504
|
-
import { readFileSync as
|
|
57702
|
+
import { readFileSync as readFileSync21 } from "node:fs";
|
|
57505
57703
|
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)/;
|
|
57506
57704
|
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*\(/;
|
|
57507
57705
|
var ROLE_META_RE = /update_user_meta\s*\(\s*[^,]+,\s*['"](wp_capabilities|role|roles|capabilities|wp_user_level)['"]/;
|
|
@@ -57553,7 +57751,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
57553
57751
|
for (const file of files) {
|
|
57554
57752
|
let code;
|
|
57555
57753
|
try {
|
|
57556
|
-
code = stripComments(
|
|
57754
|
+
code = stripComments(readFileSync21(file, "utf8"));
|
|
57557
57755
|
} catch {
|
|
57558
57756
|
continue;
|
|
57559
57757
|
}
|
|
@@ -57594,7 +57792,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
57594
57792
|
for (const file of files) {
|
|
57595
57793
|
let code;
|
|
57596
57794
|
try {
|
|
57597
|
-
code = stripComments(
|
|
57795
|
+
code = stripComments(readFileSync21(file, "utf8"));
|
|
57598
57796
|
} catch {
|
|
57599
57797
|
continue;
|
|
57600
57798
|
}
|
|
@@ -57617,7 +57815,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
57617
57815
|
for (const file of files) {
|
|
57618
57816
|
let code;
|
|
57619
57817
|
try {
|
|
57620
|
-
code = stripComments(
|
|
57818
|
+
code = stripComments(readFileSync21(file, "utf8"));
|
|
57621
57819
|
} catch {
|
|
57622
57820
|
continue;
|
|
57623
57821
|
}
|
|
@@ -57732,7 +57930,7 @@ function variantScan(root, opts = {}) {
|
|
|
57732
57930
|
for (const file of files) {
|
|
57733
57931
|
let code;
|
|
57734
57932
|
try {
|
|
57735
|
-
code =
|
|
57933
|
+
code = readFileSync22(file, "utf8");
|
|
57736
57934
|
} catch {
|
|
57737
57935
|
continue;
|
|
57738
57936
|
}
|
|
@@ -58392,16 +58590,16 @@ function analyzeJwt(token, opts = {}) {
|
|
|
58392
58590
|
}
|
|
58393
58591
|
|
|
58394
58592
|
// src/enterprise-benchmark.ts
|
|
58395
|
-
import { existsSync as existsSync11, readFileSync as
|
|
58396
|
-
import { join as
|
|
58593
|
+
import { existsSync as existsSync11, readFileSync as readFileSync23, readdirSync as readdirSync6, statSync as statSync3 } from "node:fs";
|
|
58594
|
+
import { join as join20, resolve } from "node:path";
|
|
58397
58595
|
var ROOT6 = resolve(process.cwd(), "bench", "enterprise");
|
|
58398
58596
|
var ENTERPRISE_FIXTURES = [
|
|
58399
|
-
{ id: "php-laravel", dir:
|
|
58400
|
-
{ id: "js-express", dir:
|
|
58401
|
-
{ id: "py-django", dir:
|
|
58402
|
-
{ id: "java-spring", dir:
|
|
58403
|
-
{ id: "wp-batch-route", dir:
|
|
58404
|
-
{ id: "php-complex", dir:
|
|
58597
|
+
{ id: "php-laravel", dir: join20(ROOT6, "php-laravel"), expected_vulns: 4 },
|
|
58598
|
+
{ id: "js-express", dir: join20(ROOT6, "js-express"), expected_vulns: 2 },
|
|
58599
|
+
{ id: "py-django", dir: join20(ROOT6, "py-django"), expected_vulns: 2 },
|
|
58600
|
+
{ id: "java-spring", dir: join20(ROOT6, "java-spring"), expected_vulns: 2 },
|
|
58601
|
+
{ id: "wp-batch-route", dir: join20(ROOT6, "wp-batch-route"), expected_vulns: 3 },
|
|
58602
|
+
{ id: "php-complex", dir: join20(ROOT6, "php-complex"), expected_vulns: 4 }
|
|
58405
58603
|
];
|
|
58406
58604
|
function sourceFiles(root) {
|
|
58407
58605
|
const out = [];
|
|
@@ -58413,7 +58611,7 @@ function sourceFiles(root) {
|
|
|
58413
58611
|
return;
|
|
58414
58612
|
}
|
|
58415
58613
|
for (const e of entries) {
|
|
58416
|
-
const p =
|
|
58614
|
+
const p = join20(dir, e);
|
|
58417
58615
|
let st;
|
|
58418
58616
|
try {
|
|
58419
58617
|
st = statSync3(p);
|
|
@@ -58434,7 +58632,7 @@ function detectFixture(dir) {
|
|
|
58434
58632
|
for (const f of sourceFiles(dir)) {
|
|
58435
58633
|
let code;
|
|
58436
58634
|
try {
|
|
58437
|
-
code =
|
|
58635
|
+
code = readFileSync23(f, "utf8");
|
|
58438
58636
|
} catch {
|
|
58439
58637
|
continue;
|
|
58440
58638
|
}
|
|
@@ -58629,8 +58827,7 @@ function createServer() {
|
|
|
58629
58827
|
` + `- 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).
|
|
58630
58828
|
` + `- 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.
|
|
58631
58829
|
|
|
58632
|
-
` + "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" +
|
|
58633
|
-
` + "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) so a new target on a known tech inherits historical hit-rates (attack_plan already blends them into success_probability). 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. SOURCE TARGETING: 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.\n" + `PRECISION ANALYSIS — chrome-devtools MCP is MANDATORY, not optional:
|
|
58830
|
+
` + "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, and citable references, so a raw hit becomes a class-aware finding. 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. 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.\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) so a new target on a known tech inherits historical hit-rates (attack_plan already blends them into success_probability). 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. SOURCE TARGETING: 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.\n" + `PRECISION ANALYSIS — chrome-devtools MCP is MANDATORY, not optional:
|
|
58634
58831
|
` + `- 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.
|
|
58635
58832
|
` + `- 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.
|
|
58636
58833
|
` + "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."
|
|
@@ -58985,6 +59182,69 @@ ${statusLine}` : statusLine },
|
|
|
58985
59182
|
content: [{ type: "text", text: JSON.stringify(listChains()) }]
|
|
58986
59183
|
};
|
|
58987
59184
|
});
|
|
59185
|
+
server.registerTool("pattern_lookup", {
|
|
59186
|
+
title: "Empirical pattern lookup",
|
|
59187
|
+
description: "GROUNDING: return the empirical grounding for a detector type / vuln class — its CWE, its real-world signature, the escalation chains it composes into (cross-ref chains.json), and citable references. Use to turn a raw detector hit into a grounded, class-aware finding. Pass 'list' to enumerate all grounded classes.",
|
|
59188
|
+
inputSchema: {
|
|
59189
|
+
id: string2().describe("Detector/vuln class id (sql_injection, ssrf, idor-like missing_authz, …), or 'list'")
|
|
59190
|
+
}
|
|
59191
|
+
}, async ({ id }) => {
|
|
59192
|
+
if (id === "list")
|
|
59193
|
+
return { content: [{ type: "text", text: JSON.stringify(listPatterns()) }] };
|
|
59194
|
+
const p = patternLookup(id);
|
|
59195
|
+
if (!p)
|
|
59196
|
+
return { content: [{ type: "text", text: JSON.stringify({ error: `no pattern for '${id}'`, known: listPatterns().map((x) => x.id) }) }] };
|
|
59197
|
+
return { content: [{ type: "text", text: JSON.stringify(p) }] };
|
|
59198
|
+
});
|
|
59199
|
+
server.registerTool("submission_gate", {
|
|
59200
|
+
title: "Submission gate (7 questions)",
|
|
59201
|
+
description: "GATE: run the deterministic 7-question checklist on a finding before it ships. Questions: reproducible? in-scope? real impact? no privileged assumption? verified live? evidence redacted? severity derived? One false = fail (kill the finding). Pass booleans you can honestly assert true; omit/leave false any you cannot.",
|
|
59202
|
+
inputSchema: {
|
|
59203
|
+
type: string2().optional().describe("Detector/vuln class id"),
|
|
59204
|
+
severity: string2().optional().describe("Finding severity"),
|
|
59205
|
+
reproducible: boolean2().optional().describe("Exact request/step list is copy-paste ready"),
|
|
59206
|
+
in_scope: boolean2().optional().describe("Vulnerable asset is in engagement scope"),
|
|
59207
|
+
real_impact: boolean2().optional().describe("Maps to an accepted-impact class"),
|
|
59208
|
+
no_privileged_assumption: boolean2().optional().describe("Works without unrealistic prerequisites"),
|
|
59209
|
+
verified_live: boolean2().optional().describe("Confirmed with marker + negative control"),
|
|
59210
|
+
evidence_redacted: boolean2().optional().describe("Evidence attached, secrets/PII redacted"),
|
|
59211
|
+
severity_derived: boolean2().optional().describe("Severity derived via CVSS/confidence")
|
|
59212
|
+
}
|
|
59213
|
+
}, async (args) => {
|
|
59214
|
+
return { content: [{ type: "text", text: JSON.stringify(submissionGate(args)) }] };
|
|
59215
|
+
});
|
|
59216
|
+
server.registerTool("severity_calibrate", {
|
|
59217
|
+
title: "Severity calibration (VRT-style)",
|
|
59218
|
+
description: "SEVERITY: calibrate a finding to a platform-neutral priority tier (P1–P5) + a VRT-style category, so it is reported at the severity a triager would assign. Maps a detector type (sql_injection, ssrf, ssti, …) to its category + rationale; pass a CVSS score to cross-reference, or 'list' to enumerate every calibrated class.",
|
|
59219
|
+
inputSchema: {
|
|
59220
|
+
type: string2().optional().describe("Detector/vuln class id, or 'list'"),
|
|
59221
|
+
severity: string2().optional().describe("Detector-reported severity (informational for reference)"),
|
|
59222
|
+
cvss: number2().min(0).max(10).optional().describe("CVSS base score (0–10) to cross-reference"),
|
|
59223
|
+
informational: boolean2().optional().describe("True if the finding is informational-only")
|
|
59224
|
+
}
|
|
59225
|
+
}, async ({ type, severity, cvss, informational }) => {
|
|
59226
|
+
if (type === "list")
|
|
59227
|
+
return { content: [{ type: "text", text: JSON.stringify(listSeverityMap()) }] };
|
|
59228
|
+
return { content: [{ type: "text", text: JSON.stringify(severityCalibrate({ type, severity, cvss, informational })) }] };
|
|
59229
|
+
});
|
|
59230
|
+
server.registerTool("engagement_scaffold", {
|
|
59231
|
+
title: "Engagement scaffold",
|
|
59232
|
+
description: "SCAFFOLD: open an engagement and emit a deterministic folder layout (scope.md, findings/, evidence/, reports/, notes/) + a pre-filled scope.md template. Returns the engagement id + initial state so the hunt starts with structure, not improvisation.",
|
|
59233
|
+
inputSchema: {
|
|
59234
|
+
target: string2().describe("The in-scope target (domain/URL/program)"),
|
|
59235
|
+
scope: array(string2()).optional().describe("In-scope assets/domains"),
|
|
59236
|
+
out_of_scope: array(string2()).optional().describe("Out-of-scope assets")
|
|
59237
|
+
}
|
|
59238
|
+
}, async ({ target, scope, out_of_scope }) => {
|
|
59239
|
+
return { content: [{ type: "text", text: JSON.stringify(scaffoldEngagement(target, scope ?? [], out_of_scope ?? [])) }] };
|
|
59240
|
+
});
|
|
59241
|
+
server.registerTool("data_refresh", {
|
|
59242
|
+
title: "Data-layer health check",
|
|
59243
|
+
description: "HEALTH: re-load every data layer (chains, patterns, CWE map) and verify cross-references — a pattern pointing at a missing chain, or a detector without a CWE mapping. Returns counts + any broken reference, so stale data is surfaced instead of silently producing bad grounding.",
|
|
59244
|
+
inputSchema: {}
|
|
59245
|
+
}, async () => {
|
|
59246
|
+
return { content: [{ type: "text", text: JSON.stringify(dataRefresh()) }] };
|
|
59247
|
+
});
|
|
58988
59248
|
server.registerTool("fofa_search", {
|
|
58989
59249
|
title: "FOFA asset search",
|
|
58990
59250
|
description: "STRIKE: search the FOFA asset index (needs FOFA_EMAIL + FOFA_KEY).",
|
|
@@ -59369,7 +59629,7 @@ ${statusLine}` : statusLine },
|
|
|
59369
59629
|
let src = code;
|
|
59370
59630
|
if (!src && path) {
|
|
59371
59631
|
try {
|
|
59372
|
-
src =
|
|
59632
|
+
src = readFileSync25(path, "utf8");
|
|
59373
59633
|
} catch {
|
|
59374
59634
|
return { content: [{ type: "text", text: JSON.stringify({ error: "unreadable path" }) }] };
|
|
59375
59635
|
}
|
|
@@ -59987,7 +60247,7 @@ ${statusLine}` : statusLine },
|
|
|
59987
60247
|
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.",
|
|
59988
60248
|
inputSchema: { path: string2().describe("Source file path (PHP)") }
|
|
59989
60249
|
}, async ({ path }) => {
|
|
59990
|
-
const code =
|
|
60250
|
+
const code = readFileSync25(path, "utf8");
|
|
59991
60251
|
const findings = detectRouteConfusion(code, path);
|
|
59992
60252
|
return {
|
|
59993
60253
|
content: [{
|
|
@@ -60001,7 +60261,7 @@ ${statusLine}` : statusLine },
|
|
|
60001
60261
|
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), and missing authorization/nonce on WordPress entry points (wp_ajax_* / admin_post_* / register_rest_route without current_user_can, nonce verification, or permission_callback).",
|
|
60002
60262
|
inputSchema: { path: string2().describe("Source file path") }
|
|
60003
60263
|
}, async ({ path }) => {
|
|
60004
|
-
const code =
|
|
60264
|
+
const code = readFileSync25(path, "utf8");
|
|
60005
60265
|
const findings = detectComplexBugs(code, path);
|
|
60006
60266
|
return {
|
|
60007
60267
|
content: [{
|
|
@@ -60087,7 +60347,7 @@ ${statusLine}` : statusLine },
|
|
|
60087
60347
|
let lang = language;
|
|
60088
60348
|
if (path && !code) {
|
|
60089
60349
|
try {
|
|
60090
|
-
src =
|
|
60350
|
+
src = readFileSync25(path, "utf8");
|
|
60091
60351
|
} catch {
|
|
60092
60352
|
return { content: [{ type: "text", text: JSON.stringify({ error: `cannot read ${path}` }) }] };
|
|
60093
60353
|
}
|
|
@@ -60328,15 +60588,15 @@ async function serve() {
|
|
|
60328
60588
|
|
|
60329
60589
|
// src/index.ts
|
|
60330
60590
|
init_cli();
|
|
60331
|
-
import { readFileSync as
|
|
60332
|
-
import { join as
|
|
60333
|
-
import { fileURLToPath as
|
|
60334
|
-
var ROOT11 =
|
|
60591
|
+
import { readFileSync as readFileSync29, existsSync as existsSync14 } from "node:fs";
|
|
60592
|
+
import { join as join25 } from "node:path";
|
|
60593
|
+
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
60594
|
+
var ROOT11 = join25(fileURLToPath15(new URL(".", import.meta.url)), "..");
|
|
60335
60595
|
function readVersion() {
|
|
60336
60596
|
try {
|
|
60337
|
-
const p =
|
|
60597
|
+
const p = join25(ROOT11, "package.json");
|
|
60338
60598
|
if (existsSync14(p))
|
|
60339
|
-
return JSON.parse(
|
|
60599
|
+
return JSON.parse(readFileSync29(p, "utf8")).version ?? "1.0.0";
|
|
60340
60600
|
} catch {}
|
|
60341
60601
|
return "1.0.0";
|
|
60342
60602
|
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "blitzstrike-patterns-v1",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"_comment": "Empirical grounding layer. Every detector type is traced to its real-world bug class (CWE), its real-world signature, the chains it composes into (cross-ref chains.json), and a citable reference. Detection is derived from this data, never hardcoded. References are public standards (CWE/OWASP) and disclosed-report classes — no vendor/product framing.",
|
|
5
|
+
"patterns": [
|
|
6
|
+
{
|
|
7
|
+
"id": "sql_injection",
|
|
8
|
+
"name": "SQL Injection",
|
|
9
|
+
"cwe": "CWE-89",
|
|
10
|
+
"real_world": "User input is interpolated into a SQL query by string concatenation instead of parameterization. The single most-reported web class; real disclosures range from boolean/UNION extraction to stacked queries for admin takeover.",
|
|
11
|
+
"detection_signatures": ["raw string-interpolated query into a SQL sink", "no prepare()/parameterization", "cross-file: concatenated variable with no visible source"],
|
|
12
|
+
"chain_templates": ["sqli_to_rce", "sqli_to_hash_dump_and_crack", "sql_injection_to_rce", "second_order_sqli"],
|
|
13
|
+
"references": ["CWE-89", "OWASP A03:2021 Injection"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "ssrf",
|
|
17
|
+
"name": "Server-Side Request Forgery",
|
|
18
|
+
"cwe": "CWE-918",
|
|
19
|
+
"real_world": "A server fetches an attacker-supplied URL with no host allowlist, letting it reach cloud metadata endpoints, internal services, or the loopback interface.",
|
|
20
|
+
"detection_signatures": ["server-side fetch of a request-controlled URL", "no host/allowlist validation"],
|
|
21
|
+
"chain_templates": ["ssrf_cloud_metadata", "ssrf_to_redis_rce", "blind_ssrf_to_oob_exfil"],
|
|
22
|
+
"references": ["CWE-918", "OWASP A10:2021 SSRF"]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "ssti",
|
|
26
|
+
"name": "Server-Side Template Injection",
|
|
27
|
+
"cwe": "CWE-1336",
|
|
28
|
+
"real_world": "User input reaches a template engine (Jinja2, Twig, Freemarker, ERB, …) that evaluates expressions, yielding code execution via template syntax like {{7*7}}.",
|
|
29
|
+
"detection_signatures": ["template render of request input", "expression evaluation in a template engine"],
|
|
30
|
+
"chain_templates": ["ssti_template_injection_rce", "ssti_to_full_rce"],
|
|
31
|
+
"references": ["CWE-1336", "OWASP A03:2021 Injection"]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "xxe",
|
|
35
|
+
"name": "XML External Entity Injection",
|
|
36
|
+
"cwe": "CWE-611",
|
|
37
|
+
"real_world": "An XML parser resolves external entities, letting an attacker read local files or hit internal URLs via DOCTYPE entity definitions.",
|
|
38
|
+
"detection_signatures": ["XML parse without disabling external entities", "DOCTYPE/ENTITY processing"],
|
|
39
|
+
"chain_templates": ["xxe_to_ssrf_and_file_read"],
|
|
40
|
+
"references": ["CWE-611", "OWASP A03:2021 Injection"]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "deserialization",
|
|
44
|
+
"name": "Insecure Deserialization",
|
|
45
|
+
"cwe": "CWE-502",
|
|
46
|
+
"real_world": "Attacker-controlled serialized data is deserialized and escalated through a magic-method gadget chain (__destruct/__wakeup/__toString) into code execution or object injection.",
|
|
47
|
+
"detection_signatures": ["unserialize()/pickle.loads/yaml.load of request data", "a magic-method gadget in scope"],
|
|
48
|
+
"chain_templates": ["deserialization_pop_chain", "deserialization_to_rce", "appkey_leak_deserialization_rce"],
|
|
49
|
+
"references": ["CWE-502", "OWASP A08:2021 Software and Data Integrity Failures"]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "type_juggling",
|
|
53
|
+
"name": "PHP Type Juggling (Loose Comparison)",
|
|
54
|
+
"cwe": "CWE-697",
|
|
55
|
+
"real_world": "A loose comparison (==) between user input and a hash/secret collapses via the 0e magic-hash or numeric-string coercion, bypassing authentication.",
|
|
56
|
+
"detection_signatures": ["loose comparison == of user input against a secret/hash", "0e-prefixed or numeric-string coercion"],
|
|
57
|
+
"chain_templates": ["php_type_juggling_auth_bypass"],
|
|
58
|
+
"references": ["CWE-697", "OWASP A07:2021 Identification and Authentication Failures"]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "mass_assignment",
|
|
62
|
+
"name": "Mass Assignment",
|
|
63
|
+
"cwe": "CWE-915",
|
|
64
|
+
"real_world": "Request data is bound to model fields without an allowlist (extract()/parse_str/framework mass-assign), letting an attacker set privileged fields like role or is_admin.",
|
|
65
|
+
"detection_signatures": ["extract()/parse_str of request data without a safe flag", "model binding without an allowlist"],
|
|
66
|
+
"chain_templates": ["mass_assignment_to_admin_takeover", "extract_variable_injection_lfi"],
|
|
67
|
+
"references": ["CWE-915", "OWASP API6:2023 Unrestricted Access to Sensitive Business Flows"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "prototype_pollution",
|
|
71
|
+
"name": "Prototype Pollution",
|
|
72
|
+
"cwe": "CWE-1321",
|
|
73
|
+
"real_world": "A deep merge of request data into an object pollutes Object.prototype, corrupting logic and escalating to code execution in gadget-heavy runtimes.",
|
|
74
|
+
"detection_signatures": ["deep merge/extend of request data into objects", "__proto__ / constructor.prototype assignment"],
|
|
75
|
+
"chain_templates": ["prototype_pollution_to_rce"],
|
|
76
|
+
"references": ["CWE-1321"]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "crlf_injection",
|
|
80
|
+
"name": "CRLF Injection / Header Injection",
|
|
81
|
+
"cwe": "CWE-93",
|
|
82
|
+
"real_world": "Request-controlled newlines are written into an HTTP header, enabling response splitting, cookie injection, or cache poisoning.",
|
|
83
|
+
"detection_signatures": ["request input reaches a header without CR/LF stripping"],
|
|
84
|
+
"chain_templates": ["cache_poisoning_xss", "cache_poison_to_stored_xss"],
|
|
85
|
+
"references": ["CWE-93", "OWASP A03:2021 Injection"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "path_confusion",
|
|
89
|
+
"name": "Path Traversal / Path Confusion",
|
|
90
|
+
"cwe": "CWE-22",
|
|
91
|
+
"real_world": "A request-controlled path is normalized or resolved without confinement (../, %2e%2e, absolute paths), reading or writing files outside the intended directory.",
|
|
92
|
+
"detection_signatures": ["request input reaches a file path without confinement"],
|
|
93
|
+
"chain_templates": ["path_traversal_file_write", "path_traversal_to_credential_theft", "lfi_log_poison_rce", "lfi_to_rce_via_log_poisoning"],
|
|
94
|
+
"references": ["CWE-22", "OWASP A01:2021 Broken Access Control"]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "wrong_sanitizer",
|
|
98
|
+
"name": "Wrong-Context Sanitization",
|
|
99
|
+
"cwe": "CWE-20",
|
|
100
|
+
"real_world": "A value is sanitized for one context (e.g. HTML) but reaches a sink that needs a different context (e.g. SQL), so the sanitizer provides no real protection.",
|
|
101
|
+
"detection_signatures": ["a sanitizer/validator for context X feeding a sink that requires context Y"],
|
|
102
|
+
"chain_templates": ["second_order_sqli"],
|
|
103
|
+
"references": ["CWE-20", "OWASP A03:2021 Injection"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "missing_authz",
|
|
107
|
+
"name": "Missing Authorization (Broken Access Control)",
|
|
108
|
+
"cwe": "CWE-862",
|
|
109
|
+
"real_world": "A state-changing handler lacks a capability/ownership check, letting an unauthenticated or low-privilege caller perform an admin action.",
|
|
110
|
+
"detection_signatures": ["state-changing operation with no current_user_can/is_user_logged_in check"],
|
|
111
|
+
"chain_templates": ["idor_to_admin_takeover", "mass_assignment_to_admin_takeover", "idor_object_reference"],
|
|
112
|
+
"references": ["CWE-862", "OWASP A01:2021 Broken Access Control"]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "missing_nonce",
|
|
116
|
+
"name": "Missing Nonce (CSRF)",
|
|
117
|
+
"cwe": "CWE-352",
|
|
118
|
+
"real_world": "A state-changing action lacks an anti-CSRF token, letting a victim's browser perform the action on their behalf via a forged request.",
|
|
119
|
+
"detection_signatures": ["state-changing operation with no nonce/referer verification"],
|
|
120
|
+
"chain_templates": ["nonce_harvest_auth_bypass"],
|
|
121
|
+
"references": ["CWE-352", "OWASP A01:2021 Broken Access Control"]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "file_upload",
|
|
125
|
+
"name": "Unrestricted File Upload",
|
|
126
|
+
"cwe": "CWE-434",
|
|
127
|
+
"real_world": "A file is uploaded with an attacker-controlled name/extension and no server-side filetype whitelist, landing web-reachable for code execution.",
|
|
128
|
+
"detection_signatures": ["move_uploaded_file/wp_upload_bits with attacker-controlled name", "no extension/mime whitelist", "uploadAllow=all connector config"],
|
|
129
|
+
"chain_templates": ["upload_polyglot_rce", "file_upload_to_rce", "split_controller_upload_bypass"],
|
|
130
|
+
"references": ["CWE-434", "OWASP A04:2021 Insecure Design"]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "priv_esc",
|
|
134
|
+
"name": "Privilege Escalation",
|
|
135
|
+
"cwe": "CWE-269",
|
|
136
|
+
"real_world": "A role/capability/user change is fed by request input and reachable from a public entry point with no capability check, letting a user self-assign admin.",
|
|
137
|
+
"detection_signatures": ["set_role/add_role/add_cap of request input", "cross-file: sink reachable from public hook with no capability check"],
|
|
138
|
+
"chain_templates": ["mass_assignment_to_admin_takeover", "idor_to_admin_takeover"],
|
|
139
|
+
"references": ["CWE-269", "OWASP A01:2021 Broken Access Control"]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "hardcoded_secret",
|
|
143
|
+
"name": "Hardcoded Credentials",
|
|
144
|
+
"cwe": "CWE-798",
|
|
145
|
+
"real_world": "A secret (API key, database password, access token, private key) is committed in source, exposing it to anyone with repo access. Real disclosures regularly turn a leaked key into account takeover or cloud compromise.",
|
|
146
|
+
"detection_signatures": ["secret field assigned a literal", "known secret format (JWT/AWS/GitHub/Slack/…) in source", "high-entropy token under a non-obvious name"],
|
|
147
|
+
"chain_templates": ["api_key_leak_to_account_takeover", "appkey_leak_deserialization_rce", "default_creds_to_internal_pivot"],
|
|
148
|
+
"references": ["CWE-798", "OWASP A02:2021 Cryptographic Failures"]
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blitzstrike",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.59",
|
|
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": {
|