blitzstrike 2.4.39 → 2.4.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ 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.40] — 2026-09-14
9
+
10
+ ### Added — Web Cache Key Normalization Gap Fuzzer (live, black-box)
11
+
12
+ - New `src/cache-gap.ts`: fuzz an endpoint's path-normalization + static-
13
+ extension variants (`.css`, `..;/`, `%2f`, `%00`, `;`, case, …) to detect
14
+ web-cache deception / poisoning — where a cache keys on a static-looking path
15
+ but the origin serves private content.
16
+ - New `cache_gap` tool: fetch a baseline, compare body hash + cache headers per
17
+ variant, and flag only evidence-backed gaps (cache_deception / normalization_gap).
18
+ - Pure helpers `generateCacheVariants` + `classifyCacheResponse` for deterministic,
19
+ testable detection logic.
20
+
8
21
  ## [2.4.39] — 2026-09-14
9
22
 
10
23
  ### Added — Patch Reversal (1-day weaponization engine)
package/dist/index.js CHANGED
@@ -57367,6 +57367,145 @@ function functionBody2(code, name) {
57367
57367
  return code.slice(open);
57368
57368
  }
57369
57369
 
57370
+ // src/cache-gap.ts
57371
+ function generateCacheVariants(endpoint) {
57372
+ const e = endpoint.startsWith("/") ? endpoint : "/" + endpoint;
57373
+ const variants = new Set;
57374
+ const add = (s) => variants.add(s);
57375
+ const exts = [".css", ".js", ".png", ".jpg", ".jpeg", ".json", ".txt", ".ico", ".html", ".svg", ".woff", ".xml", ".gif"];
57376
+ for (const ext of exts) {
57377
+ add(`${e}${ext}`);
57378
+ add(`${e}/${ext.slice(1)}`);
57379
+ add(`${e}${ext}?x=1`);
57380
+ add(`${e}${ext};`);
57381
+ add(`${e}${ext}%3b`);
57382
+ }
57383
+ const suffix = [
57384
+ "/style.css",
57385
+ "/..;/style.css",
57386
+ "/.;/style.css",
57387
+ "/../style.css",
57388
+ "/%2e%2e/style.css",
57389
+ "/%2fstyle.css",
57390
+ "/;style.css",
57391
+ "/%3bstyle.css",
57392
+ "/./style.css",
57393
+ "//style.css",
57394
+ "/%00.style.css",
57395
+ "/style.css/.",
57396
+ "/style.css%2f",
57397
+ "/style.css%00",
57398
+ "/style.css%2e%2e"
57399
+ ];
57400
+ for (const s of suffix)
57401
+ add(`${e}${s}`);
57402
+ add(e.replace(/^\//, "/%2f"));
57403
+ add(e.replace(/^\//, "//"));
57404
+ add(e.replace(/^\//, "/./"));
57405
+ add(e.replace(/^\//, "/%2e/"));
57406
+ add(e.replace(/^\//, "/..;/"));
57407
+ add(`${e}%00`);
57408
+ add(`${e};`);
57409
+ add(`${e}%3b`);
57410
+ add(`${e}?`);
57411
+ add(`${e}?x=1`);
57412
+ add(`${e}#`);
57413
+ add(e.toUpperCase());
57414
+ return [...variants].filter((v) => v !== e);
57415
+ }
57416
+ function classifyCacheResponse(input) {
57417
+ const same = input.bodyHash === input.baselineHash;
57418
+ const lower = Object.fromEntries(Object.entries(input.headers).map(([k, v]) => [k.toLowerCase(), v]));
57419
+ const cacheStatus = lower["x-cache"] ?? lower["cf-cache-status"] ?? lower["x-served-by"] ?? lower["x-cache-status"] ?? null;
57420
+ const cacheControl = lower["cache-control"] ?? "";
57421
+ const age = lower["age"];
57422
+ const cacheable = /public|max-age|s-maxage/.test(cacheControl) || age !== undefined || cacheStatus !== null && /hit/i.test(cacheStatus) || input.staticExtension;
57423
+ if (same && input.staticExtension && cacheable) {
57424
+ return {
57425
+ same_body: true,
57426
+ cacheable,
57427
+ cache_status: cacheStatus,
57428
+ gap: "cache_deception",
57429
+ detail: "the endpoint's content is returned for a static-extension path that is cacheable — a cache may store PRIVATE content under a PUBLIC static key (cache deception)."
57430
+ };
57431
+ }
57432
+ if (same && cacheStatus !== null && /hit/i.test(cacheStatus)) {
57433
+ return {
57434
+ same_body: true,
57435
+ cacheable,
57436
+ cache_status: cacheStatus,
57437
+ gap: "cache_deception",
57438
+ detail: `the endpoint's content is served from cache (${cacheStatus}) — the response is being cached and shared.`
57439
+ };
57440
+ }
57441
+ if (!same && input.staticExtension && input.status !== 200) {
57442
+ return {
57443
+ same_body: false,
57444
+ cacheable,
57445
+ cache_status: cacheStatus,
57446
+ gap: "normalization_gap",
57447
+ detail: "the static-extension variant resolves differently than the baseline (origin normalized the path) — cache key may diverge from the origin resource (normalization gap)."
57448
+ };
57449
+ }
57450
+ return { same_body: same, cacheable, cache_status: cacheStatus, gap: null, detail: "" };
57451
+ }
57452
+ function headersToRecord(h) {
57453
+ const out = {};
57454
+ h.forEach((v, k) => {
57455
+ out[k.toLowerCase()] = v;
57456
+ });
57457
+ return out;
57458
+ }
57459
+ function pickCacheHeaders(h) {
57460
+ const keys = ["cache-control", "age", "expires", "x-cache", "cf-cache-status", "x-served-by", "x-cache-status", "via", "etag", "last-modified", "vary"];
57461
+ const out = {};
57462
+ for (const k of keys)
57463
+ if (h[k] !== undefined)
57464
+ out[k] = h[k];
57465
+ return out;
57466
+ }
57467
+ async function cacheGapScan(baseUrl, endpoint, opts = {}) {
57468
+ const base = baseUrl.replace(/\/+$/, "");
57469
+ const endpointPath = endpoint.startsWith("/") ? endpoint : "/" + endpoint;
57470
+ const variants = generateCacheVariants(endpointPath).slice(0, opts.maxVariants ?? 60);
57471
+ const headers = { "User-Agent": "Mozilla/5.0 (blitzstrike cache probe)", Accept: "*/*" };
57472
+ let baselineHash = "";
57473
+ let baselineStatus = 0;
57474
+ let baselineHeaders = {};
57475
+ try {
57476
+ const resp = await fetch(base + endpointPath, { headers, redirect: "manual", signal: AbortSignal.timeout(opts.timeoutMs ?? 8000) });
57477
+ baselineStatus = resp.status;
57478
+ baselineHeaders = headersToRecord(resp.headers);
57479
+ baselineHash = sha256(await resp.text());
57480
+ } catch (e) {
57481
+ return { error: "baseline fetch failed", base_url: base, endpoint: endpointPath, detail: String(e) };
57482
+ }
57483
+ const results = [];
57484
+ for (const v of variants) {
57485
+ try {
57486
+ const resp = await fetch(base + v, { headers, redirect: "manual", signal: AbortSignal.timeout(opts.timeoutMs ?? 8000) });
57487
+ const status = resp.status;
57488
+ const hdrs = headersToRecord(resp.headers);
57489
+ const bodyHash = sha256(await resp.text());
57490
+ const staticExtension = /\.(css|js|png|jpe?g|json|txt|ico|html|svg|woff|xml|gif)([;?].*)?$/i.test(v);
57491
+ const cls = classifyCacheResponse({ baselineHash, bodyHash, status, headers: hdrs, staticExtension });
57492
+ results.push({ path: v, status, same_body: cls.same_body, cacheable: cls.cacheable, cache_status: cls.cache_status, gap: cls.gap, detail: cls.detail });
57493
+ } catch {
57494
+ results.push({ path: v, status: 0, same_body: false, cacheable: false, cache_status: null, gap: null, detail: "fetch error/timeout" });
57495
+ }
57496
+ }
57497
+ const gaps = results.filter((r) => r.gap !== null);
57498
+ return {
57499
+ base_url: base,
57500
+ endpoint: endpointPath,
57501
+ baseline: { status: baselineStatus, body_hash: baselineHash.slice(0, 16), cache_headers: pickCacheHeaders(baselineHeaders) },
57502
+ variants_tested: results.length,
57503
+ gaps_found: gaps.length,
57504
+ gaps,
57505
+ all: results
57506
+ };
57507
+ }
57508
+
57370
57509
  // src/enterprise-benchmark.ts
57371
57510
  import { existsSync as existsSync11, readFileSync as readFileSync20, readdirSync as readdirSync6, statSync as statSync3 } from "node:fs";
57372
57511
  import { join as join18, resolve } from "node:path";
@@ -58355,6 +58494,17 @@ ${statusLine}` : statusLine },
58355
58494
  return { content: [{ type: "text", text: JSON.stringify({ error: "provide code or path" }) }] };
58356
58495
  return { content: [{ type: "text", text: JSON.stringify(actionSurface(src)) }] };
58357
58496
  });
58497
+ server.registerTool("cache_gap", {
58498
+ title: "Web cache key normalization gap fuzzer",
58499
+ description: "LIVE (black-box, no source code): fuzz an endpoint's path-normalization + static-extension variants to detect web-cache deception / poisoning — where a cache keys on a static-looking path but the origin serves private content. Deterministic + evidence-first: fetch a baseline, then compare body hash + cache headers per variant. High-impact class (cached private data, mass takeover) that is still under-hunted.",
58500
+ inputSchema: {
58501
+ base_url: string2().describe("Target base URL (e.g. https://target.com)"),
58502
+ endpoint: string2().describe("Endpoint path to probe (e.g. /account or /profile)"),
58503
+ max_variants: number2().optional().describe("Max variants to test (default 60)")
58504
+ }
58505
+ }, async ({ base_url, endpoint, max_variants }) => {
58506
+ return { content: [{ type: "text", text: JSON.stringify(await cacheGapScan(base_url, endpoint, { maxVariants: max_variants })) }] };
58507
+ });
58358
58508
  server.registerTool("payload_lookup", {
58359
58509
  title: "Look up exploit payloads",
58360
58510
  description: "INTEL: find a payload collection (66 categories from PayloadsAllTheThings).",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blitzstrike",
3
- "version": "2.4.39",
3
+ "version": "2.4.40",
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": {