@enclave-vm/core 2.10.1 → 2.11.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/esm/index.mjs +54 -11
- package/index.js +54 -11
- package/package.json +3 -3
- package/src/adapters/worker-pool/package.json +3 -3
package/esm/index.mjs
CHANGED
|
@@ -2037,6 +2037,7 @@ ${stackTraceHardeningCode}
|
|
|
2037
2037
|
const hostAbortCheck = __host_abort_check__;
|
|
2038
2038
|
const hostReportViolation = __host_reportViolation__;
|
|
2039
2039
|
const hostConfig = __host_config__;
|
|
2040
|
+
const hostMemoryTrack = typeof __host_memory_track__ === 'function' ? __host_memory_track__ : function(){};
|
|
2040
2041
|
const toolBridgeMode = ${JSON.stringify(toolBridgeMode)};
|
|
2041
2042
|
const toolBridgeMaxPayloadBytes = ${toolBridgeMaxPayloadBytes};
|
|
2042
2043
|
|
|
@@ -2048,6 +2049,7 @@ ${stackTraceHardeningCode}
|
|
|
2048
2049
|
try { delete globalThis.__host_abort_check__; } catch (e) { /* ignore */ }
|
|
2049
2050
|
try { delete globalThis.__host_reportViolation__; } catch (e) { /* ignore */ }
|
|
2050
2051
|
try { delete globalThis.__host_config__; } catch (e) { /* ignore */ }
|
|
2052
|
+
try { delete globalThis.__host_memory_track__; } catch (e) { /* ignore */ }
|
|
2051
2053
|
|
|
2052
2054
|
// Policy violation reporter (best-effort; host decides how to handle based on security level)
|
|
2053
2055
|
function __ag_reportViolation(kind) {
|
|
@@ -2617,7 +2619,7 @@ ${stackTraceHardeningCode}
|
|
|
2617
2619
|
if (!leftIsRef && !rightIsRef) {
|
|
2618
2620
|
// Track memory if enabled
|
|
2619
2621
|
if (memoryLimit > 0) {
|
|
2620
|
-
|
|
2622
|
+
hostMemoryTrack(rightLen * 2); // UTF-16 encoding
|
|
2621
2623
|
}
|
|
2622
2624
|
return left + right;
|
|
2623
2625
|
}
|
|
@@ -2672,7 +2674,7 @@ ${stackTraceHardeningCode}
|
|
|
2672
2674
|
|
|
2673
2675
|
// Track if result is a string
|
|
2674
2676
|
if (typeof result === 'string' && memoryLimit > 0) {
|
|
2675
|
-
|
|
2677
|
+
hostMemoryTrack(result.length * 2);
|
|
2676
2678
|
}
|
|
2677
2679
|
|
|
2678
2680
|
return result;
|
|
@@ -2761,7 +2763,7 @@ ${stackTraceHardeningCode}
|
|
|
2761
2763
|
if (consoleStats.totalBytes > maxConsoleBytes) {
|
|
2762
2764
|
throw createSafeError('Console output size limit exceeded (max: ' + maxConsoleBytes + ' bytes). This limit prevents I/O flood attacks.');
|
|
2763
2765
|
}
|
|
2764
|
-
method.
|
|
2766
|
+
method.call(console, output);
|
|
2765
2767
|
};
|
|
2766
2768
|
}
|
|
2767
2769
|
|
|
@@ -2822,9 +2824,9 @@ ${stackTraceHardeningCode}
|
|
|
2822
2824
|
// First, inject the host memory tracking callback into innerContext
|
|
2823
2825
|
// This allows the patched methods to track cumulative memory
|
|
2824
2826
|
Object.defineProperty(innerContext, '__host_memory_track__', {
|
|
2825
|
-
value:
|
|
2827
|
+
value: hostMemoryTrack,
|
|
2826
2828
|
writable: false,
|
|
2827
|
-
configurable:
|
|
2829
|
+
configurable: true,
|
|
2828
2830
|
enumerable: false
|
|
2829
2831
|
});
|
|
2830
2832
|
|
|
@@ -3153,6 +3155,9 @@ ${stackTraceHardeningCode}
|
|
|
3153
3155
|
innerRuntimeScript.runInContext(innerContext);
|
|
3154
3156
|
} catch (e) { /* ignore */ }
|
|
3155
3157
|
|
|
3158
|
+
// Defense-in-depth: Remove host callback from inner sandbox after all scripts have captured it
|
|
3159
|
+
try { delete innerContext['__host_memory_track__']; } catch (e) { /* ignore */ }
|
|
3160
|
+
|
|
3156
3161
|
// Create a safe Object that blocks dangerous STATIC methods
|
|
3157
3162
|
// Prevents ATK-DATA-02 (Serialization Hijack via defineProperty)
|
|
3158
3163
|
// Note: __defineGetter__ etc. are on Object.prototype (instance methods), not static
|
|
@@ -3340,6 +3345,20 @@ ${stackTraceHardeningCode}
|
|
|
3340
3345
|
}
|
|
3341
3346
|
})();
|
|
3342
3347
|
|
|
3348
|
+
// Defense-in-depth: Neutralize dangerous static methods on the intrinsic Object constructor
|
|
3349
|
+
// in the inner VM. SafeObject only replaces the global Object variable; the REAL intrinsic
|
|
3350
|
+
// Object is still reachable via {}.constructor and retains getOwnPropertyDescriptors etc.
|
|
3351
|
+
// NOTE: Only applied to inner VM - parent VM needs these for createSecureProxy/createSafeError.
|
|
3352
|
+
(function() {
|
|
3353
|
+
var neutralizeCode =
|
|
3354
|
+
'(function() {' +
|
|
3355
|
+
' var RealObject = Object.getPrototypeOf({}).constructor;' +
|
|
3356
|
+
' var dangerous = ["getOwnPropertyDescriptors","getOwnPropertyDescriptor","defineProperty","defineProperties","setPrototypeOf"];' +
|
|
3357
|
+
' for (var i = 0; i < dangerous.length; i++) { try { delete RealObject[dangerous[i]]; } catch(e) {} }' +
|
|
3358
|
+
'})();';
|
|
3359
|
+
try { var s = new vm.Script(neutralizeCode); s.runInContext(innerContext); } catch(e) { /* defense-in-depth */ }
|
|
3360
|
+
})();
|
|
3361
|
+
|
|
3343
3362
|
var userCode = ${JSON.stringify(userCode)};
|
|
3344
3363
|
// IMPORTANT: For stack overflow errors (RangeError: Maximum call stack size exceeded),
|
|
3345
3364
|
// Node/V8 may ignore Error.prepareStackTrace when it was installed by a different Script
|
|
@@ -3857,7 +3876,7 @@ var init_double_vm_wrapper = __esm({
|
|
|
3857
3876
|
}
|
|
3858
3877
|
},
|
|
3859
3878
|
writable: false,
|
|
3860
|
-
configurable:
|
|
3879
|
+
configurable: true
|
|
3861
3880
|
});
|
|
3862
3881
|
} else {
|
|
3863
3882
|
Object.defineProperty(parentContext, "__host_memory_track__", {
|
|
@@ -3865,7 +3884,7 @@ var init_double_vm_wrapper = __esm({
|
|
|
3865
3884
|
value: () => {
|
|
3866
3885
|
},
|
|
3867
3886
|
writable: false,
|
|
3868
|
-
configurable:
|
|
3887
|
+
configurable: true
|
|
3869
3888
|
});
|
|
3870
3889
|
}
|
|
3871
3890
|
Object.defineProperty(parentContext, "console", {
|
|
@@ -4715,7 +4734,7 @@ function createSafeConsole(config, stats) {
|
|
|
4715
4734
|
"SecurityError"
|
|
4716
4735
|
);
|
|
4717
4736
|
}
|
|
4718
|
-
method(
|
|
4737
|
+
method(output);
|
|
4719
4738
|
};
|
|
4720
4739
|
return {
|
|
4721
4740
|
log: wrap(console.log.bind(console)),
|
|
@@ -4850,7 +4869,7 @@ function sanitizeVmContext(context, securityLevel) {
|
|
|
4850
4869
|
enumerable: true
|
|
4851
4870
|
});
|
|
4852
4871
|
}
|
|
4853
|
-
var SENSITIVE_STACK_PATTERNS2, STACK_TRACE_HARDENING_CODE, STACK_TRACE_HARDENING_SCRIPT, CODE_GENERATION_VIOLATION_DETECTOR_CODE, CODE_GENERATION_VIOLATION_DETECTOR_SCRIPT, PROTECTED_PREFIXES, DANGEROUS_OBJECT_STATIC_METHODS, NODEJS_24_DANGEROUS_GLOBALS2, VmAdapter;
|
|
4872
|
+
var SENSITIVE_STACK_PATTERNS2, STACK_TRACE_HARDENING_CODE, STACK_TRACE_HARDENING_SCRIPT, CODE_GENERATION_VIOLATION_DETECTOR_CODE, CODE_GENERATION_VIOLATION_DETECTOR_SCRIPT, INTRINSIC_OBJECT_NEUTRALIZATION_CODE, INTRINSIC_OBJECT_NEUTRALIZATION_SCRIPT, PROTECTED_PREFIXES, DANGEROUS_OBJECT_STATIC_METHODS, NODEJS_24_DANGEROUS_GLOBALS2, VmAdapter;
|
|
4854
4873
|
var init_vm_adapter = __esm({
|
|
4855
4874
|
"libs/core/src/adapters/vm-adapter.ts"() {
|
|
4856
4875
|
"use strict";
|
|
@@ -5133,6 +5152,22 @@ var init_vm_adapter = __esm({
|
|
|
5133
5152
|
})();
|
|
5134
5153
|
`.trim();
|
|
5135
5154
|
CODE_GENERATION_VIOLATION_DETECTOR_SCRIPT = new vm3.Script(CODE_GENERATION_VIOLATION_DETECTOR_CODE);
|
|
5155
|
+
INTRINSIC_OBJECT_NEUTRALIZATION_CODE = `
|
|
5156
|
+
(function() {
|
|
5157
|
+
var RealObject = Object.getPrototypeOf({}).constructor;
|
|
5158
|
+
var dangerous = [
|
|
5159
|
+
'getOwnPropertyDescriptors',
|
|
5160
|
+
'getOwnPropertyDescriptor',
|
|
5161
|
+
'defineProperty',
|
|
5162
|
+
'defineProperties',
|
|
5163
|
+
'setPrototypeOf'
|
|
5164
|
+
];
|
|
5165
|
+
for (var i = 0; i < dangerous.length; i++) {
|
|
5166
|
+
try { delete RealObject[dangerous[i]]; } catch (e) {}
|
|
5167
|
+
}
|
|
5168
|
+
})();
|
|
5169
|
+
`;
|
|
5170
|
+
INTRINSIC_OBJECT_NEUTRALIZATION_SCRIPT = new vm3.Script(INTRINSIC_OBJECT_NEUTRALIZATION_CODE);
|
|
5136
5171
|
PROTECTED_PREFIXES = ["__safe_", "__ag_"];
|
|
5137
5172
|
DANGEROUS_OBJECT_STATIC_METHODS = [
|
|
5138
5173
|
"defineProperty",
|
|
@@ -5267,7 +5302,7 @@ var init_vm_adapter = __esm({
|
|
|
5267
5302
|
memoryTracker.track(bytes);
|
|
5268
5303
|
},
|
|
5269
5304
|
writable: false,
|
|
5270
|
-
configurable:
|
|
5305
|
+
configurable: true,
|
|
5271
5306
|
enumerable: false
|
|
5272
5307
|
});
|
|
5273
5308
|
const patchScript = new vm3.Script(`
|
|
@@ -5374,6 +5409,10 @@ var init_vm_adapter = __esm({
|
|
|
5374
5409
|
})();
|
|
5375
5410
|
`);
|
|
5376
5411
|
patchScript.runInContext(baseSandbox);
|
|
5412
|
+
try {
|
|
5413
|
+
delete baseSandbox["__host_memory_track__"];
|
|
5414
|
+
} catch {
|
|
5415
|
+
}
|
|
5377
5416
|
}
|
|
5378
5417
|
const shouldHardenStacks = config.sanitizeStackTraces ?? true;
|
|
5379
5418
|
if (shouldHardenStacks) {
|
|
@@ -5544,9 +5583,13 @@ var init_vm_adapter = __esm({
|
|
|
5544
5583
|
),
|
|
5545
5584
|
writable: false,
|
|
5546
5585
|
configurable: false,
|
|
5547
|
-
enumerable:
|
|
5586
|
+
enumerable: false
|
|
5548
5587
|
});
|
|
5549
5588
|
}
|
|
5589
|
+
try {
|
|
5590
|
+
INTRINSIC_OBJECT_NEUTRALIZATION_SCRIPT.runInContext(baseSandbox);
|
|
5591
|
+
} catch {
|
|
5592
|
+
}
|
|
5550
5593
|
const _protectedSandbox = createProtectedSandbox(baseSandbox);
|
|
5551
5594
|
this.context = baseSandbox;
|
|
5552
5595
|
const wrappedCode = "(async () => {\n" + code + '\nreturn typeof __ag_main === "function" ? await __ag_main() : undefined;\n})();';
|
package/index.js
CHANGED
|
@@ -2059,6 +2059,7 @@ ${stackTraceHardeningCode}
|
|
|
2059
2059
|
const hostAbortCheck = __host_abort_check__;
|
|
2060
2060
|
const hostReportViolation = __host_reportViolation__;
|
|
2061
2061
|
const hostConfig = __host_config__;
|
|
2062
|
+
const hostMemoryTrack = typeof __host_memory_track__ === 'function' ? __host_memory_track__ : function(){};
|
|
2062
2063
|
const toolBridgeMode = ${JSON.stringify(toolBridgeMode)};
|
|
2063
2064
|
const toolBridgeMaxPayloadBytes = ${toolBridgeMaxPayloadBytes};
|
|
2064
2065
|
|
|
@@ -2070,6 +2071,7 @@ ${stackTraceHardeningCode}
|
|
|
2070
2071
|
try { delete globalThis.__host_abort_check__; } catch (e) { /* ignore */ }
|
|
2071
2072
|
try { delete globalThis.__host_reportViolation__; } catch (e) { /* ignore */ }
|
|
2072
2073
|
try { delete globalThis.__host_config__; } catch (e) { /* ignore */ }
|
|
2074
|
+
try { delete globalThis.__host_memory_track__; } catch (e) { /* ignore */ }
|
|
2073
2075
|
|
|
2074
2076
|
// Policy violation reporter (best-effort; host decides how to handle based on security level)
|
|
2075
2077
|
function __ag_reportViolation(kind) {
|
|
@@ -2639,7 +2641,7 @@ ${stackTraceHardeningCode}
|
|
|
2639
2641
|
if (!leftIsRef && !rightIsRef) {
|
|
2640
2642
|
// Track memory if enabled
|
|
2641
2643
|
if (memoryLimit > 0) {
|
|
2642
|
-
|
|
2644
|
+
hostMemoryTrack(rightLen * 2); // UTF-16 encoding
|
|
2643
2645
|
}
|
|
2644
2646
|
return left + right;
|
|
2645
2647
|
}
|
|
@@ -2694,7 +2696,7 @@ ${stackTraceHardeningCode}
|
|
|
2694
2696
|
|
|
2695
2697
|
// Track if result is a string
|
|
2696
2698
|
if (typeof result === 'string' && memoryLimit > 0) {
|
|
2697
|
-
|
|
2699
|
+
hostMemoryTrack(result.length * 2);
|
|
2698
2700
|
}
|
|
2699
2701
|
|
|
2700
2702
|
return result;
|
|
@@ -2783,7 +2785,7 @@ ${stackTraceHardeningCode}
|
|
|
2783
2785
|
if (consoleStats.totalBytes > maxConsoleBytes) {
|
|
2784
2786
|
throw createSafeError('Console output size limit exceeded (max: ' + maxConsoleBytes + ' bytes). This limit prevents I/O flood attacks.');
|
|
2785
2787
|
}
|
|
2786
|
-
method.
|
|
2788
|
+
method.call(console, output);
|
|
2787
2789
|
};
|
|
2788
2790
|
}
|
|
2789
2791
|
|
|
@@ -2844,9 +2846,9 @@ ${stackTraceHardeningCode}
|
|
|
2844
2846
|
// First, inject the host memory tracking callback into innerContext
|
|
2845
2847
|
// This allows the patched methods to track cumulative memory
|
|
2846
2848
|
Object.defineProperty(innerContext, '__host_memory_track__', {
|
|
2847
|
-
value:
|
|
2849
|
+
value: hostMemoryTrack,
|
|
2848
2850
|
writable: false,
|
|
2849
|
-
configurable:
|
|
2851
|
+
configurable: true,
|
|
2850
2852
|
enumerable: false
|
|
2851
2853
|
});
|
|
2852
2854
|
|
|
@@ -3175,6 +3177,9 @@ ${stackTraceHardeningCode}
|
|
|
3175
3177
|
innerRuntimeScript.runInContext(innerContext);
|
|
3176
3178
|
} catch (e) { /* ignore */ }
|
|
3177
3179
|
|
|
3180
|
+
// Defense-in-depth: Remove host callback from inner sandbox after all scripts have captured it
|
|
3181
|
+
try { delete innerContext['__host_memory_track__']; } catch (e) { /* ignore */ }
|
|
3182
|
+
|
|
3178
3183
|
// Create a safe Object that blocks dangerous STATIC methods
|
|
3179
3184
|
// Prevents ATK-DATA-02 (Serialization Hijack via defineProperty)
|
|
3180
3185
|
// Note: __defineGetter__ etc. are on Object.prototype (instance methods), not static
|
|
@@ -3362,6 +3367,20 @@ ${stackTraceHardeningCode}
|
|
|
3362
3367
|
}
|
|
3363
3368
|
})();
|
|
3364
3369
|
|
|
3370
|
+
// Defense-in-depth: Neutralize dangerous static methods on the intrinsic Object constructor
|
|
3371
|
+
// in the inner VM. SafeObject only replaces the global Object variable; the REAL intrinsic
|
|
3372
|
+
// Object is still reachable via {}.constructor and retains getOwnPropertyDescriptors etc.
|
|
3373
|
+
// NOTE: Only applied to inner VM - parent VM needs these for createSecureProxy/createSafeError.
|
|
3374
|
+
(function() {
|
|
3375
|
+
var neutralizeCode =
|
|
3376
|
+
'(function() {' +
|
|
3377
|
+
' var RealObject = Object.getPrototypeOf({}).constructor;' +
|
|
3378
|
+
' var dangerous = ["getOwnPropertyDescriptors","getOwnPropertyDescriptor","defineProperty","defineProperties","setPrototypeOf"];' +
|
|
3379
|
+
' for (var i = 0; i < dangerous.length; i++) { try { delete RealObject[dangerous[i]]; } catch(e) {} }' +
|
|
3380
|
+
'})();';
|
|
3381
|
+
try { var s = new vm.Script(neutralizeCode); s.runInContext(innerContext); } catch(e) { /* defense-in-depth */ }
|
|
3382
|
+
})();
|
|
3383
|
+
|
|
3365
3384
|
var userCode = ${JSON.stringify(userCode)};
|
|
3366
3385
|
// IMPORTANT: For stack overflow errors (RangeError: Maximum call stack size exceeded),
|
|
3367
3386
|
// Node/V8 may ignore Error.prepareStackTrace when it was installed by a different Script
|
|
@@ -3879,7 +3898,7 @@ var init_double_vm_wrapper = __esm({
|
|
|
3879
3898
|
}
|
|
3880
3899
|
},
|
|
3881
3900
|
writable: false,
|
|
3882
|
-
configurable:
|
|
3901
|
+
configurable: true
|
|
3883
3902
|
});
|
|
3884
3903
|
} else {
|
|
3885
3904
|
Object.defineProperty(parentContext, "__host_memory_track__", {
|
|
@@ -3887,7 +3906,7 @@ var init_double_vm_wrapper = __esm({
|
|
|
3887
3906
|
value: () => {
|
|
3888
3907
|
},
|
|
3889
3908
|
writable: false,
|
|
3890
|
-
configurable:
|
|
3909
|
+
configurable: true
|
|
3891
3910
|
});
|
|
3892
3911
|
}
|
|
3893
3912
|
Object.defineProperty(parentContext, "console", {
|
|
@@ -4736,7 +4755,7 @@ function createSafeConsole(config, stats) {
|
|
|
4736
4755
|
"SecurityError"
|
|
4737
4756
|
);
|
|
4738
4757
|
}
|
|
4739
|
-
method(
|
|
4758
|
+
method(output);
|
|
4740
4759
|
};
|
|
4741
4760
|
return {
|
|
4742
4761
|
log: wrap(console.log.bind(console)),
|
|
@@ -4871,7 +4890,7 @@ function sanitizeVmContext(context, securityLevel) {
|
|
|
4871
4890
|
enumerable: true
|
|
4872
4891
|
});
|
|
4873
4892
|
}
|
|
4874
|
-
var vm3, SENSITIVE_STACK_PATTERNS2, STACK_TRACE_HARDENING_CODE, STACK_TRACE_HARDENING_SCRIPT, CODE_GENERATION_VIOLATION_DETECTOR_CODE, CODE_GENERATION_VIOLATION_DETECTOR_SCRIPT, PROTECTED_PREFIXES, DANGEROUS_OBJECT_STATIC_METHODS, NODEJS_24_DANGEROUS_GLOBALS2, VmAdapter;
|
|
4893
|
+
var vm3, SENSITIVE_STACK_PATTERNS2, STACK_TRACE_HARDENING_CODE, STACK_TRACE_HARDENING_SCRIPT, CODE_GENERATION_VIOLATION_DETECTOR_CODE, CODE_GENERATION_VIOLATION_DETECTOR_SCRIPT, INTRINSIC_OBJECT_NEUTRALIZATION_CODE, INTRINSIC_OBJECT_NEUTRALIZATION_SCRIPT, PROTECTED_PREFIXES, DANGEROUS_OBJECT_STATIC_METHODS, NODEJS_24_DANGEROUS_GLOBALS2, VmAdapter;
|
|
4875
4894
|
var init_vm_adapter = __esm({
|
|
4876
4895
|
"libs/core/src/adapters/vm-adapter.ts"() {
|
|
4877
4896
|
"use strict";
|
|
@@ -5155,6 +5174,22 @@ var init_vm_adapter = __esm({
|
|
|
5155
5174
|
})();
|
|
5156
5175
|
`.trim();
|
|
5157
5176
|
CODE_GENERATION_VIOLATION_DETECTOR_SCRIPT = new vm3.Script(CODE_GENERATION_VIOLATION_DETECTOR_CODE);
|
|
5177
|
+
INTRINSIC_OBJECT_NEUTRALIZATION_CODE = `
|
|
5178
|
+
(function() {
|
|
5179
|
+
var RealObject = Object.getPrototypeOf({}).constructor;
|
|
5180
|
+
var dangerous = [
|
|
5181
|
+
'getOwnPropertyDescriptors',
|
|
5182
|
+
'getOwnPropertyDescriptor',
|
|
5183
|
+
'defineProperty',
|
|
5184
|
+
'defineProperties',
|
|
5185
|
+
'setPrototypeOf'
|
|
5186
|
+
];
|
|
5187
|
+
for (var i = 0; i < dangerous.length; i++) {
|
|
5188
|
+
try { delete RealObject[dangerous[i]]; } catch (e) {}
|
|
5189
|
+
}
|
|
5190
|
+
})();
|
|
5191
|
+
`;
|
|
5192
|
+
INTRINSIC_OBJECT_NEUTRALIZATION_SCRIPT = new vm3.Script(INTRINSIC_OBJECT_NEUTRALIZATION_CODE);
|
|
5158
5193
|
PROTECTED_PREFIXES = ["__safe_", "__ag_"];
|
|
5159
5194
|
DANGEROUS_OBJECT_STATIC_METHODS = [
|
|
5160
5195
|
"defineProperty",
|
|
@@ -5289,7 +5324,7 @@ var init_vm_adapter = __esm({
|
|
|
5289
5324
|
memoryTracker.track(bytes);
|
|
5290
5325
|
},
|
|
5291
5326
|
writable: false,
|
|
5292
|
-
configurable:
|
|
5327
|
+
configurable: true,
|
|
5293
5328
|
enumerable: false
|
|
5294
5329
|
});
|
|
5295
5330
|
const patchScript = new vm3.Script(`
|
|
@@ -5396,6 +5431,10 @@ var init_vm_adapter = __esm({
|
|
|
5396
5431
|
})();
|
|
5397
5432
|
`);
|
|
5398
5433
|
patchScript.runInContext(baseSandbox);
|
|
5434
|
+
try {
|
|
5435
|
+
delete baseSandbox["__host_memory_track__"];
|
|
5436
|
+
} catch {
|
|
5437
|
+
}
|
|
5399
5438
|
}
|
|
5400
5439
|
const shouldHardenStacks = config.sanitizeStackTraces ?? true;
|
|
5401
5440
|
if (shouldHardenStacks) {
|
|
@@ -5566,9 +5605,13 @@ var init_vm_adapter = __esm({
|
|
|
5566
5605
|
),
|
|
5567
5606
|
writable: false,
|
|
5568
5607
|
configurable: false,
|
|
5569
|
-
enumerable:
|
|
5608
|
+
enumerable: false
|
|
5570
5609
|
});
|
|
5571
5610
|
}
|
|
5611
|
+
try {
|
|
5612
|
+
INTRINSIC_OBJECT_NEUTRALIZATION_SCRIPT.runInContext(baseSandbox);
|
|
5613
|
+
} catch {
|
|
5614
|
+
}
|
|
5572
5615
|
const _protectedSandbox = createProtectedSandbox(baseSandbox);
|
|
5573
5616
|
this.context = baseSandbox;
|
|
5574
5617
|
const wrappedCode = "(async () => {\n" + code + '\nreturn typeof __ag_main === "function" ? await __ag_main() : undefined;\n})();';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enclave-vm/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Sandbox runtime for secure JavaScript code execution",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://github.com/agentfront/enclave",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/standalone": "^7.29.0",
|
|
41
|
-
"@enclave-vm/types": "2.
|
|
42
|
-
"@enclave-vm/ast": "2.
|
|
41
|
+
"@enclave-vm/types": "2.11.0",
|
|
42
|
+
"@enclave-vm/ast": "2.11.0",
|
|
43
43
|
"acorn": "8.15.0",
|
|
44
44
|
"acorn-walk": "8.3.4",
|
|
45
45
|
"astring": "1.9.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enclave-vm/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Sandbox runtime for secure JavaScript code execution",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://github.com/agentfront/enclave",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/standalone": "^7.29.0",
|
|
42
|
-
"@enclave-vm/types": "2.
|
|
43
|
-
"@enclave-vm/ast": "2.
|
|
42
|
+
"@enclave-vm/types": "2.11.0",
|
|
43
|
+
"@enclave-vm/ast": "2.11.0",
|
|
44
44
|
"acorn": "8.15.0",
|
|
45
45
|
"acorn-walk": "8.3.4",
|
|
46
46
|
"astring": "1.9.0",
|