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
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
|
+
const require = __0CreateRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
__commonJS,
|
|
6
|
+
__require
|
|
7
|
+
} from "./chunk-VCSFCHAJ.js";
|
|
8
|
+
|
|
9
|
+
// node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js
|
|
10
|
+
var require_token_error = __commonJS({
|
|
11
|
+
"node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js"(exports, module) {
|
|
12
|
+
"use strict";
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var token_error_exports = {};
|
|
31
|
+
__export(token_error_exports, {
|
|
32
|
+
VercelOidcTokenError: () => VercelOidcTokenError
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(token_error_exports);
|
|
35
|
+
var VercelOidcTokenError = class extends Error {
|
|
36
|
+
constructor(message, cause) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.name = "VercelOidcTokenError";
|
|
39
|
+
this.cause = cause;
|
|
40
|
+
}
|
|
41
|
+
toString() {
|
|
42
|
+
if (this.cause) {
|
|
43
|
+
return `${this.name}: ${this.message}: ${this.cause}`;
|
|
44
|
+
}
|
|
45
|
+
return `${this.name}: ${this.message}`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js
|
|
52
|
+
var require_token_io = __commonJS({
|
|
53
|
+
"node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js"(exports, module) {
|
|
54
|
+
"use strict";
|
|
55
|
+
var __create = Object.create;
|
|
56
|
+
var __defProp = Object.defineProperty;
|
|
57
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
58
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
59
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
60
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
61
|
+
var __export = (target, all) => {
|
|
62
|
+
for (var name in all)
|
|
63
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
64
|
+
};
|
|
65
|
+
var __copyProps = (to, from, except, desc) => {
|
|
66
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
67
|
+
for (let key of __getOwnPropNames(from))
|
|
68
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
69
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
70
|
+
}
|
|
71
|
+
return to;
|
|
72
|
+
};
|
|
73
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
74
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
75
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
76
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
77
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
78
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
79
|
+
mod
|
|
80
|
+
));
|
|
81
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
82
|
+
var token_io_exports = {};
|
|
83
|
+
__export(token_io_exports, {
|
|
84
|
+
findRootDir: () => findRootDir,
|
|
85
|
+
getUserDataDir: () => getUserDataDir
|
|
86
|
+
});
|
|
87
|
+
module.exports = __toCommonJS(token_io_exports);
|
|
88
|
+
var import_path = __toESM(__require("path"));
|
|
89
|
+
var import_fs = __toESM(__require("fs"));
|
|
90
|
+
var import_os = __toESM(__require("os"));
|
|
91
|
+
var import_token_error = require_token_error();
|
|
92
|
+
function findRootDir() {
|
|
93
|
+
try {
|
|
94
|
+
let dir = process.cwd();
|
|
95
|
+
while (dir !== import_path.default.dirname(dir)) {
|
|
96
|
+
const pkgPath = import_path.default.join(dir, ".vercel");
|
|
97
|
+
if (import_fs.default.existsSync(pkgPath)) {
|
|
98
|
+
return dir;
|
|
99
|
+
}
|
|
100
|
+
dir = import_path.default.dirname(dir);
|
|
101
|
+
}
|
|
102
|
+
} catch (e) {
|
|
103
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
104
|
+
"Token refresh only supported in node server environments"
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
function getUserDataDir() {
|
|
110
|
+
if (process.env.XDG_DATA_HOME) {
|
|
111
|
+
return process.env.XDG_DATA_HOME;
|
|
112
|
+
}
|
|
113
|
+
switch (import_os.default.platform()) {
|
|
114
|
+
case "darwin":
|
|
115
|
+
return import_path.default.join(import_os.default.homedir(), "Library/Application Support");
|
|
116
|
+
case "linux":
|
|
117
|
+
return import_path.default.join(import_os.default.homedir(), ".local/share");
|
|
118
|
+
case "win32":
|
|
119
|
+
if (process.env.LOCALAPPDATA) {
|
|
120
|
+
return process.env.LOCALAPPDATA;
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
default:
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js
|
|
131
|
+
var require_auth_config = __commonJS({
|
|
132
|
+
"node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js"(exports, module) {
|
|
133
|
+
"use strict";
|
|
134
|
+
var __create = Object.create;
|
|
135
|
+
var __defProp = Object.defineProperty;
|
|
136
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
137
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
138
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
139
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
140
|
+
var __export = (target, all) => {
|
|
141
|
+
for (var name in all)
|
|
142
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
143
|
+
};
|
|
144
|
+
var __copyProps = (to, from, except, desc) => {
|
|
145
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
146
|
+
for (let key of __getOwnPropNames(from))
|
|
147
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
148
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
149
|
+
}
|
|
150
|
+
return to;
|
|
151
|
+
};
|
|
152
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
153
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
154
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
155
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
156
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
157
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
158
|
+
mod
|
|
159
|
+
));
|
|
160
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
161
|
+
var auth_config_exports = {};
|
|
162
|
+
__export(auth_config_exports, {
|
|
163
|
+
isValidAccessToken: () => isValidAccessToken,
|
|
164
|
+
readAuthConfig: () => readAuthConfig,
|
|
165
|
+
writeAuthConfig: () => writeAuthConfig
|
|
166
|
+
});
|
|
167
|
+
module.exports = __toCommonJS(auth_config_exports);
|
|
168
|
+
var fs = __toESM(__require("fs"));
|
|
169
|
+
var path = __toESM(__require("path"));
|
|
170
|
+
var import_token_util = require_token_util();
|
|
171
|
+
function getAuthConfigPath() {
|
|
172
|
+
const dataDir = (0, import_token_util.getVercelDataDir)();
|
|
173
|
+
if (!dataDir) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
return path.join(dataDir, "auth.json");
|
|
179
|
+
}
|
|
180
|
+
function readAuthConfig() {
|
|
181
|
+
try {
|
|
182
|
+
const authPath = getAuthConfigPath();
|
|
183
|
+
if (!fs.existsSync(authPath)) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const content = fs.readFileSync(authPath, "utf8");
|
|
187
|
+
if (!content) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
return JSON.parse(content);
|
|
191
|
+
} catch (error) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function writeAuthConfig(config) {
|
|
196
|
+
const authPath = getAuthConfigPath();
|
|
197
|
+
const authDir = path.dirname(authPath);
|
|
198
|
+
if (!fs.existsSync(authDir)) {
|
|
199
|
+
fs.mkdirSync(authDir, { mode: 504, recursive: true });
|
|
200
|
+
}
|
|
201
|
+
fs.writeFileSync(authPath, JSON.stringify(config, null, 2), { mode: 384 });
|
|
202
|
+
}
|
|
203
|
+
function isValidAccessToken(authConfig, expirationBufferMs = 0) {
|
|
204
|
+
if (!authConfig.token)
|
|
205
|
+
return false;
|
|
206
|
+
if (typeof authConfig.expiresAt !== "number")
|
|
207
|
+
return true;
|
|
208
|
+
const nowInSeconds = Math.floor(Date.now() / 1e3);
|
|
209
|
+
const bufferInSeconds = expirationBufferMs / 1e3;
|
|
210
|
+
return authConfig.expiresAt >= nowInSeconds + bufferInSeconds;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js
|
|
216
|
+
var require_oauth = __commonJS({
|
|
217
|
+
"node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js"(exports, module) {
|
|
218
|
+
"use strict";
|
|
219
|
+
var __defProp = Object.defineProperty;
|
|
220
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
221
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
222
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
223
|
+
var __export = (target, all) => {
|
|
224
|
+
for (var name in all)
|
|
225
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
226
|
+
};
|
|
227
|
+
var __copyProps = (to, from, except, desc) => {
|
|
228
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
229
|
+
for (let key of __getOwnPropNames(from))
|
|
230
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
231
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
232
|
+
}
|
|
233
|
+
return to;
|
|
234
|
+
};
|
|
235
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
236
|
+
var oauth_exports = {};
|
|
237
|
+
__export(oauth_exports, {
|
|
238
|
+
processTokenResponse: () => processTokenResponse,
|
|
239
|
+
refreshTokenRequest: () => refreshTokenRequest
|
|
240
|
+
});
|
|
241
|
+
module.exports = __toCommonJS(oauth_exports);
|
|
242
|
+
var import_os = __require("os");
|
|
243
|
+
var VERCEL_ISSUER = "https://vercel.com";
|
|
244
|
+
var VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
|
|
245
|
+
var userAgent = `@vercel/oidc node-${process.version} ${(0, import_os.platform)()} (${(0, import_os.arch)()}) ${(0, import_os.hostname)()}`;
|
|
246
|
+
var _tokenEndpoint = null;
|
|
247
|
+
async function getTokenEndpoint() {
|
|
248
|
+
if (_tokenEndpoint) {
|
|
249
|
+
return _tokenEndpoint;
|
|
250
|
+
}
|
|
251
|
+
const discoveryUrl = `${VERCEL_ISSUER}/.well-known/openid-configuration`;
|
|
252
|
+
const response = await fetch(discoveryUrl, {
|
|
253
|
+
headers: { "user-agent": userAgent }
|
|
254
|
+
});
|
|
255
|
+
if (!response.ok) {
|
|
256
|
+
throw new Error("Failed to discover OAuth endpoints");
|
|
257
|
+
}
|
|
258
|
+
const metadata = await response.json();
|
|
259
|
+
if (!metadata || typeof metadata.token_endpoint !== "string") {
|
|
260
|
+
throw new Error("Invalid OAuth discovery response");
|
|
261
|
+
}
|
|
262
|
+
const endpoint = metadata.token_endpoint;
|
|
263
|
+
_tokenEndpoint = endpoint;
|
|
264
|
+
return endpoint;
|
|
265
|
+
}
|
|
266
|
+
async function refreshTokenRequest(options) {
|
|
267
|
+
const tokenEndpoint = await getTokenEndpoint();
|
|
268
|
+
return await fetch(tokenEndpoint, {
|
|
269
|
+
method: "POST",
|
|
270
|
+
headers: {
|
|
271
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
272
|
+
"user-agent": userAgent
|
|
273
|
+
},
|
|
274
|
+
body: new URLSearchParams({
|
|
275
|
+
client_id: VERCEL_CLI_CLIENT_ID,
|
|
276
|
+
grant_type: "refresh_token",
|
|
277
|
+
...options
|
|
278
|
+
})
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
async function processTokenResponse(response) {
|
|
282
|
+
const json = await response.json();
|
|
283
|
+
if (!response.ok) {
|
|
284
|
+
const errorMsg = typeof json === "object" && json && "error" in json ? String(json.error) : "Token refresh failed";
|
|
285
|
+
return [new Error(errorMsg)];
|
|
286
|
+
}
|
|
287
|
+
if (typeof json !== "object" || json === null) {
|
|
288
|
+
return [new Error("Invalid token response")];
|
|
289
|
+
}
|
|
290
|
+
if (typeof json.access_token !== "string") {
|
|
291
|
+
return [new Error("Missing access_token in response")];
|
|
292
|
+
}
|
|
293
|
+
if (json.token_type !== "Bearer") {
|
|
294
|
+
return [new Error("Invalid token_type in response")];
|
|
295
|
+
}
|
|
296
|
+
if (typeof json.expires_in !== "number") {
|
|
297
|
+
return [new Error("Missing expires_in in response")];
|
|
298
|
+
}
|
|
299
|
+
return [null, json];
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js
|
|
305
|
+
var require_auth_errors = __commonJS({
|
|
306
|
+
"node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js"(exports, module) {
|
|
307
|
+
"use strict";
|
|
308
|
+
var __defProp = Object.defineProperty;
|
|
309
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
310
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
311
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
312
|
+
var __export = (target, all) => {
|
|
313
|
+
for (var name in all)
|
|
314
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
315
|
+
};
|
|
316
|
+
var __copyProps = (to, from, except, desc) => {
|
|
317
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
318
|
+
for (let key of __getOwnPropNames(from))
|
|
319
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
320
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
321
|
+
}
|
|
322
|
+
return to;
|
|
323
|
+
};
|
|
324
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
325
|
+
var auth_errors_exports = {};
|
|
326
|
+
__export(auth_errors_exports, {
|
|
327
|
+
AccessTokenMissingError: () => AccessTokenMissingError,
|
|
328
|
+
RefreshAccessTokenFailedError: () => RefreshAccessTokenFailedError
|
|
329
|
+
});
|
|
330
|
+
module.exports = __toCommonJS(auth_errors_exports);
|
|
331
|
+
var AccessTokenMissingError = class extends Error {
|
|
332
|
+
constructor() {
|
|
333
|
+
super(
|
|
334
|
+
"No authentication found. Please log in with the Vercel CLI (vercel login)."
|
|
335
|
+
);
|
|
336
|
+
this.name = "AccessTokenMissingError";
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
var RefreshAccessTokenFailedError = class extends Error {
|
|
340
|
+
constructor(cause) {
|
|
341
|
+
super("Failed to refresh authentication token.", { cause });
|
|
342
|
+
this.name = "RefreshAccessTokenFailedError";
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js
|
|
349
|
+
var require_token_util = __commonJS({
|
|
350
|
+
"node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js"(exports, module) {
|
|
351
|
+
var __create = Object.create;
|
|
352
|
+
var __defProp = Object.defineProperty;
|
|
353
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
354
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
355
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
356
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
357
|
+
var __export = (target, all) => {
|
|
358
|
+
for (var name in all)
|
|
359
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
360
|
+
};
|
|
361
|
+
var __copyProps = (to, from, except, desc) => {
|
|
362
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
363
|
+
for (let key of __getOwnPropNames(from))
|
|
364
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
365
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
366
|
+
}
|
|
367
|
+
return to;
|
|
368
|
+
};
|
|
369
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
370
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
371
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
372
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
373
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
374
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
375
|
+
mod
|
|
376
|
+
));
|
|
377
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
378
|
+
var token_util_exports = {};
|
|
379
|
+
__export(token_util_exports, {
|
|
380
|
+
assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,
|
|
381
|
+
findProjectInfo: () => findProjectInfo,
|
|
382
|
+
getTokenPayload: () => getTokenPayload,
|
|
383
|
+
getVercelDataDir: () => getVercelDataDir,
|
|
384
|
+
getVercelOidcToken: () => getVercelOidcToken,
|
|
385
|
+
getVercelToken: () => getVercelToken,
|
|
386
|
+
isExpired: () => isExpired,
|
|
387
|
+
loadToken: () => loadToken,
|
|
388
|
+
saveToken: () => saveToken
|
|
389
|
+
});
|
|
390
|
+
module.exports = __toCommonJS(token_util_exports);
|
|
391
|
+
var path = __toESM(__require("path"));
|
|
392
|
+
var fs = __toESM(__require("fs"));
|
|
393
|
+
var import_token_error = require_token_error();
|
|
394
|
+
var import_token_io = require_token_io();
|
|
395
|
+
var import_auth_config = require_auth_config();
|
|
396
|
+
var import_oauth = require_oauth();
|
|
397
|
+
var import_auth_errors = require_auth_errors();
|
|
398
|
+
function getVercelDataDir() {
|
|
399
|
+
const vercelFolder = "com.vercel.cli";
|
|
400
|
+
const dataDir = (0, import_token_io.getUserDataDir)();
|
|
401
|
+
if (!dataDir) {
|
|
402
|
+
return null;
|
|
403
|
+
}
|
|
404
|
+
return path.join(dataDir, vercelFolder);
|
|
405
|
+
}
|
|
406
|
+
async function getVercelToken(options) {
|
|
407
|
+
const authConfig = (0, import_auth_config.readAuthConfig)();
|
|
408
|
+
if (!authConfig?.token) {
|
|
409
|
+
throw new import_auth_errors.AccessTokenMissingError();
|
|
410
|
+
}
|
|
411
|
+
if ((0, import_auth_config.isValidAccessToken)(authConfig, options?.expirationBufferMs)) {
|
|
412
|
+
return authConfig.token;
|
|
413
|
+
}
|
|
414
|
+
if (!authConfig.refreshToken) {
|
|
415
|
+
(0, import_auth_config.writeAuthConfig)({});
|
|
416
|
+
throw new import_auth_errors.RefreshAccessTokenFailedError("No refresh token available");
|
|
417
|
+
}
|
|
418
|
+
try {
|
|
419
|
+
const tokenResponse = await (0, import_oauth.refreshTokenRequest)({
|
|
420
|
+
refresh_token: authConfig.refreshToken
|
|
421
|
+
});
|
|
422
|
+
const [tokensError, tokens] = await (0, import_oauth.processTokenResponse)(tokenResponse);
|
|
423
|
+
if (tokensError || !tokens) {
|
|
424
|
+
(0, import_auth_config.writeAuthConfig)({});
|
|
425
|
+
throw new import_auth_errors.RefreshAccessTokenFailedError(tokensError);
|
|
426
|
+
}
|
|
427
|
+
const updatedConfig = {
|
|
428
|
+
token: tokens.access_token,
|
|
429
|
+
expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in
|
|
430
|
+
};
|
|
431
|
+
if (tokens.refresh_token) {
|
|
432
|
+
updatedConfig.refreshToken = tokens.refresh_token;
|
|
433
|
+
}
|
|
434
|
+
(0, import_auth_config.writeAuthConfig)(updatedConfig);
|
|
435
|
+
return updatedConfig.token;
|
|
436
|
+
} catch (error) {
|
|
437
|
+
(0, import_auth_config.writeAuthConfig)({});
|
|
438
|
+
if (error instanceof import_auth_errors.AccessTokenMissingError || error instanceof import_auth_errors.RefreshAccessTokenFailedError) {
|
|
439
|
+
throw error;
|
|
440
|
+
}
|
|
441
|
+
throw new import_auth_errors.RefreshAccessTokenFailedError(error);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
async function getVercelOidcToken(authToken, projectId, teamId) {
|
|
445
|
+
const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : ""}`;
|
|
446
|
+
const res = await fetch(url, {
|
|
447
|
+
method: "POST",
|
|
448
|
+
headers: {
|
|
449
|
+
Authorization: `Bearer ${authToken}`
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
if (!res.ok) {
|
|
453
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
454
|
+
`Failed to refresh OIDC token: ${res.statusText}`
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
const tokenRes = await res.json();
|
|
458
|
+
assertVercelOidcTokenResponse(tokenRes);
|
|
459
|
+
return tokenRes;
|
|
460
|
+
}
|
|
461
|
+
function assertVercelOidcTokenResponse(res) {
|
|
462
|
+
if (!res || typeof res !== "object") {
|
|
463
|
+
throw new TypeError(
|
|
464
|
+
"Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again"
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
if (!("token" in res) || typeof res.token !== "string") {
|
|
468
|
+
throw new TypeError(
|
|
469
|
+
"Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again"
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
function findProjectInfo() {
|
|
474
|
+
const dir = (0, import_token_io.findRootDir)();
|
|
475
|
+
if (!dir) {
|
|
476
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
477
|
+
"Unable to find project root directory. Have you linked your project with `vc link?`"
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
const prjPath = path.join(dir, ".vercel", "project.json");
|
|
481
|
+
if (!fs.existsSync(prjPath)) {
|
|
482
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
483
|
+
"project.json not found, have you linked your project with `vc link?`"
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
const prj = JSON.parse(fs.readFileSync(prjPath, "utf8"));
|
|
487
|
+
if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
|
|
488
|
+
throw new TypeError(
|
|
489
|
+
"Expected a string-valued projectId property. Try running `vc link` to re-link your project."
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
return { projectId: prj.projectId, teamId: prj.orgId };
|
|
493
|
+
}
|
|
494
|
+
function saveToken(token, projectId) {
|
|
495
|
+
const dir = (0, import_token_io.getUserDataDir)();
|
|
496
|
+
if (!dir) {
|
|
497
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
498
|
+
"Unable to find user data directory. Please reach out to Vercel support."
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
502
|
+
const tokenJson = JSON.stringify(token);
|
|
503
|
+
fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });
|
|
504
|
+
fs.writeFileSync(tokenPath, tokenJson);
|
|
505
|
+
fs.chmodSync(tokenPath, 432);
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
function loadToken(projectId) {
|
|
509
|
+
const dir = (0, import_token_io.getUserDataDir)();
|
|
510
|
+
if (!dir) {
|
|
511
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
512
|
+
"Unable to find user data directory. Please reach out to Vercel support."
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
516
|
+
if (!fs.existsSync(tokenPath)) {
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
const token = JSON.parse(fs.readFileSync(tokenPath, "utf8"));
|
|
520
|
+
assertVercelOidcTokenResponse(token);
|
|
521
|
+
return token;
|
|
522
|
+
}
|
|
523
|
+
function getTokenPayload(token) {
|
|
524
|
+
const tokenParts = token.split(".");
|
|
525
|
+
if (tokenParts.length !== 3) {
|
|
526
|
+
throw new import_token_error.VercelOidcTokenError(
|
|
527
|
+
"Invalid token. Please run `vc env pull` and try again"
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
const base64 = tokenParts[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
531
|
+
const padded = base64.padEnd(
|
|
532
|
+
base64.length + (4 - base64.length % 4) % 4,
|
|
533
|
+
"="
|
|
534
|
+
);
|
|
535
|
+
return JSON.parse(Buffer.from(padded, "base64").toString("utf8"));
|
|
536
|
+
}
|
|
537
|
+
function isExpired(token, bufferMs = 0) {
|
|
538
|
+
return token.exp * 1e3 < Date.now() + bufferMs;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
export {
|
|
544
|
+
require_token_error,
|
|
545
|
+
require_auth_errors,
|
|
546
|
+
require_token_util
|
|
547
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
|
5
5
|
// packages/core/dist/kernel/exploit/recipes.js
|
|
6
6
|
var RECIPE_LIBRARY = [
|
|
@@ -160,12 +160,12 @@ var RECIPE_LIBRARY = [
|
|
|
160
160
|
"hardened / KASLR-ON root needs a companion kernel-TEXT infoleak: the physmap leak (MODE_LEAK) recovers page_offset_base (defeats RANDOMIZE_MEMORY) but NOT .text, so commit_creds's slid address is still unknown without a paired text leak",
|
|
161
161
|
"needs the spray to share a cache with the victim (MEMCG off, or an accounted spray for a -cg- victim) \u2014 verify the bucket match"
|
|
162
162
|
],
|
|
163
|
-
citation: "
|
|
163
|
+
citation: "0 hid-sony ghl_poke_timer UAF \u2192 LPE (fake-cred one-shot, 9/9 root); DirtyCred-family credential forge without arbitrary R/W"
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
id: "workqueueBounceRoot",
|
|
167
167
|
title: "timer-UAF \u2192 forge-pwq \u2192 kworker process-context bounce \u2192 WWW \u2192 modprobe_path",
|
|
168
|
-
// The GuitarZero full clean chain (
|
|
168
|
+
// The GuitarZero full clean chain (0#1215): the poison-tolerant, no-arb-
|
|
169
169
|
// read sibling of fakeCredOneShot. Where the one-shot fires commit_creds in a
|
|
170
170
|
// softirq (fatal-fault on any miss), this bounces into PROCESS context via a
|
|
171
171
|
// real kworker, so a survivable WWW gadget can overwrite modprobe_path and a
|
|
@@ -193,7 +193,7 @@ var RECIPE_LIBRARY = [
|
|
|
193
193
|
"EntryBleed (CVE-2022-4543) supplies the text base bare-metal; it is marginal on a virtualized-TSC (KVM) box (rdtscp buries the prefetch delta) \u2014 supply the base via a companion leak there",
|
|
194
194
|
"one probabilistic reoccupy race per boot (~2/3; ~96% within 3 boots); a miss bakes clockevents_handle_noop (endbr64;ret) so the box stays ALIVE for retry"
|
|
195
195
|
],
|
|
196
|
-
citation: "
|
|
196
|
+
citation: "0 hid-sony ghl_poke_timer UAF \u2192 clean unprivileged LPE (/root/ghl-clean/ghl_lpe_clean.c, uid=0 5/7 boots; /root/ghl-full FULL-ROOT); EntryBleed CVE-2022-4543"
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
id: "fileOpsVtableConfusion",
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
|
5
5
|
// packages/core/dist/adgraph/paths.js
|
|
6
6
|
var AD_EDGE_TECHNIQUES = {
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
bufferToString
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4VGLO2YS.js";
|
|
7
7
|
|
|
8
8
|
// packages/core/dist/prepare.js
|
|
9
9
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
@@ -326,7 +326,7 @@ function restoreNpmFixtureOrThrow(packageName, tempDir, msg, emit) {
|
|
|
326
326
|
throw new Error(msg);
|
|
327
327
|
}
|
|
328
328
|
function installNpmPackage(packageName, requestedVersion, emit) {
|
|
329
|
-
const tempDir = join2(tmpdir(), `
|
|
329
|
+
const tempDir = join2(tmpdir(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
330
330
|
mkdirSync2(tempDir, { recursive: true });
|
|
331
331
|
const spec = requestedVersion ? `${packageName}@${requestedVersion}` : `${packageName}@latest`;
|
|
332
332
|
emit({ type: "stage:start", stage: "discovery", message: `Installing ${spec}...` });
|
|
@@ -493,7 +493,7 @@ if not choices:
|
|
|
493
493
|
choice = choices[0]
|
|
494
494
|
filename = choice.get("filename") or pathlib.PurePosixPath(urllib.parse.urlparse(choice["url"]).path).name
|
|
495
495
|
archive_path = download_dir / filename
|
|
496
|
-
request = urllib.request.Request(choice["url"], headers={"User-Agent": "
|
|
496
|
+
request = urllib.request.Request(choice["url"], headers={"User-Agent": "0-ci/0.1 (+https://github.com/0sec-labs/0)"})
|
|
497
497
|
with urllib.request.urlopen(request, timeout=120) as response, archive_path.open("wb") as handle:
|
|
498
498
|
handle.write(response.read())
|
|
499
499
|
|
|
@@ -507,7 +507,7 @@ print(json.dumps({"archivePath": str(archive_path), "resolvedVersion": metadata.
|
|
|
507
507
|
return JSON.parse(rawOutput);
|
|
508
508
|
}
|
|
509
509
|
function installPypiPackage(packageName, requestedVersion, emit) {
|
|
510
|
-
const tempDir = join2(tmpdir(), `
|
|
510
|
+
const tempDir = join2(tmpdir(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
511
511
|
const downloadDir = join2(tempDir, "downloads");
|
|
512
512
|
const extractDir = join2(tempDir, "src");
|
|
513
513
|
mkdirSync2(downloadDir, { recursive: true });
|
|
@@ -569,7 +569,7 @@ function resolveCargoVersion(packageName, requestedVersion) {
|
|
|
569
569
|
return parsed.crate?.max_stable_version ?? parsed.crate?.max_version ?? parsed.crate?.newest_version ?? "latest";
|
|
570
570
|
}
|
|
571
571
|
function installCargoPackage(packageName, requestedVersion, emit) {
|
|
572
|
-
const tempDir = join2(tmpdir(), `
|
|
572
|
+
const tempDir = join2(tmpdir(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
573
573
|
const downloadDir = join2(tempDir, "downloads");
|
|
574
574
|
const extractDir = join2(tempDir, "src");
|
|
575
575
|
mkdirSync2(downloadDir, { recursive: true });
|
|
@@ -602,7 +602,7 @@ function installCargoPackage(packageName, requestedVersion, emit) {
|
|
|
602
602
|
resolvedVersion = match?.[1] ?? version;
|
|
603
603
|
}
|
|
604
604
|
writeFileSync2(join2(tempDir, "Cargo.toml"), `[package]
|
|
605
|
-
name = "
|
|
605
|
+
name = "0-cargo-audit"
|
|
606
606
|
version = "0.1.0"
|
|
607
607
|
edition = "2021"
|
|
608
608
|
|
|
@@ -639,7 +639,7 @@ function buildCratesIoCurlArgs(url) {
|
|
|
639
639
|
"--connect-timeout",
|
|
640
640
|
"20",
|
|
641
641
|
"-H",
|
|
642
|
-
"User-Agent:
|
|
642
|
+
"User-Agent: 0-ci/0.1 (+https://github.com/0sec-labs/0)",
|
|
643
643
|
url
|
|
644
644
|
];
|
|
645
645
|
}
|
|
@@ -736,7 +736,7 @@ for layer in layers:
|
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
738
|
function installOciImage(rawImageRef, requestedVersion, emit) {
|
|
739
|
-
const tempDir = join2(tmpdir(), `
|
|
739
|
+
const tempDir = join2(tmpdir(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
740
740
|
const rootfsDir = join2(tempDir, "rootfs");
|
|
741
741
|
const exportTar = join2(tempDir, "image.tar");
|
|
742
742
|
mkdirSync2(rootfsDir, { recursive: true });
|
|
@@ -926,7 +926,7 @@ async function probePublicNpmRegistry(packageName, opts = {}) {
|
|
|
926
926
|
const timer = setTimeout(() => controller.abort(), opts.timeoutMs ?? 15e3);
|
|
927
927
|
try {
|
|
928
928
|
const res = await fetchImpl(url, {
|
|
929
|
-
headers: { Accept: "application/json", "User-Agent": "
|
|
929
|
+
headers: { Accept: "application/json", "User-Agent": "0-supply-chain/0.1" },
|
|
930
930
|
signal: controller.signal
|
|
931
931
|
});
|
|
932
932
|
if (res.status === 404)
|
|
@@ -1003,7 +1003,7 @@ function resolveRepo(repo, emit) {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
return { repoPath: absPath, cloned: false };
|
|
1005
1005
|
}
|
|
1006
|
-
const tempDir = join3(tmpdir2(), `
|
|
1006
|
+
const tempDir = join3(tmpdir2(), `0-review-${randomUUID2().slice(0, 8)}`);
|
|
1007
1007
|
mkdirSync3(tempDir, { recursive: true });
|
|
1008
1008
|
emit({
|
|
1009
1009
|
type: "stage:start",
|