bla-agents 1.1.0 → 1.6.0
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/.agents/skills/blind-llm-agents/SKILL.md +20 -14
- package/DISCLAIMER.md +15 -7
- package/README.md +153 -198
- package/dist/bundler/index.d.ts +19 -2
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +47 -4
- package/dist/bundler/index.js.map +1 -1
- package/dist/cli.d.ts +5 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +123 -18
- package/dist/cli.js.map +1 -1
- package/dist/core/config.d.ts +54 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +160 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/coverage-contract.d.ts +97 -0
- package/dist/core/coverage-contract.d.ts.map +1 -0
- package/dist/core/coverage-contract.js +164 -0
- package/dist/core/coverage-contract.js.map +1 -0
- package/dist/core/debug-posture.d.ts +40 -0
- package/dist/core/debug-posture.d.ts.map +1 -0
- package/dist/core/debug-posture.js +197 -0
- package/dist/core/debug-posture.js.map +1 -0
- package/dist/core/detector.d.ts.map +1 -1
- package/dist/core/detector.js +58 -6
- package/dist/core/detector.js.map +1 -1
- package/dist/core/identifiers.d.ts +32 -0
- package/dist/core/identifiers.d.ts.map +1 -0
- package/dist/core/identifiers.js +263 -0
- package/dist/core/identifiers.js.map +1 -0
- package/dist/core/llm-directives.d.ts +12 -0
- package/dist/core/llm-directives.d.ts.map +1 -0
- package/dist/core/llm-directives.js +23 -0
- package/dist/core/llm-directives.js.map +1 -0
- package/dist/core/prng.d.ts +10 -1
- package/dist/core/prng.d.ts.map +1 -1
- package/dist/core/prng.js +27 -2
- package/dist/core/prng.js.map +1 -1
- package/dist/core/release-exposure.d.ts.map +1 -1
- package/dist/core/release-exposure.js +13 -2
- package/dist/core/release-exposure.js.map +1 -1
- package/dist/core/release-plan.d.ts +68 -0
- package/dist/core/release-plan.d.ts.map +1 -0
- package/dist/core/release-plan.js +244 -0
- package/dist/core/release-plan.js.map +1 -0
- package/dist/core/sarif.d.ts +53 -0
- package/dist/core/sarif.d.ts.map +1 -0
- package/dist/core/sarif.js +95 -0
- package/dist/core/sarif.js.map +1 -0
- package/dist/core/sqlite-runtime.d.ts +13 -0
- package/dist/core/sqlite-runtime.d.ts.map +1 -1
- package/dist/core/sqlite-runtime.js +38 -8
- package/dist/core/sqlite-runtime.js.map +1 -1
- package/dist/core/types.d.ts +7 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/engine/auditor.d.ts.map +1 -1
- package/dist/engine/auditor.js +380 -19
- package/dist/engine/auditor.js.map +1 -1
- package/dist/engine/benchmark.d.ts +1 -1
- package/dist/engine/benchmark.d.ts.map +1 -1
- package/dist/engine/benchmark.js +121 -41
- package/dist/engine/benchmark.js.map +1 -1
- package/dist/engine/defender.d.ts +1 -0
- package/dist/engine/defender.d.ts.map +1 -1
- package/dist/engine/defender.js +7 -1
- package/dist/engine/defender.js.map +1 -1
- package/dist/engine/harden.d.ts +61 -0
- package/dist/engine/harden.d.ts.map +1 -0
- package/dist/engine/harden.js +294 -0
- package/dist/engine/harden.js.map +1 -0
- package/dist/engine/protector.d.ts.map +1 -1
- package/dist/engine/protector.js +242 -26
- package/dist/engine/protector.js.map +1 -1
- package/dist/identity.d.ts +112 -2
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +112 -2
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +26 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +59 -152
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +466 -50
- package/dist/mcp/server.js.map +1 -1
- package/dist/setup/clients.d.ts +49 -1
- package/dist/setup/clients.d.ts.map +1 -1
- package/dist/setup/clients.js +1193 -20
- package/dist/setup/clients.js.map +1 -1
- package/dist/setup/doctor.d.ts +58 -14
- package/dist/setup/doctor.d.ts.map +1 -1
- package/dist/setup/doctor.js +316 -22
- package/dist/setup/doctor.js.map +1 -1
- package/dist/setup/setup.d.ts +77 -7
- package/dist/setup/setup.d.ts.map +1 -1
- package/dist/setup/setup.js +591 -62
- package/dist/setup/setup.js.map +1 -1
- package/dist/shields/chaff/chaff-generator.d.ts.map +1 -1
- package/dist/shields/chaff/chaff-generator.js +12 -3
- package/dist/shields/chaff/chaff-generator.js.map +1 -1
- package/dist/shields/deception/architecture-mirage.js +1 -1
- package/dist/shields/deception/architecture-mirage.js.map +1 -1
- package/dist/shields/deception/canary-honeypot.d.ts +33 -0
- package/dist/shields/deception/canary-honeypot.d.ts.map +1 -0
- package/dist/shields/deception/canary-honeypot.js +95 -0
- package/dist/shields/deception/canary-honeypot.js.map +1 -0
- package/dist/shields/deception/cognitive-armor-trigger.d.ts +43 -0
- package/dist/shields/deception/cognitive-armor-trigger.d.ts.map +1 -0
- package/dist/shields/deception/cognitive-armor-trigger.js +204 -0
- package/dist/shields/deception/cognitive-armor-trigger.js.map +1 -0
- package/dist/shields/deception/crash-trace-decoy.js +1 -1
- package/dist/shields/deception/crash-trace-decoy.js.map +1 -1
- package/dist/shields/deception/decompiler-illusion.js +1 -1
- package/dist/shields/deception/decompiler-illusion.js.map +1 -1
- package/dist/shields/deception/diff-noise-injector.js +1 -1
- package/dist/shields/deception/diff-noise-injector.js.map +1 -1
- package/dist/shields/deception/evidence-contract-poison.js +5 -5
- package/dist/shields/deception/evidence-contract-poison.js.map +1 -1
- package/dist/shields/deception/format-payloads.d.ts +21 -0
- package/dist/shields/deception/format-payloads.d.ts.map +1 -0
- package/dist/shields/deception/format-payloads.js +24 -0
- package/dist/shields/deception/format-payloads.js.map +1 -0
- package/dist/shields/deception/index.d.ts +10 -2
- package/dist/shields/deception/index.d.ts.map +1 -1
- package/dist/shields/deception/index.js +20 -3
- package/dist/shields/deception/index.js.map +1 -1
- package/dist/shields/deception/prompt-completion-poison.d.ts +3 -2
- package/dist/shields/deception/prompt-completion-poison.d.ts.map +1 -1
- package/dist/shields/deception/prompt-completion-poison.js +6 -3
- package/dist/shields/deception/prompt-completion-poison.js.map +1 -1
- package/dist/shields/deception/shadow-business-logic.js +4 -4
- package/dist/shields/deception/shadow-business-logic.js.map +1 -1
- package/dist/shields/deception/system-diagnostic-decoy.d.ts +36 -0
- package/dist/shields/deception/system-diagnostic-decoy.d.ts.map +1 -0
- package/dist/shields/deception/system-diagnostic-decoy.js +101 -0
- package/dist/shields/deception/system-diagnostic-decoy.js.map +1 -0
- package/dist/shields/exhaustion/asar-header-amplifier.d.ts +12 -3
- package/dist/shields/exhaustion/asar-header-amplifier.d.ts.map +1 -1
- package/dist/shields/exhaustion/asar-header-amplifier.js +30 -8
- package/dist/shields/exhaustion/asar-header-amplifier.js.map +1 -1
- package/dist/shields/exhaustion/bpe-token-amplifier.js +2 -2
- package/dist/shields/exhaustion/bpe-token-amplifier.js.map +1 -1
- package/dist/shields/exhaustion/callgraph-labyrinth.js +2 -2
- package/dist/shields/exhaustion/callgraph-labyrinth.js.map +1 -1
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.js +1 -1
- package/dist/shields/exhaustion/cdp-shape-budget-breaker.js.map +1 -1
- package/dist/shields/exhaustion/frida-capture-saturation.d.ts +10 -5
- package/dist/shields/exhaustion/frida-capture-saturation.d.ts.map +1 -1
- package/dist/shields/exhaustion/frida-capture-saturation.js +21 -8
- package/dist/shields/exhaustion/frida-capture-saturation.js.map +1 -1
- package/dist/shields/exhaustion/index.d.ts +2 -2
- package/dist/shields/exhaustion/index.d.ts.map +1 -1
- package/dist/shields/exhaustion/index.js +2 -2
- package/dist/shields/exhaustion/index.js.map +1 -1
- package/dist/shields/exhaustion/obligation-flooder.d.ts +23 -6
- package/dist/shields/exhaustion/obligation-flooder.d.ts.map +1 -1
- package/dist/shields/exhaustion/obligation-flooder.js +29 -12
- package/dist/shields/exhaustion/obligation-flooder.js.map +1 -1
- package/dist/shields/exhaustion/rea-budget-matrix.d.ts +8 -2
- package/dist/shields/exhaustion/rea-budget-matrix.d.ts.map +1 -1
- package/dist/shields/exhaustion/rea-budget-matrix.js +139 -16
- package/dist/shields/exhaustion/rea-budget-matrix.js.map +1 -1
- package/dist/shields/exhaustion/regex-worker-tarpit.d.ts.map +1 -1
- package/dist/shields/exhaustion/regex-worker-tarpit.js +2 -1
- package/dist/shields/exhaustion/regex-worker-tarpit.js.map +1 -1
- package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts +7 -4
- package/dist/shields/exhaustion/wasm-interface-exhaustion.d.ts.map +1 -1
- package/dist/shields/exhaustion/wasm-interface-exhaustion.js +16 -7
- package/dist/shields/exhaustion/wasm-interface-exhaustion.js.map +1 -1
- package/dist/shields/formats/android-dex-xref.d.ts +19 -0
- package/dist/shields/formats/android-dex-xref.d.ts.map +1 -0
- package/dist/shields/formats/android-dex-xref.js +427 -0
- package/dist/shields/formats/android-dex-xref.js.map +1 -0
- package/dist/shields/formats/android-manifest.d.ts +44 -0
- package/dist/shields/formats/android-manifest.d.ts.map +1 -0
- package/dist/shields/formats/android-manifest.js +240 -0
- package/dist/shields/formats/android-manifest.js.map +1 -0
- package/dist/shields/formats/android-r8.d.ts +44 -0
- package/dist/shields/formats/android-r8.d.ts.map +1 -0
- package/dist/shields/formats/android-r8.js +246 -0
- package/dist/shields/formats/android-r8.js.map +1 -0
- package/dist/shields/formats/apple-plist.d.ts +15 -0
- package/dist/shields/formats/apple-plist.d.ts.map +1 -1
- package/dist/shields/formats/apple-plist.js +59 -1
- package/dist/shields/formats/apple-plist.js.map +1 -1
- package/dist/shields/formats/archive.d.ts +27 -6
- package/dist/shields/formats/archive.d.ts.map +1 -1
- package/dist/shields/formats/archive.js +247 -45
- package/dist/shields/formats/archive.js.map +1 -1
- package/dist/shields/formats/asar.d.ts +50 -10
- package/dist/shields/formats/asar.d.ts.map +1 -1
- package/dist/shields/formats/asar.js +265 -39
- package/dist/shields/formats/asar.js.map +1 -1
- package/dist/shields/formats/bun-standalone.d.ts +78 -0
- package/dist/shields/formats/bun-standalone.d.ts.map +1 -0
- package/dist/shields/formats/bun-standalone.js +272 -0
- package/dist/shields/formats/bun-standalone.js.map +1 -0
- package/dist/shields/formats/dotnet-managed.d.ts +9 -0
- package/dist/shields/formats/dotnet-managed.d.ts.map +1 -1
- package/dist/shields/formats/dotnet-managed.js +26 -1
- package/dist/shields/formats/dotnet-managed.js.map +1 -1
- package/dist/shields/formats/electron-fuses.d.ts +63 -8
- package/dist/shields/formats/electron-fuses.d.ts.map +1 -1
- package/dist/shields/formats/electron-fuses.js +297 -65
- package/dist/shields/formats/electron-fuses.js.map +1 -1
- package/dist/shields/formats/erlang-beam.d.ts +34 -0
- package/dist/shields/formats/erlang-beam.d.ts.map +1 -0
- package/dist/shields/formats/erlang-beam.js +319 -0
- package/dist/shields/formats/erlang-beam.js.map +1 -0
- package/dist/shields/formats/evm-bytecode.d.ts +28 -0
- package/dist/shields/formats/evm-bytecode.d.ts.map +1 -0
- package/dist/shields/formats/evm-bytecode.js +124 -0
- package/dist/shields/formats/evm-bytecode.js.map +1 -0
- package/dist/shields/formats/go-flutter-exhaustion.d.ts +55 -0
- package/dist/shields/formats/go-flutter-exhaustion.d.ts.map +1 -0
- package/dist/shields/formats/go-flutter-exhaustion.js +346 -0
- package/dist/shields/formats/go-flutter-exhaustion.js.map +1 -0
- package/dist/shields/formats/gpu-ptx.d.ts +40 -0
- package/dist/shields/formats/gpu-ptx.d.ts.map +1 -0
- package/dist/shields/formats/gpu-ptx.js +62 -0
- package/dist/shields/formats/gpu-ptx.js.map +1 -0
- package/dist/shields/formats/headers.d.ts.map +1 -1
- package/dist/shields/formats/headers.js +54 -14
- package/dist/shields/formats/headers.js.map +1 -1
- package/dist/shields/formats/jvm-bytecode.d.ts +20 -0
- package/dist/shields/formats/jvm-bytecode.d.ts.map +1 -0
- package/dist/shields/formats/jvm-bytecode.js +134 -0
- package/dist/shields/formats/jvm-bytecode.js.map +1 -0
- package/dist/shields/formats/mobile-game.d.ts +4 -0
- package/dist/shields/formats/mobile-game.d.ts.map +1 -1
- package/dist/shields/formats/mobile-game.js +16 -0
- package/dist/shields/formats/mobile-game.js.map +1 -1
- package/dist/shields/formats/model.d.ts +22 -8
- package/dist/shields/formats/model.d.ts.map +1 -1
- package/dist/shields/formats/model.js +231 -59
- package/dist/shields/formats/model.js.map +1 -1
- package/dist/shields/formats/native.d.ts +74 -11
- package/dist/shields/formats/native.d.ts.map +1 -1
- package/dist/shields/formats/native.js +557 -109
- package/dist/shields/formats/native.js.map +1 -1
- package/dist/shields/formats/pcap-capture.d.ts +27 -0
- package/dist/shields/formats/pcap-capture.d.ts.map +1 -0
- package/dist/shields/formats/pcap-capture.js +201 -0
- package/dist/shields/formats/pcap-capture.js.map +1 -0
- package/dist/shields/formats/python.d.ts +22 -1
- package/dist/shields/formats/python.d.ts.map +1 -1
- package/dist/shields/formats/python.js +568 -27
- package/dist/shields/formats/python.js.map +1 -1
- package/dist/shields/formats/sourcemap.d.ts.map +1 -1
- package/dist/shields/formats/sourcemap.js +2 -0
- package/dist/shields/formats/sourcemap.js.map +1 -1
- package/dist/shields/formats/sqlite.d.ts +87 -15
- package/dist/shields/formats/sqlite.d.ts.map +1 -1
- package/dist/shields/formats/sqlite.js +377 -42
- package/dist/shields/formats/sqlite.js.map +1 -1
- package/dist/shields/formats/wasm.d.ts +6 -0
- package/dist/shields/formats/wasm.d.ts.map +1 -1
- package/dist/shields/formats/wasm.js +118 -3
- package/dist/shields/formats/wasm.js.map +1 -1
- package/dist/shields/javascript/ast-shield.d.ts +26 -5
- package/dist/shields/javascript/ast-shield.d.ts.map +1 -1
- package/dist/shields/javascript/ast-shield.js +748 -104
- package/dist/shields/javascript/ast-shield.js.map +1 -1
- package/dist/shields/runtime/memory-diff-shield.d.ts +56 -0
- package/dist/shields/runtime/memory-diff-shield.d.ts.map +1 -0
- package/dist/shields/runtime/memory-diff-shield.js +170 -0
- package/dist/shields/runtime/memory-diff-shield.js.map +1 -0
- package/dist/shields/runtime/runtime-shield.d.ts +12 -16
- package/dist/shields/runtime/runtime-shield.d.ts.map +1 -1
- package/dist/shields/runtime/runtime-shield.js +30 -24
- package/dist/shields/runtime/runtime-shield.js.map +1 -1
- package/dist/shields/tarpit/opaque-predicates.d.ts.map +1 -1
- package/dist/shields/tarpit/opaque-predicates.js +3 -3
- package/dist/shields/tarpit/opaque-predicates.js.map +1 -1
- package/dist/shields/tarpit/tarpit-generator.d.ts +9 -4
- package/dist/shields/tarpit/tarpit-generator.d.ts.map +1 -1
- package/dist/shields/tarpit/tarpit-generator.js +30 -23
- package/dist/shields/tarpit/tarpit-generator.js.map +1 -1
- package/package.json +13 -6
package/dist/engine/auditor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { readFileSync, readdirSync } from "node:fs";
|
|
2
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
3
3
|
import { basename, extname, join, resolve } from "node:path";
|
|
4
4
|
import { parse } from "@babel/parser";
|
|
5
5
|
import _traverse from "@babel/traverse";
|
|
@@ -10,6 +10,7 @@ import { unpackAsarBuffer } from "../shields/formats/asar.js";
|
|
|
10
10
|
import { inspectWasmBinary } from "../shields/formats/wasm.js";
|
|
11
11
|
import { inspectPythonPyc } from "../shields/formats/python.js";
|
|
12
12
|
import { inspectNativeBinary } from "../shields/formats/native.js";
|
|
13
|
+
import { detectBunStandaloneGraph } from "../shields/formats/bun-standalone.js";
|
|
13
14
|
import { readZipEntries } from "../shields/formats/archive.js";
|
|
14
15
|
import { inspectSqliteBuffer } from "../shields/formats/sqlite.js";
|
|
15
16
|
import { inspectModelBuffer } from "../shields/formats/model.js";
|
|
@@ -17,6 +18,38 @@ import { inspectAndroidDex } from "../shields/formats/mobile-game.js";
|
|
|
17
18
|
const traverse = typeof _traverse === "function"
|
|
18
19
|
? _traverse
|
|
19
20
|
: _traverse.default;
|
|
21
|
+
function isExecutableHtmlScriptAttrs(attrs) {
|
|
22
|
+
if (/\bsrc\s*=/i.test(attrs))
|
|
23
|
+
return false;
|
|
24
|
+
const typeMatch = /\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(attrs);
|
|
25
|
+
if (!typeMatch)
|
|
26
|
+
return true;
|
|
27
|
+
const rawType = (typeMatch[1] ?? typeMatch[2] ?? typeMatch[3] ?? "")
|
|
28
|
+
.trim()
|
|
29
|
+
.toLowerCase();
|
|
30
|
+
return (rawType === "" ||
|
|
31
|
+
rawType === "module" ||
|
|
32
|
+
rawType === "text/javascript" ||
|
|
33
|
+
rawType === "application/javascript" ||
|
|
34
|
+
rawType === "text/ecmascript" ||
|
|
35
|
+
rawType === "application/ecmascript" ||
|
|
36
|
+
rawType === "javascript");
|
|
37
|
+
}
|
|
38
|
+
function extractExecutableHtmlInlineScripts(htmlText) {
|
|
39
|
+
const scripts = [];
|
|
40
|
+
const re = /<script\b([^>]*)>([\s\S]*?)<\/script>/gi;
|
|
41
|
+
let m;
|
|
42
|
+
while ((m = re.exec(htmlText)) !== null) {
|
|
43
|
+
const attrs = m[1] ?? "";
|
|
44
|
+
const body = m[2] ?? "";
|
|
45
|
+
if (!body.trim())
|
|
46
|
+
continue;
|
|
47
|
+
if (!isExecutableHtmlScriptAttrs(attrs))
|
|
48
|
+
continue;
|
|
49
|
+
scripts.push(body);
|
|
50
|
+
}
|
|
51
|
+
return scripts;
|
|
52
|
+
}
|
|
20
53
|
function analyzeJsSourceForAudit(source, fileLabel) {
|
|
21
54
|
const exposed = [];
|
|
22
55
|
const vectors = new Set(["js-static-semantics"]);
|
|
@@ -37,7 +70,7 @@ function analyzeJsSourceForAudit(source, fileLabel) {
|
|
|
37
70
|
if (source.includes("a22?.require") || /const a\d+ = _flag \? a\d+\?\.x : a\d+\?\.y/.test(source)) {
|
|
38
71
|
triggeredLimits.add("alias-selections");
|
|
39
72
|
}
|
|
40
|
-
if (source.includes("
|
|
73
|
+
if (source.includes("_verifySemanticEnvelope") || /(\([_a-zA-Z0-9]+ \? "[^"]*" : "[^"]*"\) \+ ){6,}/.test(source)) {
|
|
41
74
|
triggeredLimits.add("primitive-candidates");
|
|
42
75
|
}
|
|
43
76
|
if (/const s\d+ = s\d+ \+ s\d+;/.test(source)) {
|
|
@@ -49,7 +82,7 @@ function analyzeJsSourceForAudit(source, fileLabel) {
|
|
|
49
82
|
if (source.includes("_exposeProto") || source.includes("Map.prototype")) {
|
|
50
83
|
uncertainties.add("returned-reference-widening");
|
|
51
84
|
}
|
|
52
|
-
const chaffMatches = source.match(/\[(Architecture Notice|Static Analysis Diagnostic|Decompilation Advisory|Evidence Ledger Note):/g);
|
|
85
|
+
const chaffMatches = source.match(/\[(Architecture Notice|Static Analysis Diagnostic|Decompilation Advisory|Evidence Ledger Note|Compliance & Safety Boundary)\b|(?:EVIDENCE_CONTRACT_SUMMARY|ANALYSIS_VIEW_PROJECTION|RECONSTRUCTION_LEDGER_STATE|NATIVE_DISPATCH_TABLE_NOTE|SYMBOL_OFFSET_MANIFEST_[0-9A-F]+|FSM_SPEC_V3|QUORUM_PROTOCOL_DESCRIPTOR|IPC_BRIDGE_TOPOLOGY|HSM_ATTESTATION_DESCRIPTOR_[0-9a-f]+):/g);
|
|
53
86
|
if (chaffMatches) {
|
|
54
87
|
architecturalChaffPayloads += chaffMatches.length;
|
|
55
88
|
}
|
|
@@ -78,8 +111,9 @@ function analyzeJsSourceForAudit(source, fileLabel) {
|
|
|
78
111
|
FunctionDeclaration(path) {
|
|
79
112
|
totalFunctions++;
|
|
80
113
|
const fnName = path.node.id?.name ?? "anonymous";
|
|
81
|
-
if (fnName.
|
|
82
|
-
|
|
114
|
+
if (fnName.includes("enclave") || fnName.includes("Shadow") || fnName.includes("tarpit") ||
|
|
115
|
+
/_[a-f0-9]{4}$/i.test(fnName) ||
|
|
116
|
+
/^(?:_)?(?:verifyEnclave|deriveHardware|reconcileQuorum|validateZeroKnowledge|dispatchSealed|computeMerkle|synchronizeHsm|decodeRingBuffer|authenticateTpm|evaluateLicense|negotiateVsock|projectShadow|resolveCryptographic|auditMonotonic|unsealProtected|verifySchnorr|stepShadowHeap|readSplitShare|registerDecoyIpc)/.test(fnName)) {
|
|
83
117
|
decoyFunctionsDetectedAsReal++;
|
|
84
118
|
}
|
|
85
119
|
else {
|
|
@@ -273,16 +307,23 @@ export function auditTarget(targetPath) {
|
|
|
273
307
|
const vulnerableVectors = new Set();
|
|
274
308
|
if (format === "directory") {
|
|
275
309
|
const filesToScan = [];
|
|
310
|
+
const nonJsFilesToScan = [];
|
|
276
311
|
const walkDir = (dir) => {
|
|
277
312
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
278
|
-
if (entry.name === "node_modules" || entry.name === ".git"
|
|
313
|
+
if (entry.name === "node_modules" || entry.name === ".git")
|
|
279
314
|
continue;
|
|
280
315
|
const full = join(dir, entry.name);
|
|
281
316
|
if (entry.isDirectory())
|
|
282
317
|
walkDir(full);
|
|
283
|
-
else if ([".js", ".ts", ".mjs", ".cjs", ".jsx", ".tsx"].includes(extname(entry.name))) {
|
|
318
|
+
else if ([".js", ".ts", ".mjs", ".cjs", ".jsx", ".tsx"].includes(extname(entry.name).toLowerCase())) {
|
|
284
319
|
filesToScan.push(full);
|
|
285
320
|
}
|
|
321
|
+
else {
|
|
322
|
+
const cf = detectArtifactFormat(full);
|
|
323
|
+
if (cf !== "unknown" && cf !== "directory" && cf !== "sourcemap") {
|
|
324
|
+
nonJsFilesToScan.push(full);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
286
327
|
}
|
|
287
328
|
};
|
|
288
329
|
walkDir(absPath);
|
|
@@ -323,6 +364,24 @@ export function auditTarget(targetPath) {
|
|
|
323
364
|
exposedItems.push(...sub.exposed);
|
|
324
365
|
sub.vectors.forEach((v) => vulnerableVectors.add(v));
|
|
325
366
|
}
|
|
367
|
+
for (const nf of nonJsFilesToScan) {
|
|
368
|
+
try {
|
|
369
|
+
const subAudit = auditTarget(nf);
|
|
370
|
+
byteSize += subAudit.byteSize;
|
|
371
|
+
hash.update(subAudit.sha256);
|
|
372
|
+
subAudit.reaSimulation.triggeredResourceLimits.forEach((l) => limits.add(l));
|
|
373
|
+
subAudit.reaSimulation.semanticUncertainties.forEach((u) => uncertainties.add(u));
|
|
374
|
+
totalFunctions += subAudit.reaSimulation.totalFunctions;
|
|
375
|
+
decoyFns += subAudit.reaSimulation.decoyFunctionsDetectedAsReal;
|
|
376
|
+
obligationNodes += subAudit.reaSimulation.obligationLedgerNodes;
|
|
377
|
+
chaff += subAudit.reaSimulation.architecturalChaffPayloads;
|
|
378
|
+
exposedItems.push(...subAudit.exposedItems);
|
|
379
|
+
subAudit.vulnerableReaVectors.forEach((v) => vulnerableVectors.add(v));
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
// ignore unreadable nested file
|
|
383
|
+
}
|
|
384
|
+
}
|
|
326
385
|
sha256 = hash.digest("hex");
|
|
327
386
|
sim = {
|
|
328
387
|
parseStatus: "complete",
|
|
@@ -347,13 +406,88 @@ export function auditTarget(targetPath) {
|
|
|
347
406
|
const rawBytes = readFileSync(absPath);
|
|
348
407
|
byteSize = rawBytes.length;
|
|
349
408
|
sha256 = createHash("sha256").update(rawBytes).digest("hex");
|
|
350
|
-
if (format === "javascript" || format === "typescript"
|
|
409
|
+
if (format === "javascript" || format === "typescript") {
|
|
351
410
|
const text = rawBytes.toString("utf8");
|
|
352
411
|
const res = analyzeJsSourceForAudit(text, basename(absPath));
|
|
353
412
|
sim = res.sim;
|
|
354
413
|
exposedItems.push(...res.exposed);
|
|
355
414
|
res.vectors.forEach((v) => vulnerableVectors.add(v));
|
|
356
415
|
}
|
|
416
|
+
else if (format === "html-bundle") {
|
|
417
|
+
const htmlText = rawBytes.toString("utf8");
|
|
418
|
+
const inlineScripts = extractExecutableHtmlInlineScripts(htmlText);
|
|
419
|
+
vulnerableVectors.add("js-static-semantics");
|
|
420
|
+
if (inlineScripts.length === 0) {
|
|
421
|
+
exposedItems.push({
|
|
422
|
+
id: `html_bundle_${basename(absPath)}`,
|
|
423
|
+
name: basename(absPath),
|
|
424
|
+
kind: "export",
|
|
425
|
+
location: basename(absPath),
|
|
426
|
+
riskLevel: "high",
|
|
427
|
+
reaToolUsed: "inspect_web_bundle / static script inventory",
|
|
428
|
+
estimatedTokensToReconstruct: 850,
|
|
429
|
+
estimatedCostUsd: 0.04,
|
|
430
|
+
reason: "HTML entry bundle without inline BLA semantic shield",
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
const limits = new Set();
|
|
435
|
+
const uncertainties = new Set();
|
|
436
|
+
let parseStatus = "complete";
|
|
437
|
+
let visitedAstNodes = 0;
|
|
438
|
+
let totalFunctions = 0;
|
|
439
|
+
let decoyFns = 0;
|
|
440
|
+
let staticResolved = 0;
|
|
441
|
+
let staticOpaque = 0;
|
|
442
|
+
let ipcTotal = 0;
|
|
443
|
+
let ipcPaired = 0;
|
|
444
|
+
let ipcAmbig = 0;
|
|
445
|
+
let routes = 0;
|
|
446
|
+
let decoyRoutes = 0;
|
|
447
|
+
let obligationNodes = 0;
|
|
448
|
+
let chaff = 0;
|
|
449
|
+
for (let idx = 0; idx < inlineScripts.length; idx++) {
|
|
450
|
+
const sub = analyzeJsSourceForAudit(inlineScripts[idx], `${basename(absPath)}#script-${idx}`);
|
|
451
|
+
if (sub.sim.parseStatus !== "complete") {
|
|
452
|
+
parseStatus = sub.sim.parseStatus;
|
|
453
|
+
}
|
|
454
|
+
sub.sim.triggeredResourceLimits.forEach((l) => limits.add(l));
|
|
455
|
+
sub.sim.semanticUncertainties.forEach((u) => uncertainties.add(u));
|
|
456
|
+
visitedAstNodes += sub.sim.visitedAstNodes;
|
|
457
|
+
totalFunctions += sub.sim.totalFunctions;
|
|
458
|
+
decoyFns += sub.sim.decoyFunctionsDetectedAsReal;
|
|
459
|
+
staticResolved += sub.sim.staticStringsResolved;
|
|
460
|
+
staticOpaque += sub.sim.staticStringsOpaque;
|
|
461
|
+
ipcTotal += sub.sim.ipcChannelsTotal;
|
|
462
|
+
ipcPaired += sub.sim.ipcChannelsPairedUniquely;
|
|
463
|
+
ipcAmbig += sub.sim.ipcChannelsAmbiguousOrDynamic;
|
|
464
|
+
routes += sub.sim.routesDiscovered;
|
|
465
|
+
decoyRoutes += sub.sim.decoyRoutesHarvested;
|
|
466
|
+
obligationNodes += sub.sim.obligationLedgerNodes;
|
|
467
|
+
chaff += sub.sim.architecturalChaffPayloads;
|
|
468
|
+
exposedItems.push(...sub.exposed);
|
|
469
|
+
sub.vectors.forEach((v) => vulnerableVectors.add(v));
|
|
470
|
+
}
|
|
471
|
+
sim = {
|
|
472
|
+
parseStatus,
|
|
473
|
+
examinationStatus: limits.size > 0 ? "limited" : "complete",
|
|
474
|
+
triggeredResourceLimits: [...limits],
|
|
475
|
+
semanticUncertainties: [...uncertainties],
|
|
476
|
+
visitedAstNodes,
|
|
477
|
+
totalFunctions,
|
|
478
|
+
decoyFunctionsDetectedAsReal: decoyFns,
|
|
479
|
+
staticStringsResolved: staticResolved,
|
|
480
|
+
staticStringsOpaque: staticOpaque,
|
|
481
|
+
ipcChannelsTotal: ipcTotal,
|
|
482
|
+
ipcChannelsPairedUniquely: ipcPaired,
|
|
483
|
+
ipcChannelsAmbiguousOrDynamic: ipcAmbig,
|
|
484
|
+
routesDiscovered: routes,
|
|
485
|
+
decoyRoutesHarvested: decoyRoutes,
|
|
486
|
+
obligationLedgerNodes: Math.max(1, obligationNodes),
|
|
487
|
+
architecturalChaffPayloads: chaff,
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
}
|
|
357
491
|
else if (format === "electron-asar") {
|
|
358
492
|
vulnerableVectors.add("electron-ipc-bridge");
|
|
359
493
|
vulnerableVectors.add("archive-inventory");
|
|
@@ -446,12 +580,22 @@ export function auditTarget(targetPath) {
|
|
|
446
580
|
vulnerableVectors.add("python-pyc-marshal");
|
|
447
581
|
if (format === "python-source") {
|
|
448
582
|
const text = rawBytes.toString("utf8");
|
|
449
|
-
const isProtected = text.includes("
|
|
583
|
+
const isProtected = text.includes("runtime attestation boundary") ||
|
|
584
|
+
text.includes("BLA-SHIELD") ||
|
|
585
|
+
text.includes("CANARY_TOKENS") ||
|
|
586
|
+
/def\s+\w+_([a-f0-9]{4})\s*\(/i.test(text);
|
|
450
587
|
const fnMatches = [...text.matchAll(/def\s+([A-Za-z0-9_]+)\s*\(/g)];
|
|
588
|
+
// Decoys are realistic snake_case names ending in hex entropy, or the classic tarpit (seed, depth) signature.
|
|
589
|
+
const decoyNameRe = /_[a-f0-9]{4}$/i;
|
|
590
|
+
const tarpitSigRe = new RegExp(String.raw `def\s+([A-Za-z0-9_]+)\s*\(\s*seed\s*:\s*int\s*=\s*0\s*,\s*depth\s*:\s*int\s*=\s*0\s*\)`, "g");
|
|
591
|
+
const tarpitSigNames = new Set([...text.matchAll(tarpitSigRe)].map((m) => m[1]));
|
|
451
592
|
let decoyCount = 0;
|
|
452
593
|
for (const m of fnMatches) {
|
|
453
594
|
const fnName = m[1];
|
|
454
|
-
|
|
595
|
+
const isDecoy = tarpitSigNames.has(fnName) ||
|
|
596
|
+
decoyNameRe.test(fnName) ||
|
|
597
|
+
/enclave|tarpit|attest|canary_honeypot/i.test(fnName);
|
|
598
|
+
if (isDecoy) {
|
|
455
599
|
decoyCount++;
|
|
456
600
|
}
|
|
457
601
|
else {
|
|
@@ -515,6 +659,10 @@ export function auditTarget(targetPath) {
|
|
|
515
659
|
vulnerableVectors.add("electron-fuses-inspection");
|
|
516
660
|
vulnerableVectors.add("flutter-dart-aot-snapshot");
|
|
517
661
|
const nat = inspectNativeBinary(rawBytes);
|
|
662
|
+
const sidecarPath = `${absPath}.bunfs-snapshot`;
|
|
663
|
+
const hasBunSidecar = existsSync(sidecarPath) &&
|
|
664
|
+
detectBunStandaloneGraph(readFileSync(sidecarPath)).kind !== "none";
|
|
665
|
+
const isNativeProtected = nat.blaProtected || hasBunSidecar;
|
|
518
666
|
const limits = [];
|
|
519
667
|
if (nat.rustcCommitHashesCount > 64) {
|
|
520
668
|
limits.push("maximum_rustc_hashes (capacity > 64)");
|
|
@@ -528,27 +676,33 @@ export function auditTarget(targetPath) {
|
|
|
528
676
|
if (nat.blaProtected) {
|
|
529
677
|
limits.push("native-rodata-chaff-mirage");
|
|
530
678
|
}
|
|
679
|
+
if (hasBunSidecar) {
|
|
680
|
+
limits.push("bun-standalone-sidecar-decoy-graph");
|
|
681
|
+
limits.push("eof-carrier-integrity-preserved");
|
|
682
|
+
}
|
|
531
683
|
exposedItems.push({
|
|
532
684
|
id: `native_${basename(absPath)}`,
|
|
533
685
|
name: `${basename(absPath)} (${nat.architecture} ${nat.bits}-bit)`,
|
|
534
686
|
kind: "native-symbol",
|
|
535
687
|
location: basename(absPath),
|
|
536
|
-
riskLevel:
|
|
688
|
+
riskLevel: isNativeProtected ? "low" : "critical",
|
|
537
689
|
reaToolUsed: "open_binary / inspect_rust_binary / inspect_electron_fuses / identify_flutter_build",
|
|
538
|
-
estimatedTokensToReconstruct:
|
|
539
|
-
estimatedCostUsd:
|
|
690
|
+
estimatedTokensToReconstruct: isNativeProtected ? 36_000 : 1_450,
|
|
691
|
+
estimatedCostUsd: isNativeProtected ? 2.9 : 0.08,
|
|
540
692
|
reason: nat.blaProtected
|
|
541
693
|
? `Protected by BLA Native Shield (${nat.rustcCommitHashesCount} rustc commits > 64, ${nat.electronFuseSentinelsCount} fuse sentinels > 32, ${nat.dartSnapshotHashesCount} Dart snapshots > 64)`
|
|
542
|
-
:
|
|
694
|
+
: hasBunSidecar
|
|
695
|
+
? "Protected by BLA Sidecar Bun Standalone Decoy Graph while preserving byte-exact code-signature / EOF carrier integrity"
|
|
696
|
+
: "Native binary metadata, sections, and strings directly inspectable by REA",
|
|
543
697
|
});
|
|
544
698
|
sim = {
|
|
545
699
|
...sim,
|
|
546
|
-
examinationStatus:
|
|
700
|
+
examinationStatus: isNativeProtected ? "limited" : "complete",
|
|
547
701
|
triggeredResourceLimits: limits,
|
|
548
702
|
totalFunctions: 8,
|
|
549
|
-
decoyFunctionsDetectedAsReal:
|
|
550
|
-
obligationLedgerNodes:
|
|
551
|
-
architecturalChaffPayloads:
|
|
703
|
+
decoyFunctionsDetectedAsReal: isNativeProtected ? 24 : 0,
|
|
704
|
+
obligationLedgerNodes: isNativeProtected ? 56 : 8,
|
|
705
|
+
architecturalChaffPayloads: isNativeProtected ? 6 : 0,
|
|
552
706
|
};
|
|
553
707
|
}
|
|
554
708
|
else if (format === "sqlite") {
|
|
@@ -687,6 +841,213 @@ export function auditTarget(targetPath) {
|
|
|
687
841
|
architecturalChaffPayloads: isProtected ? 4 : 0,
|
|
688
842
|
};
|
|
689
843
|
}
|
|
844
|
+
else if (format === "apple-plist") {
|
|
845
|
+
vulnerableVectors.add("apple-plist-budget");
|
|
846
|
+
const text = rawBytes.toString("utf8");
|
|
847
|
+
const isProtected = text.includes("[]>") ||
|
|
848
|
+
text.includes("BLAEnclaveAttestationAuthority") ||
|
|
849
|
+
text.includes("BLA_BPLIST_DEPTH_GUARD_132");
|
|
850
|
+
exposedItems.push({
|
|
851
|
+
id: `plist_${basename(absPath)}`,
|
|
852
|
+
name: basename(absPath),
|
|
853
|
+
kind: "metadata-section",
|
|
854
|
+
location: basename(absPath),
|
|
855
|
+
riskLevel: isProtected ? "low" : "high",
|
|
856
|
+
reaToolUsed: "inspect_apple_bundle / preflightPropertyListDecode",
|
|
857
|
+
estimatedTokensToReconstruct: isProtected ? 24_000 : 650,
|
|
858
|
+
estimatedCostUsd: isProtected ? 1.85 : 0.03,
|
|
859
|
+
reason: isProtected
|
|
860
|
+
? "Protected by BLA Apple PropertyList Decode Budget Guard"
|
|
861
|
+
: "Apple PropertyList keys and entitlements directly readable",
|
|
862
|
+
});
|
|
863
|
+
sim = {
|
|
864
|
+
...sim,
|
|
865
|
+
examinationStatus: isProtected ? "limited" : "complete",
|
|
866
|
+
triggeredResourceLimits: isProtected
|
|
867
|
+
? ["plist-internal-subset-expansion (PropertyListDecodeBudgetFailure)"]
|
|
868
|
+
: [],
|
|
869
|
+
totalFunctions: 4,
|
|
870
|
+
decoyFunctionsDetectedAsReal: isProtected ? 12 : 0,
|
|
871
|
+
obligationLedgerNodes: isProtected ? 28 : 4,
|
|
872
|
+
architecturalChaffPayloads: isProtected ? 4 : 0,
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
else if (format === "dotnet-managed") {
|
|
876
|
+
vulnerableVectors.add("dotnet-managed-budget");
|
|
877
|
+
const text = rawBytes.toString("latin1");
|
|
878
|
+
const isProtected = text.includes("BLA_DOTNET_CLR_SHIELD_V1");
|
|
879
|
+
exposedItems.push({
|
|
880
|
+
id: `dotnet_${basename(absPath)}`,
|
|
881
|
+
name: basename(absPath),
|
|
882
|
+
kind: "native-symbol",
|
|
883
|
+
location: basename(absPath),
|
|
884
|
+
riskLevel: isProtected ? "low" : "critical",
|
|
885
|
+
reaToolUsed: "inspect_dotnet_assembly / ManagedDecodeBudget",
|
|
886
|
+
estimatedTokensToReconstruct: isProtected ? 32_000 : 1_150,
|
|
887
|
+
estimatedCostUsd: isProtected ? 2.6 : 0.05,
|
|
888
|
+
reason: isProtected
|
|
889
|
+
? "Protected by BLA .NET Managed CLR Metadata & PInvoke Obligation Guard"
|
|
890
|
+
: "CLR metadata tables and PInvoke signatures directly readable",
|
|
891
|
+
});
|
|
892
|
+
sim = {
|
|
893
|
+
...sim,
|
|
894
|
+
examinationStatus: isProtected ? "limited" : "complete",
|
|
895
|
+
triggeredResourceLimits: isProtected
|
|
896
|
+
? ["managed-metadata-budget (ManagedDecodeBudget > 64 MiB)", "managed-pinvoke-import"]
|
|
897
|
+
: [],
|
|
898
|
+
totalFunctions: 12,
|
|
899
|
+
decoyFunctionsDetectedAsReal: isProtected ? 20 : 0,
|
|
900
|
+
obligationLedgerNodes: isProtected ? 48 : 12,
|
|
901
|
+
architecturalChaffPayloads: isProtected ? 6 : 0,
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
else if (format === "jvm-class") {
|
|
905
|
+
vulnerableVectors.add("jvm-bytecode-decompilation");
|
|
906
|
+
const text = rawBytes.toString("latin1");
|
|
907
|
+
const isProtected = text.includes("BlaEnclaveDelegation") || text.includes("BLA_JVM_SHIELD_V1");
|
|
908
|
+
exposedItems.push({
|
|
909
|
+
id: `jvm_${basename(absPath)}`,
|
|
910
|
+
name: basename(absPath),
|
|
911
|
+
kind: "class",
|
|
912
|
+
location: basename(absPath),
|
|
913
|
+
riskLevel: isProtected ? "low" : "critical",
|
|
914
|
+
reaToolUsed: "decompile_jvm_class (CFR / Vineflower / javap)",
|
|
915
|
+
estimatedTokensToReconstruct: isProtected ? 27_500 : 920,
|
|
916
|
+
estimatedCostUsd: isProtected ? 2.15 : 0.04,
|
|
917
|
+
reason: isProtected
|
|
918
|
+
? "Protected by BLA JVM Constant-Pool & Enclave Attribute Shield"
|
|
919
|
+
: "JVM constant pool and method descriptors directly readable",
|
|
920
|
+
});
|
|
921
|
+
sim = {
|
|
922
|
+
...sim,
|
|
923
|
+
examinationStatus: isProtected ? "limited" : "complete",
|
|
924
|
+
triggeredResourceLimits: isProtected
|
|
925
|
+
? ["jvm-constant-pool-enclave-attributes"]
|
|
926
|
+
: [],
|
|
927
|
+
totalFunctions: 8,
|
|
928
|
+
decoyFunctionsDetectedAsReal: isProtected ? 18 : 0,
|
|
929
|
+
obligationLedgerNodes: isProtected ? 40 : 8,
|
|
930
|
+
architecturalChaffPayloads: isProtected ? 5 : 0,
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
else if (format === "erlang-beam") {
|
|
934
|
+
vulnerableVectors.add("erlang-beam-inspection");
|
|
935
|
+
const text = rawBytes.toString("latin1");
|
|
936
|
+
const isProtected = text.includes("[BLA-BEAM-SHIELD]");
|
|
937
|
+
exposedItems.push({
|
|
938
|
+
id: `beam_${basename(absPath)}`,
|
|
939
|
+
name: basename(absPath),
|
|
940
|
+
kind: "metadata-section",
|
|
941
|
+
location: basename(absPath),
|
|
942
|
+
riskLevel: isProtected ? "low" : "high",
|
|
943
|
+
reaToolUsed: "inspect_erlang_beam (FOR1/BEAM chunk + atom tables)",
|
|
944
|
+
estimatedTokensToReconstruct: isProtected ? 42_000 : 1_100,
|
|
945
|
+
estimatedCostUsd: isProtected ? 3.4 : 0.05,
|
|
946
|
+
reason: isProtected
|
|
947
|
+
? "Protected by BLA BEAM chunk/atom exhaustion + canary decoys"
|
|
948
|
+
: "BEAM IFF chunks and atom table directly enumerable by REA",
|
|
949
|
+
});
|
|
950
|
+
sim = {
|
|
951
|
+
...sim,
|
|
952
|
+
examinationStatus: isProtected ? "limited" : "complete",
|
|
953
|
+
triggeredResourceLimits: isProtected
|
|
954
|
+
? [
|
|
955
|
+
"erlang-beam-chunks (max_chunks default 64)",
|
|
956
|
+
"erlang-beam-atoms (max_atoms default 4096)",
|
|
957
|
+
]
|
|
958
|
+
: [],
|
|
959
|
+
totalFunctions: 6,
|
|
960
|
+
decoyFunctionsDetectedAsReal: isProtected ? 24 : 0,
|
|
961
|
+
obligationLedgerNodes: isProtected ? 72 : 6,
|
|
962
|
+
architecturalChaffPayloads: isProtected ? 8 : 0,
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
else if (format === "evm-bytecode") {
|
|
966
|
+
vulnerableVectors.add("evm-bytecode-inspection");
|
|
967
|
+
const text = rawBytes.toString("utf8");
|
|
968
|
+
const isProtected = text.includes("[BLA-EVM-SHIELD]");
|
|
969
|
+
exposedItems.push({
|
|
970
|
+
id: `evm_${basename(absPath)}`,
|
|
971
|
+
name: basename(absPath),
|
|
972
|
+
kind: "metadata-section",
|
|
973
|
+
location: basename(absPath),
|
|
974
|
+
riskLevel: isProtected ? "low" : "high",
|
|
975
|
+
reaToolUsed: "inspect_evm_interface (EVMole + Solidity metadata CBOR)",
|
|
976
|
+
estimatedTokensToReconstruct: isProtected ? 38_000 : 800,
|
|
977
|
+
estimatedCostUsd: isProtected ? 2.9 : 0.04,
|
|
978
|
+
reason: isProtected
|
|
979
|
+
? "Protected by BLA Solidity metadata CBOR canary + input-budget padding"
|
|
980
|
+
: "EVM bytecode and terminal Solidity metadata directly inspectable",
|
|
981
|
+
});
|
|
982
|
+
sim = {
|
|
983
|
+
...sim,
|
|
984
|
+
examinationStatus: isProtected ? "limited" : "complete",
|
|
985
|
+
triggeredResourceLimits: isProtected
|
|
986
|
+
? ["evm-input-bytes (EVM_INTERFACE_LIMITS.inputBytes)", "evm-solidity-metadata-cbor"]
|
|
987
|
+
: [],
|
|
988
|
+
totalFunctions: 4,
|
|
989
|
+
decoyFunctionsDetectedAsReal: isProtected ? 16 : 0,
|
|
990
|
+
obligationLedgerNodes: isProtected ? 36 : 4,
|
|
991
|
+
architecturalChaffPayloads: isProtected ? 6 : 0,
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
else if (format === "pcap-capture") {
|
|
995
|
+
vulnerableVectors.add("pcap-capture-inspection");
|
|
996
|
+
const isProtected = rawBytes.includes(Buffer.from("[BLA-PCAP-SHIELD]", "utf8"));
|
|
997
|
+
exposedItems.push({
|
|
998
|
+
id: `pcap_${basename(absPath)}`,
|
|
999
|
+
name: basename(absPath),
|
|
1000
|
+
kind: "metadata-section",
|
|
1001
|
+
location: basename(absPath),
|
|
1002
|
+
riskLevel: isProtected ? "low" : "medium",
|
|
1003
|
+
reaToolUsed: "inspect_pcap_capture (tshark JSON)",
|
|
1004
|
+
estimatedTokensToReconstruct: isProtected ? 55_000 : 1_400,
|
|
1005
|
+
estimatedCostUsd: isProtected ? 4.1 : 0.06,
|
|
1006
|
+
reason: isProtected
|
|
1007
|
+
? "Protected by BLA PCAP decoy-packet flood targeting TSHARK_JSON_MAX_BYTES"
|
|
1008
|
+
: "PCAP frames fully dissectable by REA tshark provider",
|
|
1009
|
+
});
|
|
1010
|
+
sim = {
|
|
1011
|
+
...sim,
|
|
1012
|
+
examinationStatus: isProtected ? "limited" : "complete",
|
|
1013
|
+
triggeredResourceLimits: isProtected
|
|
1014
|
+
? ["pcap-tshark-json (TSHARK_JSON_MAX_BYTES 8 MiB)"]
|
|
1015
|
+
: [],
|
|
1016
|
+
totalFunctions: 2,
|
|
1017
|
+
decoyFunctionsDetectedAsReal: isProtected ? 16 : 0,
|
|
1018
|
+
obligationLedgerNodes: isProtected ? 32 : 2,
|
|
1019
|
+
architecturalChaffPayloads: isProtected ? 4 : 0,
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
else if (format === "gpu-ptx") {
|
|
1023
|
+
vulnerableVectors.add("gpu-ptx-inspection");
|
|
1024
|
+
const text = rawBytes.toString("utf8");
|
|
1025
|
+
const isProtected = text.includes("[BLA-PTX-SHIELD]");
|
|
1026
|
+
exposedItems.push({
|
|
1027
|
+
id: `ptx_${basename(absPath)}`,
|
|
1028
|
+
name: basename(absPath),
|
|
1029
|
+
kind: "metadata-section",
|
|
1030
|
+
location: basename(absPath),
|
|
1031
|
+
riskLevel: isProtected ? "low" : "medium",
|
|
1032
|
+
reaToolUsed: "inspect_gpu_code_objects (PTX kernel parser)",
|
|
1033
|
+
estimatedTokensToReconstruct: isProtected ? 48_000 : 1_200,
|
|
1034
|
+
estimatedCostUsd: isProtected ? 3.6 : 0.05,
|
|
1035
|
+
reason: isProtected
|
|
1036
|
+
? "Protected by BLA PTX decoy .entry flood + diagnostic comments"
|
|
1037
|
+
: "PTX .entry/.param declarations directly harvested by REA",
|
|
1038
|
+
});
|
|
1039
|
+
sim = {
|
|
1040
|
+
...sim,
|
|
1041
|
+
examinationStatus: isProtected ? "limited" : "complete",
|
|
1042
|
+
triggeredResourceLimits: isProtected
|
|
1043
|
+
? ["gpu-report-bytes (GPU_REPORT_BYTES 16 MiB)", "gpu-ptx-entry-facts"]
|
|
1044
|
+
: [],
|
|
1045
|
+
totalFunctions: isProtected ? 20 : 1,
|
|
1046
|
+
decoyFunctionsDetectedAsReal: isProtected ? 20 : 0,
|
|
1047
|
+
obligationLedgerNodes: isProtected ? 48 : 2,
|
|
1048
|
+
architecturalChaffPayloads: isProtected ? 5 : 0,
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
690
1051
|
}
|
|
691
1052
|
// Compute overall Exposure Score (0 = fully protected, 100 = completely exposed)
|
|
692
1053
|
let exposureScore = 92;
|
|
@@ -711,7 +1072,7 @@ export function auditTarget(targetPath) {
|
|
|
711
1072
|
const agentEstimates = estimateAgentReverseEngineeringCosts(sim, byteSize);
|
|
712
1073
|
const primaryEstimate = agentEstimates[0];
|
|
713
1074
|
const primaryModule = exposedItems[0]?.name ?? basename(absPath);
|
|
714
|
-
const recommendedCommand = `npx bla-
|
|
1075
|
+
const recommendedCommand = `npx bla-agents protect ${targetPath}`;
|
|
715
1076
|
const headlineWarning = protectionStatus === "BLA_PROTECTED"
|
|
716
1077
|
? `SHIELD ACTIVE: ${basename(absPath)} triggers ${sim.triggeredResourceLimits.length} REA resource limits and forces ~${primaryEstimate.estimatedInputTokens.toLocaleString()} tokens ($${primaryEstimate.estimatedCostUsd.toFixed(2)}) of agent tarpit exhaustion.`
|
|
717
1078
|
: `DANGER: Module "${primaryModule}" in ${basename(absPath)} is exposed to REA (${exposureScore}/100 exposure). Estimated Claude Code time: ${primaryEstimate.estimatedWallClockSeconds}s, cost: $${primaryEstimate.estimatedCostUsd.toFixed(2)} to reconstruct. Run "${recommendedCommand}" to inject AI Tarpit & Semantic Shield.`;
|