0sec-cli 0.17.0 → 0.21.4
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/{0sec.js → 0.js} +92 -79
- package/LICENSE +1 -1
- package/README.md +77 -37
- package/chunks/adapt-loop-IGBRQAXO.js +18 -0
- package/chunks/{adgraph-JLGA6RYI.js → adgraph-AUDQTBYA.js} +5 -5
- package/chunks/agent/skills/frameworks/entra-id.yaml +2 -2
- package/chunks/agent/skills/techniques/assumption-mining.yaml +2 -2
- package/chunks/agent/skills/techniques/cve-poc-adaptation.yaml +2 -2
- package/chunks/agent/skills/techniques/entra-attack-paths.yaml +1 -1
- package/chunks/agent/skills/techniques/kernel-weaponization.yaml +1 -1
- package/chunks/agent/skills/techniques/llm-prompt-injection.yaml +2 -2
- package/chunks/agent/skills/techniques/npm-ecosystem.yaml +1 -1
- package/chunks/agent/skills/techniques/poc-verification.yaml +1 -1
- package/chunks/agent/skills/techniques/seedless-depth-review.yaml +20 -38
- package/chunks/{artifact-scraper-GJEZMOHF.js → artifact-scraper-LNQJUORS.js} +6 -6
- package/chunks/{assumption-mining-BVMMUZHB.js → assumption-mining-4MJTP6H5.js} +24 -26
- package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
- package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
- package/chunks/{chunk-HDWV7PGI.js → chunk-2WSXFFJZ.js} +4 -4
- package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
- package/chunks/{chunk-SNKTC4BP.js → chunk-5T6D5BVY.js} +88 -88
- package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
- package/chunks/chunk-6YNKRUMC.js +4474 -0
- package/chunks/{chunk-O462Y7P2.js → chunk-ANDKY54G.js} +22317 -19616
- package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
- package/chunks/{chunk-2SANI5RH.js → chunk-BACXRTQ4.js} +691 -318
- package/chunks/{chunk-SOG2U7B3.js → chunk-CAJJRUTV.js} +4 -4
- package/chunks/{chunk-57ZENEX2.js → chunk-CGHCEN7W.js} +3 -3
- package/chunks/{chunk-VGRDNSHA.js → chunk-CL5KAUM6.js} +17 -16
- package/chunks/{chunk-QOKTUOU2.js → chunk-CXKDWFNO.js} +6 -6
- package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
- package/chunks/{chunk-K26SZ37E.js → chunk-E2UOY5PJ.js} +288 -100
- package/chunks/{chunk-CLHCDHP4.js → chunk-ER3SUMYJ.js} +40 -18
- package/chunks/{chunk-IORC6MQX.js → chunk-FAH6V4QM.js} +31964 -32279
- package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
- package/chunks/{chunk-4Y4KQJXE.js → chunk-FWAYJ2IV.js} +16 -16
- package/chunks/{chunk-WVTBZEQO.js → chunk-G34QP2XW.js} +8 -8
- package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
- package/chunks/{chunk-F3WBKITT.js → chunk-GIQKESMN.js} +10 -10
- package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
- package/chunks/{chunk-RDZYQQLW.js → chunk-HBKCGJAV.js} +7 -7
- package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
- package/chunks/chunk-HPQZHOIU.js +67 -0
- package/chunks/{chunk-3QFDYBZQ.js → chunk-IMGWPNQM.js} +231 -1308
- package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
- package/chunks/{chunk-MMLDQR4H.js → chunk-NDJU5ZZ7.js} +14 -14
- package/chunks/{chunk-H44E2CRN.js → chunk-NOPBXZUV.js} +3 -3
- package/chunks/{chunk-HE7LCA7G.js → chunk-O6SD4A36.js} +3 -3
- package/chunks/{chunk-SAFFWQW4.js → chunk-P6YG6TEZ.js} +6 -6
- package/chunks/{chunk-KKGE5RQE.js → chunk-PC6RCKQV.js} +198 -11
- package/chunks/{chunk-LP3HHYQU.js → chunk-PD2BBBKT.js} +2 -2
- package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
- package/chunks/{chunk-KLTNTE2Z.js → chunk-QZVG3BG4.js} +14 -14
- package/chunks/{chunk-D6S3IIPG.js → chunk-RF5QGKLR.js} +9 -9
- package/chunks/{chunk-LOHTE223.js → chunk-SBMB4OL3.js} +9 -9
- package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
- package/chunks/{chunk-A6CLR72I.js → chunk-TF46UWFU.js} +3 -3
- package/chunks/chunk-TH2LW437.js +7829 -0
- package/chunks/chunk-TRH2PJSN.js +547 -0
- package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
- package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
- package/chunks/{chunk-WU6AFRAZ.js → chunk-V36HVTUL.js} +12 -12
- package/chunks/{chunk-IR537GON.js → chunk-VCSFCHAJ.js} +2 -2
- package/chunks/{chunk-YLMN3N25.js → chunk-VIT5ALXF.js} +3 -3
- package/chunks/{chunk-UJ4IK5PO.js → chunk-VOAXLO4A.js} +10 -10
- package/chunks/{chunk-UM3ZNQIM.js → chunk-W4JOXE4N.js} +100 -84
- package/chunks/{chunk-DN25OQQA.js → chunk-WF5W75WY.js} +25 -25
- package/chunks/{chunk-QKICO43A.js → chunk-WPQLBN4S.js} +5 -5
- package/chunks/{chunk-HT6P7RY3.js → chunk-WZISK5VC.js} +37 -35
- package/chunks/{chunk-QJQKHO7G.js → chunk-Y5H6E24H.js} +3 -3
- package/chunks/{chunk-KTQDLNSR.js → chunk-YA4PUM4H.js} +41 -41
- package/chunks/{chunk-47TQJWDH.js → chunk-YHWWF4QY.js} +9 -9
- package/chunks/{chunk-2CJ776PV.js → chunk-YPOA3W4O.js} +48 -39
- package/chunks/{chunk-7DQEV5QI.js → chunk-Z3IKZX3X.js} +4 -4
- package/chunks/codex-models-TYYV4JNN.js +15 -0
- package/chunks/{commands-U3AMV5ZU.js → commands-WF5RG4I2.js} +5620 -2513
- package/chunks/corpus-v1.json +2 -2
- package/chunks/data/appsec-archetypes.json +2 -2
- package/chunks/data/chromium-archetypes.json +1 -1
- package/chunks/data/freebsd-archetypes.json +1 -1
- package/chunks/data/kernel-archetypes.json +2 -2
- package/chunks/db-U3WQZVAO.js +16 -0
- package/chunks/{disclose-A6AEIEDA.js → disclose-67GZCDBO.js} +5 -5
- package/chunks/{dist-JR67XKYO.js → dist-ACC3DZUZ.js} +11 -5
- package/chunks/{dist-GL66KMUX.js → dist-EVTN3UTT.js} +6 -6
- package/chunks/{dist-FDKALV4R.js → dist-F6X62TQK.js} +290 -327
- package/chunks/dist-KEULE5IQ.js +21914 -0
- package/chunks/dist-XZB53PS5.js +53 -0
- package/chunks/eval-runner-SA6OUGHZ.js +26 -0
- package/chunks/example-manifest.json +2 -2
- package/chunks/{exploit-agent-XP23ISN7.js → exploit-agent-36Q7XQFP.js} +4 -4
- package/chunks/{exploit-autoclimb-E6T7RRSC.js → exploit-autoclimb-J4OTSTZ6.js} +6 -6
- package/chunks/{exploit-climb-2FAUP6XU.js → exploit-climb-PYEJDIC4.js} +12 -12
- package/chunks/fix-J2KBRJDV.js +12 -0
- package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
- package/chunks/harness-GDUMKGSE.js +22 -0
- package/chunks/http-conformance-U5F6GKYG.js +11 -0
- package/chunks/http-sender-I5XFFY35.js +10 -0
- package/chunks/hunt-scan-UDJSCISU.js +36 -0
- package/chunks/{identity-6ZAIIWOR.js → identity-JTIVJSV7.js} +5 -5
- package/chunks/{kernel-primitive-TENE3R7T.js → kernel-primitive-F2IXUFAX.js} +6 -6
- package/chunks/{kernel-vm-runner-4F6QSNFY.js → kernel-vm-runner-276LHIOV.js} +6 -6
- package/chunks/memsafety-scan-NHUOGTEX.js +16 -0
- package/chunks/{native-loop-NTONUDP7.js → native-loop-3BSYVDUI.js} +17 -18
- package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-VIYJXKFQ.js} +6 -6
- package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
- package/chunks/orchestrate-DHBFRTSI.js +59 -0
- package/chunks/{pre-recon-cve-66EB6G4M.js → pre-recon-cve-X2K2P5YQ.js} +4 -4
- package/chunks/prepare-KYHGFWCJ.js +13 -0
- package/chunks/process-PNMC36JI.js +15 -0
- package/chunks/{replay-runner-RRR4E2A7.js → replay-runner-LK2XFIVG.js} +7 -7
- package/chunks/{run-ESNN4V5W.js → run-CBGE6DRQ.js} +2401 -1810
- package/chunks/{runtime-62ZQAH7H.js → runtime-PXO5G6UV.js} +11 -11
- package/chunks/runtime-XFWJTBUO.js +12 -0
- package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
- package/chunks/{scope-BI7BF4ZY.js → scope-NJHIDDTN.js} +4 -4
- package/chunks/{session-store-BCFQYDCE.js → session-store-46WBZM22.js} +6 -6
- package/chunks/source-files-REHOM44I.js +12 -0
- package/chunks/{specdrift-WCLH6TTQ.js → specdrift-AFS54WEJ.js} +5 -5
- package/chunks/token-KRWP5JYA.js +72 -0
- package/chunks/token-util-DWTL33S3.js +8 -0
- package/chunks/variant-candidates-UH2WC2HA.js +13 -0
- package/chunks/{web-recon-prepass-DPVCBRZA.js → web-recon-prepass-SFXU44SS.js} +9 -9
- package/dashboard/assets/desktop-BT7RkC4q.js +32 -0
- package/dashboard/assets/desktop-OaBI0E0e.css +1 -0
- package/dashboard/assets/{findings-page-CACW9nw2.js → findings-page-B4rwF6fZ.js} +2 -2
- package/dashboard/assets/{format-PoISqsES.js → format-LNQSSpn6.js} +1 -1
- package/dashboard/assets/live-page-DoNwpPAO.js +1 -0
- package/dashboard/assets/{meta-tile-CcskIV_o.js → meta-tile-BMtBC-Qq.js} +1 -1
- package/dashboard/assets/operations-CMFVrXEe.css +2 -0
- package/dashboard/assets/operations-app-ER0gg7GN.js +2 -0
- package/dashboard/assets/{operations-D8nUP5_m.js → operations-e2CGYKB1.js} +2 -2
- package/dashboard/assets/{overview-page-DTGS8dPo.js → overview-page-CmeWH17A.js} +1 -1
- package/dashboard/assets/{page-header-MFVvEtZW.js → page-header-CIJyycfz.js} +1 -1
- package/dashboard/assets/scans-page-CuhzWhHx.js +1 -0
- package/dashboard/assets/{table-BYS-nIVA.js → table-BgsSBdke.js} +1 -1
- package/dashboard/assets/{tabs-DivxbhQy.js → tabs-vn6v7Bk6.js} +1 -1
- package/dashboard/desktop.html +3 -3
- package/dashboard/index.html +3 -3
- package/package.json +11 -11
- package/chunks/adapt-loop-ECQG7454.js +0 -18
- package/chunks/appsec-catalog-CBWHGTEL.js +0 -24
- package/chunks/chunk-H2FFLZNK.js +0 -3
- package/chunks/chunk-QI233I24.js +0 -333
- package/chunks/chunk-RRMJC3ZE.js +0 -105
- package/chunks/chunk-SZJCPG2I.js +0 -110
- package/chunks/chunk-WKNNZVJS.js +0 -2798
- package/chunks/cost-ledger-ZCKMBJEN.js +0 -13
- package/chunks/db-26NGQFKO.js +0 -16
- package/chunks/eval-runner-DDLE5RQ3.js +0 -27
- package/chunks/fix-IG7LYXH3.js +0 -12
- package/chunks/harness-HWOYFKFY.js +0 -22
- package/chunks/http-conformance-DU66MZIU.js +0 -11
- package/chunks/http-sender-GWH2IYEA.js +0 -10
- package/chunks/hunt-scan-XPELSPQQ.js +0 -38
- package/chunks/memsafety-scan-J7SECV5W.js +0 -16
- package/chunks/npm-dynamic-discovery-AHROOZDB.js +0 -13
- package/chunks/orchestrate-ZUWAUWBC.js +0 -62
- package/chunks/pipeline-FCARFZU3.js +0 -14
- package/chunks/prepare-MYY743TK.js +0 -13
- package/chunks/process-3Q7QJIOZ.js +0 -13
- package/chunks/runtime-J7PLXZNM.js +0 -12
- package/chunks/source-files-PWRQR6LY.js +0 -12
- package/chunks/variant-candidates-6KM6F6MD.js +0 -13
- package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
- package/dashboard/assets/desktop-CXTQonNm.js +0 -32
- package/dashboard/assets/desktop-NOekk4QS.css +0 -1
- package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
- package/dashboard/assets/operations-BKE8T-vY.css +0 -2
- package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
- package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as
|
|
3
|
-
const require =
|
|
2
|
+
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
|
+
const require = __0CreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
eventBus,
|
|
6
6
|
isCloudEventSinkActive
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CXKDWFNO.js";
|
|
8
8
|
|
|
9
9
|
// packages/core/dist/runtime/process.js
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
@@ -94,13 +94,22 @@ function safeJsonStringify(v) {
|
|
|
94
94
|
function buildClaudeMcpConfig(context) {
|
|
95
95
|
return JSON.stringify({
|
|
96
96
|
mcpServers: {
|
|
97
|
-
"
|
|
97
|
+
"0": {
|
|
98
98
|
command: process.execPath,
|
|
99
99
|
args: buildOsecMcpCommandArgs(context)
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
+
function describeSpawnFailure(err, command, argv) {
|
|
105
|
+
const code = err?.code;
|
|
106
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
107
|
+
if (code === "E2BIG" || message.includes("E2BIG")) {
|
|
108
|
+
const bytes = argv.reduce((total, arg) => total + Buffer.byteLength(arg, "utf8") + 1, 0);
|
|
109
|
+
return `${command} could not be started: the prompt is too large for one command line (${bytes} bytes of arguments, over this system's limit). Narrow the run \u2014 a smaller --subsystem or scope, or a lower --batch-size \u2014 so less content is sent in a single request.`;
|
|
110
|
+
}
|
|
111
|
+
return message;
|
|
112
|
+
}
|
|
104
113
|
var ProcessRuntime = class {
|
|
105
114
|
type;
|
|
106
115
|
config;
|
|
@@ -295,11 +304,23 @@ var ProcessRuntime = class {
|
|
|
295
304
|
let resultText = "";
|
|
296
305
|
let timedOut = false;
|
|
297
306
|
const isJsonStream = args.includes("stream-json") || args.includes("--json");
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
307
|
+
let proc;
|
|
308
|
+
try {
|
|
309
|
+
proc = spawn(this.command, args, {
|
|
310
|
+
cwd: this.config.cwd ?? process.cwd(),
|
|
311
|
+
env: { ...process.env, ...env },
|
|
312
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
313
|
+
});
|
|
314
|
+
} catch (err) {
|
|
315
|
+
resolve2({
|
|
316
|
+
output: "",
|
|
317
|
+
exitCode: 1,
|
|
318
|
+
timedOut: false,
|
|
319
|
+
durationMs: Date.now() - start,
|
|
320
|
+
error: describeSpawnFailure(err, this.command, args)
|
|
321
|
+
});
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
303
324
|
proc.stdout.on("data", (chunk) => {
|
|
304
325
|
const text = chunk.toString();
|
|
305
326
|
stdout += text;
|
|
@@ -343,7 +364,7 @@ var ProcessRuntime = class {
|
|
|
343
364
|
stderr += text;
|
|
344
365
|
if (/permission|approve|allow.*tool/i.test(stderr) && stderr.length > 500) {
|
|
345
366
|
proc.kill("SIGTERM");
|
|
346
|
-
stderr += "\n[
|
|
367
|
+
stderr += "\n[0] Subprocess killed: MCP tools require interactive approval. Use --runtime api instead.";
|
|
347
368
|
}
|
|
348
369
|
});
|
|
349
370
|
const timer = setTimeout(() => {
|
|
@@ -369,7 +390,7 @@ var ProcessRuntime = class {
|
|
|
369
390
|
exitCode: 1,
|
|
370
391
|
timedOut: false,
|
|
371
392
|
durationMs: Date.now() - start,
|
|
372
|
-
error: err.
|
|
393
|
+
error: describeSpawnFailure(err, this.command, args)
|
|
373
394
|
});
|
|
374
395
|
});
|
|
375
396
|
});
|
|
@@ -425,7 +446,7 @@ var ProcessRuntime = class {
|
|
|
425
446
|
throw new Error("Codex CLI MCP target tools are not supported. Use the direct ChatGPT Codex provider for live target scans.");
|
|
426
447
|
}
|
|
427
448
|
if (this.config.outputSchema) {
|
|
428
|
-
const schemaPath = join(tmpdir(), `
|
|
449
|
+
const schemaPath = join(tmpdir(), `0-schema-${Date.now()}.json`);
|
|
429
450
|
writeFileSync(schemaPath, JSON.stringify(this.config.outputSchema));
|
|
430
451
|
args.push("--output-schema", schemaPath);
|
|
431
452
|
}
|
|
@@ -445,27 +466,28 @@ var ProcessRuntime = class {
|
|
|
445
466
|
...this.config.env
|
|
446
467
|
};
|
|
447
468
|
if (context?.target) {
|
|
448
|
-
env["
|
|
469
|
+
env["ZERO_TARGET"] = context.target;
|
|
449
470
|
}
|
|
450
471
|
if (context?.findings) {
|
|
451
|
-
env["
|
|
472
|
+
env["ZERO_FINDINGS"] = context.findings;
|
|
452
473
|
}
|
|
453
474
|
if (context?.templateId) {
|
|
454
|
-
env["
|
|
475
|
+
env["ZERO_TEMPLATE_ID"] = context.templateId;
|
|
455
476
|
}
|
|
456
477
|
if (context?.mcp?.auth) {
|
|
457
|
-
env["
|
|
478
|
+
env["ZERO_MCP_AUTH_JSON"] = JSON.stringify(context.mcp.auth);
|
|
458
479
|
}
|
|
459
480
|
if (context?.mcp?.attributionHeaders) {
|
|
460
|
-
env["
|
|
481
|
+
env["ZERO_MCP_ATTRIBUTION_HEADERS_JSON"] = JSON.stringify(context.mcp.attributionHeaders);
|
|
461
482
|
}
|
|
462
483
|
if (context?.mcp?.attributionUaToken) {
|
|
463
|
-
env["
|
|
484
|
+
env["ZERO_MCP_ATTRIBUTION_UA_TOKEN"] = context.mcp.attributionUaToken;
|
|
464
485
|
}
|
|
465
486
|
return env;
|
|
466
487
|
}
|
|
467
488
|
};
|
|
468
489
|
|
|
469
490
|
export {
|
|
491
|
+
describeSpawnFailure,
|
|
470
492
|
ProcessRuntime
|
|
471
493
|
};
|