just-bash 2.12.0 → 2.12.2
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/dist/Bash.d.ts +5 -0
- package/dist/bin/chunks/{awk2-YRDDZZBN.js → awk2-ZE5HJBNV.js} +1 -1
- package/dist/bin/chunks/chunk-253LRF5J.js +11 -0
- package/dist/bin/chunks/chunk-2BC3N3L2.js +16 -0
- package/dist/bin/chunks/chunk-2FFXXW3F.js +14 -0
- package/dist/bin/chunks/{chunk-D2VMRCQU.js → chunk-35JD7YEM.js} +12 -12
- package/dist/bin/chunks/chunk-435ZOZCY.js +63 -0
- package/dist/bin/{shell/chunks/chunk-JXC25GVQ.js → chunks/chunk-47HZU3SY.js} +1 -1
- package/dist/bin/chunks/chunk-4FNW6LFM.js +5 -0
- package/dist/bin/chunks/chunk-4OALHZXB.js +2 -0
- package/dist/bin/chunks/chunk-4PZYIYYG.js +36 -0
- package/dist/bin/chunks/{chunk-HA4QZ6XJ.js → chunk-DREQRXNN.js} +4 -4
- package/dist/bin/chunks/chunk-IYZRLSTQ.js +2 -0
- package/dist/bin/chunks/chunk-JJHAWOIB.js +2 -0
- package/dist/bin/chunks/{chunk-F37UEO7A.js → chunk-JNPUO56K.js} +1 -1
- package/dist/bin/chunks/{chunk-DAGNL3F2.js → chunk-MZKPWGID.js} +24 -24
- package/dist/bin/chunks/chunk-N4EU64Y4.js +9 -0
- package/dist/bin/chunks/{chunk-CPL5P744.js → chunk-OKL2SPHK.js} +32 -32
- package/dist/bin/chunks/{chunk-6SAF32NO.js → chunk-VZKEP45B.js} +13 -13
- package/dist/bin/chunks/env-HOVBNLUR.js +2 -0
- package/dist/bin/chunks/{expansion-HLAOHDFJ.js → expansion-TCB3WZP5.js} +1 -1
- package/dist/bin/chunks/find-4YAO7JQS.js +2 -0
- package/dist/bin/chunks/flag-coverage-LQ37DA4R.js +2 -0
- package/dist/bin/chunks/{gzip-EENEW6WQ.js → gzip-RQ5RIFJV.js} +1 -1
- package/dist/bin/chunks/help-4H52JYYC.js +2 -0
- package/dist/bin/chunks/python3-74B25WCY.js +17 -0
- package/dist/bin/chunks/rg-34GE6REQ.js +2 -0
- package/dist/bin/{shell/chunks/sleep-RA6DYTJX.js → chunks/sleep-GUJH2AMQ.js} +1 -1
- package/dist/bin/chunks/sqlite3-57UI7HYL.js +2 -0
- package/dist/bin/chunks/{tar-GP2CCB47.js → tar-VIYVHMER.js} +1 -1
- package/dist/bin/chunks/time-FAWHHOMA.js +2 -0
- package/dist/bin/chunks/timeout-4O4YYRTS.js +2 -0
- package/dist/bin/chunks/worker.js +154 -4
- package/dist/bin/{shell/chunks/xargs-YWPEV2QC.js → chunks/xargs-GBL6PZ2K.js} +1 -1
- package/dist/bin/just-bash.js +255 -255
- package/dist/bin/shell/chunks/{awk2-YRDDZZBN.js → awk2-ZE5HJBNV.js} +1 -1
- package/dist/bin/shell/chunks/chunk-253LRF5J.js +11 -0
- package/dist/bin/shell/chunks/chunk-2BC3N3L2.js +16 -0
- package/dist/bin/shell/chunks/chunk-2FFXXW3F.js +14 -0
- package/dist/bin/shell/chunks/{chunk-D2VMRCQU.js → chunk-35JD7YEM.js} +12 -12
- package/dist/bin/shell/chunks/chunk-435ZOZCY.js +63 -0
- package/dist/bin/{chunks/chunk-JXC25GVQ.js → shell/chunks/chunk-47HZU3SY.js} +1 -1
- package/dist/bin/shell/chunks/chunk-4FNW6LFM.js +5 -0
- package/dist/bin/shell/chunks/chunk-4OALHZXB.js +2 -0
- package/dist/bin/shell/chunks/chunk-4PZYIYYG.js +36 -0
- package/dist/bin/shell/chunks/{chunk-HA4QZ6XJ.js → chunk-DREQRXNN.js} +4 -4
- package/dist/bin/shell/chunks/chunk-IYZRLSTQ.js +2 -0
- package/dist/bin/shell/chunks/chunk-JJHAWOIB.js +2 -0
- package/dist/bin/shell/chunks/{chunk-F37UEO7A.js → chunk-JNPUO56K.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-DAGNL3F2.js → chunk-MZKPWGID.js} +24 -24
- package/dist/bin/shell/chunks/chunk-N4EU64Y4.js +9 -0
- package/dist/bin/shell/chunks/{chunk-CPL5P744.js → chunk-OKL2SPHK.js} +32 -32
- package/dist/bin/shell/chunks/{chunk-6SAF32NO.js → chunk-VZKEP45B.js} +13 -13
- package/dist/bin/shell/chunks/env-HOVBNLUR.js +2 -0
- package/dist/bin/shell/chunks/{expansion-HLAOHDFJ.js → expansion-TCB3WZP5.js} +1 -1
- package/dist/bin/shell/chunks/find-4YAO7JQS.js +2 -0
- package/dist/bin/shell/chunks/flag-coverage-LQ37DA4R.js +2 -0
- package/dist/bin/shell/chunks/{gzip-EENEW6WQ.js → gzip-RQ5RIFJV.js} +1 -1
- package/dist/bin/shell/chunks/help-4H52JYYC.js +2 -0
- package/dist/bin/shell/chunks/python3-74B25WCY.js +17 -0
- package/dist/bin/shell/chunks/rg-34GE6REQ.js +2 -0
- package/dist/bin/{chunks/sleep-RA6DYTJX.js → shell/chunks/sleep-GUJH2AMQ.js} +1 -1
- package/dist/bin/shell/chunks/sqlite3-57UI7HYL.js +2 -0
- package/dist/bin/shell/chunks/{tar-GP2CCB47.js → tar-VIYVHMER.js} +1 -1
- package/dist/bin/shell/chunks/time-FAWHHOMA.js +2 -0
- package/dist/bin/shell/chunks/timeout-4O4YYRTS.js +2 -0
- package/dist/bin/{chunks/xargs-YWPEV2QC.js → shell/chunks/xargs-GBL6PZ2K.js} +1 -1
- package/dist/bin/shell/shell.js +252 -252
- package/dist/bundle/browser.js +748 -747
- package/dist/bundle/chunks/{awk2-66MVVLQI.js → awk2-T6LHPVZE.js} +1 -1
- package/dist/bundle/chunks/chunk-2GOYXRRP.js +15 -0
- package/dist/bundle/chunks/chunk-3RA5L262.js +8 -0
- package/dist/bundle/chunks/{chunk-CCCK5QHL.js → chunk-4VCAQZKQ.js} +32 -32
- package/dist/bundle/chunks/chunk-5CJQNRNJ.js +62 -0
- package/dist/bundle/chunks/{chunk-VFBZTF5G.js → chunk-7BQDVPII.js} +1 -1
- package/dist/bundle/chunks/chunk-7KHLIOOW.js +4 -0
- package/dist/bundle/chunks/{chunk-RARYJBGX.js → chunk-BAAVD5NO.js} +13 -13
- package/dist/bundle/chunks/chunk-BEFDX7IY.js +1 -0
- package/dist/bundle/chunks/{chunk-DZ33S2U7.js → chunk-FO655G4V.js} +24 -24
- package/dist/bundle/chunks/chunk-IPJHKYVM.js +1 -0
- package/dist/bundle/chunks/chunk-NBAARP4B.js +1 -0
- package/dist/bundle/chunks/{chunk-FJNVFD75.js → chunk-OKEHYWBE.js} +12 -12
- package/dist/bundle/chunks/chunk-RHOPHAL6.js +35 -0
- package/dist/bundle/chunks/{chunk-S7ED3RD5.js → chunk-UJIR5V54.js} +4 -4
- package/dist/bundle/chunks/chunk-YCABLDKV.js +10 -0
- package/dist/bundle/chunks/chunk-YIY2RKBW.js +13 -0
- package/dist/bundle/chunks/{chunk-SXR3EI72.js → chunk-ZSJYNBAF.js} +1 -1
- package/dist/bundle/chunks/env-XZY4LKEO.js +1 -0
- package/dist/bundle/chunks/{expansion-GY7U2FC2.js → expansion-HJ6B4DDG.js} +1 -1
- package/dist/bundle/chunks/find-DQFMWHAC.js +1 -0
- package/dist/bundle/chunks/{flag-coverage-25MQKYJJ.js → flag-coverage-MPLWXQQK.js} +1 -1
- package/dist/bundle/chunks/{gzip-UTSGNF5Z.js → gzip-Y4N2UKE7.js} +1 -1
- package/dist/bundle/chunks/help-IA5CMGR4.js +1 -0
- package/dist/bundle/chunks/python3-6BKA3FYA.js +16 -0
- package/dist/bundle/chunks/rg-RAICUFGG.js +1 -0
- package/dist/bundle/chunks/{sleep-RKLUWJ7F.js → sleep-LB7FI6AB.js} +1 -1
- package/dist/bundle/chunks/sqlite3-FVNA4KNF.js +1 -0
- package/dist/bundle/chunks/{tar-H6XTXOAP.js → tar-E2DVQEWO.js} +1 -1
- package/dist/bundle/chunks/time-AGNW2ZY6.js +1 -0
- package/dist/bundle/chunks/timeout-VN35D5O7.js +1 -0
- package/dist/bundle/chunks/worker.js +154 -4
- package/dist/bundle/chunks/{xargs-OGI2NN6J.js → xargs-2BBAQDTC.js} +1 -1
- package/dist/bundle/index.cjs +817 -815
- package/dist/bundle/index.js +263 -263
- package/dist/commands/python3/fs-bridge-handler.d.ts +5 -1
- package/dist/commands/sqlite3/sqlite3.d.ts +6 -0
- package/dist/commands/tar/tar-options.d.ts +1 -0
- package/dist/interpreter/helpers/result.d.ts +6 -0
- package/dist/interpreter/interpreter.d.ts +2 -0
- package/dist/interpreter/types.d.ts +2 -0
- package/dist/limits.d.ts +2 -0
- package/dist/network/types.d.ts +1 -1
- package/dist/sandbox/Command.d.ts +8 -1
- package/dist/sandbox/Sandbox.d.ts +1 -0
- package/dist/timers.d.ts +1 -0
- package/dist/types.d.ts +12 -0
- package/package.json +1 -1
- package/dist/bin/chunks/chunk-27KQPTIX.js +0 -36
- package/dist/bin/chunks/chunk-4QM2TCNV.js +0 -2
- package/dist/bin/chunks/chunk-5UH3Q7QT.js +0 -11
- package/dist/bin/chunks/chunk-KLMOJKL4.js +0 -16
- package/dist/bin/chunks/chunk-KTFEQPO7.js +0 -4
- package/dist/bin/chunks/chunk-N73TVRMN.js +0 -14
- package/dist/bin/chunks/chunk-QC46PWBQ.js +0 -63
- package/dist/bin/chunks/chunk-W2FKF3MM.js +0 -9
- package/dist/bin/chunks/chunk-WIWKAGK6.js +0 -2
- package/dist/bin/chunks/env-EVLPSWFF.js +0 -2
- package/dist/bin/chunks/find-PHHSZYDL.js +0 -2
- package/dist/bin/chunks/flag-coverage-GZCUF7B4.js +0 -2
- package/dist/bin/chunks/help-JF5TTAKQ.js +0 -2
- package/dist/bin/chunks/python3-XRP5IZRL.js +0 -16
- package/dist/bin/chunks/rg-EJJ3ILD5.js +0 -2
- package/dist/bin/chunks/sqlite3-2UNB5OLS.js +0 -2
- package/dist/bin/chunks/time-4C3A4THJ.js +0 -2
- package/dist/bin/chunks/timeout-QMKFLOWX.js +0 -2
- package/dist/bin/shell/chunks/chunk-27KQPTIX.js +0 -36
- package/dist/bin/shell/chunks/chunk-4QM2TCNV.js +0 -2
- package/dist/bin/shell/chunks/chunk-5UH3Q7QT.js +0 -11
- package/dist/bin/shell/chunks/chunk-KLMOJKL4.js +0 -16
- package/dist/bin/shell/chunks/chunk-KTFEQPO7.js +0 -4
- package/dist/bin/shell/chunks/chunk-N73TVRMN.js +0 -14
- package/dist/bin/shell/chunks/chunk-QC46PWBQ.js +0 -63
- package/dist/bin/shell/chunks/chunk-W2FKF3MM.js +0 -9
- package/dist/bin/shell/chunks/chunk-WIWKAGK6.js +0 -2
- package/dist/bin/shell/chunks/env-EVLPSWFF.js +0 -2
- package/dist/bin/shell/chunks/find-PHHSZYDL.js +0 -2
- package/dist/bin/shell/chunks/flag-coverage-GZCUF7B4.js +0 -2
- package/dist/bin/shell/chunks/help-JF5TTAKQ.js +0 -2
- package/dist/bin/shell/chunks/python3-XRP5IZRL.js +0 -16
- package/dist/bin/shell/chunks/rg-EJJ3ILD5.js +0 -2
- package/dist/bin/shell/chunks/sqlite3-2UNB5OLS.js +0 -2
- package/dist/bin/shell/chunks/time-4C3A4THJ.js +0 -2
- package/dist/bin/shell/chunks/timeout-QMKFLOWX.js +0 -2
- package/dist/bundle/chunks/chunk-73RYQHTW.js +0 -10
- package/dist/bundle/chunks/chunk-CSBFBYLD.js +0 -13
- package/dist/bundle/chunks/chunk-FPGA7RT4.js +0 -62
- package/dist/bundle/chunks/chunk-K4OVSVUA.js +0 -35
- package/dist/bundle/chunks/chunk-LEOLL6PF.js +0 -1
- package/dist/bundle/chunks/chunk-OGDTSM2Q.js +0 -8
- package/dist/bundle/chunks/chunk-R7KYILVY.js +0 -3
- package/dist/bundle/chunks/chunk-YYAPW4OA.js +0 -1
- package/dist/bundle/chunks/chunk-ZKLK6C7H.js +0 -15
- package/dist/bundle/chunks/env-S547XMN7.js +0 -1
- package/dist/bundle/chunks/find-6U6YYAEP.js +0 -1
- package/dist/bundle/chunks/help-T2NGLTSG.js +0 -1
- package/dist/bundle/chunks/python3-E7VF6UYO.js +0 -15
- package/dist/bundle/chunks/rg-4YNHHQAE.js +0 -1
- package/dist/bundle/chunks/sqlite3-TLIZUW3F.js +0 -1
- package/dist/bundle/chunks/time-BPT76IHZ.js +0 -1
- package/dist/bundle/chunks/timeout-QDZFJCOQ.js +0 -1
|
@@ -277,9 +277,80 @@ function getBlockedGlobals() {
|
|
|
277
277
|
violationType: "atomics",
|
|
278
278
|
strategy: "throw",
|
|
279
279
|
reason: "Atomics could enable side-channel communication or timing attacks"
|
|
280
|
-
}
|
|
280
|
+
},
|
|
281
281
|
// Note: Error.prepareStackTrace is handled specially in defense-in-depth-box.ts
|
|
282
282
|
// because we only want to block SETTING it, not reading (V8 reads it internally)
|
|
283
|
+
// Timing side-channel: performance.now() provides sub-millisecond resolution
|
|
284
|
+
// Note: Date.now() is intentionally NOT blocked — it's used for $SECONDS,
|
|
285
|
+
// date command, and has only ~1ms resolution (vs process.hrtime at ns).
|
|
286
|
+
{
|
|
287
|
+
prop: "performance",
|
|
288
|
+
target: globalThis,
|
|
289
|
+
violationType: "performance_timing",
|
|
290
|
+
strategy: "throw",
|
|
291
|
+
reason: "performance.now() provides sub-millisecond timing for side-channel attacks"
|
|
292
|
+
},
|
|
293
|
+
// Block direct access to process.stdout and process.stderr to prevent
|
|
294
|
+
// writing to the host's actual stdout/stderr, bypassing the interpreter's
|
|
295
|
+
// output accumulation.
|
|
296
|
+
{
|
|
297
|
+
prop: "stdout",
|
|
298
|
+
target: process,
|
|
299
|
+
violationType: "process_stdout",
|
|
300
|
+
strategy: "throw",
|
|
301
|
+
reason: "process.stdout could bypass interpreter output to write to host stdout"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
prop: "stderr",
|
|
305
|
+
target: process,
|
|
306
|
+
violationType: "process_stderr",
|
|
307
|
+
strategy: "throw",
|
|
308
|
+
reason: "process.stderr could bypass interpreter output to write to host stderr"
|
|
309
|
+
},
|
|
310
|
+
// Prototype pollution vectors
|
|
311
|
+
{
|
|
312
|
+
prop: "__defineGetter__",
|
|
313
|
+
target: Object.prototype,
|
|
314
|
+
violationType: "prototype_mutation",
|
|
315
|
+
strategy: "throw",
|
|
316
|
+
reason: "__defineGetter__ allows prototype pollution via getter injection"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
prop: "__defineSetter__",
|
|
320
|
+
target: Object.prototype,
|
|
321
|
+
violationType: "prototype_mutation",
|
|
322
|
+
strategy: "throw",
|
|
323
|
+
reason: "__defineSetter__ allows prototype pollution via setter injection"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
prop: "__lookupGetter__",
|
|
327
|
+
target: Object.prototype,
|
|
328
|
+
violationType: "prototype_mutation",
|
|
329
|
+
strategy: "throw",
|
|
330
|
+
reason: "__lookupGetter__ enables introspection for prototype pollution attacks"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
prop: "__lookupSetter__",
|
|
334
|
+
target: Object.prototype,
|
|
335
|
+
violationType: "prototype_mutation",
|
|
336
|
+
strategy: "throw",
|
|
337
|
+
reason: "__lookupSetter__ enables introspection for prototype pollution attacks"
|
|
338
|
+
},
|
|
339
|
+
// Freeze JSON and Math to prevent mutation of built-in utility objects
|
|
340
|
+
{
|
|
341
|
+
prop: "JSON",
|
|
342
|
+
target: globalThis,
|
|
343
|
+
violationType: "json_mutation",
|
|
344
|
+
strategy: "freeze",
|
|
345
|
+
reason: "Freeze JSON to prevent mutation of parsing/serialization"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
prop: "Math",
|
|
349
|
+
target: globalThis,
|
|
350
|
+
violationType: "math_mutation",
|
|
351
|
+
strategy: "freeze",
|
|
352
|
+
reason: "Freeze Math to prevent mutation of math utilities"
|
|
353
|
+
}
|
|
283
354
|
];
|
|
284
355
|
try {
|
|
285
356
|
const AsyncFunction = Object.getPrototypeOf(async () => {
|
|
@@ -650,6 +721,9 @@ var WorkerDefenseInDepth = class {
|
|
|
650
721
|
if (!excludeTypes.has("module_load")) {
|
|
651
722
|
this.protectModuleLoad();
|
|
652
723
|
}
|
|
724
|
+
if (!excludeTypes.has("module_resolve_filename")) {
|
|
725
|
+
this.protectModuleResolveFilename();
|
|
726
|
+
}
|
|
653
727
|
if (!excludeTypes.has("process_main_module")) {
|
|
654
728
|
this.protectProcessMainModule();
|
|
655
729
|
}
|
|
@@ -1065,6 +1139,65 @@ var WorkerDefenseInDepth = class {
|
|
|
1065
1139
|
} catch {
|
|
1066
1140
|
}
|
|
1067
1141
|
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Protect Module._resolveFilename from being called in worker context.
|
|
1144
|
+
*
|
|
1145
|
+
* Module._resolveFilename is called for both require() and import() resolution.
|
|
1146
|
+
* Blocking it catches file-based import() specifiers.
|
|
1147
|
+
*
|
|
1148
|
+
* data: and blob: URLs are handled by ESM loader hooks registered
|
|
1149
|
+
* in the main thread (DefenseInDepthBox.protectDynamicImport).
|
|
1150
|
+
*/
|
|
1151
|
+
protectModuleResolveFilename() {
|
|
1152
|
+
const self = this;
|
|
1153
|
+
const auditMode = this.config.auditMode;
|
|
1154
|
+
try {
|
|
1155
|
+
let ModuleClass = null;
|
|
1156
|
+
if (typeof process !== "undefined") {
|
|
1157
|
+
const mainModule = process.mainModule;
|
|
1158
|
+
if (mainModule && typeof mainModule === "object") {
|
|
1159
|
+
ModuleClass = mainModule.constructor;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
if (!ModuleClass && typeof __require !== "undefined" && typeof __require.main !== "undefined") {
|
|
1163
|
+
ModuleClass = __require.main.constructor;
|
|
1164
|
+
}
|
|
1165
|
+
if (!ModuleClass || typeof ModuleClass._resolveFilename !== "function") {
|
|
1166
|
+
return;
|
|
1167
|
+
}
|
|
1168
|
+
const original = ModuleClass._resolveFilename;
|
|
1169
|
+
const descriptor = Object.getOwnPropertyDescriptor(
|
|
1170
|
+
ModuleClass,
|
|
1171
|
+
"_resolveFilename"
|
|
1172
|
+
);
|
|
1173
|
+
this.originalDescriptors.push({
|
|
1174
|
+
target: ModuleClass,
|
|
1175
|
+
prop: "_resolveFilename",
|
|
1176
|
+
descriptor
|
|
1177
|
+
});
|
|
1178
|
+
const path = "Module._resolveFilename";
|
|
1179
|
+
const proxy = new this.originalProxy(original, {
|
|
1180
|
+
apply(_target, _thisArg, _args) {
|
|
1181
|
+
const message = `${path} is blocked in worker context`;
|
|
1182
|
+
const violation = self.recordViolation(
|
|
1183
|
+
"module_resolve_filename",
|
|
1184
|
+
path,
|
|
1185
|
+
message
|
|
1186
|
+
);
|
|
1187
|
+
if (!auditMode) {
|
|
1188
|
+
throw new WorkerSecurityViolationError(message, violation);
|
|
1189
|
+
}
|
|
1190
|
+
return Reflect.apply(_target, _thisArg, _args);
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
Object.defineProperty(ModuleClass, "_resolveFilename", {
|
|
1194
|
+
value: proxy,
|
|
1195
|
+
writable: true,
|
|
1196
|
+
configurable: true
|
|
1197
|
+
});
|
|
1198
|
+
} catch {
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1068
1201
|
/**
|
|
1069
1202
|
* Apply a single patch to a blocked global.
|
|
1070
1203
|
*/
|
|
@@ -1125,6 +1258,7 @@ var _setTimeout = globalThis.setTimeout;
|
|
|
1125
1258
|
var _clearTimeout = globalThis.clearTimeout;
|
|
1126
1259
|
var _SharedArrayBuffer = globalThis.SharedArrayBuffer;
|
|
1127
1260
|
var _Atomics = globalThis.Atomics;
|
|
1261
|
+
var _performanceNow = performance.now.bind(performance);
|
|
1128
1262
|
|
|
1129
1263
|
// src/commands/python3/protocol.ts
|
|
1130
1264
|
var OpCode = {
|
|
@@ -1548,11 +1682,17 @@ var SyncFsBackend = class {
|
|
|
1548
1682
|
}
|
|
1549
1683
|
writeStdout(data) {
|
|
1550
1684
|
const encoded = new TextEncoder().encode(data);
|
|
1551
|
-
this.execSync(OpCode.WRITE_STDOUT, "", encoded);
|
|
1685
|
+
const result = this.execSync(OpCode.WRITE_STDOUT, "", encoded);
|
|
1686
|
+
if (!result.success) {
|
|
1687
|
+
throw new Error(result.error || "Failed to write stdout");
|
|
1688
|
+
}
|
|
1552
1689
|
}
|
|
1553
1690
|
writeStderr(data) {
|
|
1554
1691
|
const encoded = new TextEncoder().encode(data);
|
|
1555
|
-
this.execSync(OpCode.WRITE_STDERR, "", encoded);
|
|
1692
|
+
const result = this.execSync(OpCode.WRITE_STDERR, "", encoded);
|
|
1693
|
+
if (!result.success) {
|
|
1694
|
+
throw new Error(result.error || "Failed to write stderr");
|
|
1695
|
+
}
|
|
1556
1696
|
}
|
|
1557
1697
|
exit(code) {
|
|
1558
1698
|
this.execSync(OpCode.EXIT, "", void 0, code);
|
|
@@ -2513,12 +2653,22 @@ sys.exit(_jb_exit_code)
|
|
|
2513
2653
|
var defense = null;
|
|
2514
2654
|
function activateDefense() {
|
|
2515
2655
|
if (defense) return;
|
|
2656
|
+
const _DateNow = Date.now;
|
|
2657
|
+
const degraded = { now: () => _DateNow(), timeOrigin: _DateNow() };
|
|
2658
|
+
Object.defineProperty(globalThis, "performance", {
|
|
2659
|
+
value: degraded,
|
|
2660
|
+
writable: true,
|
|
2661
|
+
configurable: true
|
|
2662
|
+
});
|
|
2516
2663
|
defense = new WorkerDefenseInDepth({
|
|
2517
2664
|
excludeViolationTypes: [
|
|
2518
2665
|
// SharedArrayBuffer/Atomics: Used by sync-fs-backend.ts for synchronous
|
|
2519
2666
|
// filesystem communication between the WASM thread and the main thread.
|
|
2520
2667
|
"shared_array_buffer",
|
|
2521
|
-
"atomics"
|
|
2668
|
+
"atomics",
|
|
2669
|
+
// performance: Excluded because we replaced it above with a ms-precision
|
|
2670
|
+
// stub. Defense doesn't need to block it — it's already degraded.
|
|
2671
|
+
"performance_timing"
|
|
2522
2672
|
],
|
|
2523
2673
|
onViolation: (v) => {
|
|
2524
2674
|
parentPort?.postMessage({ type: "security-violation", violation: v });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-47HZU3SY.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as xargsCommand};
|