@enclave-vm/core 2.15.0 → 2.15.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/enclave.d.ts +1 -0
- package/esm/index.mjs +941 -699
- package/esm/worker.mjs +5 -1
- package/index.js +1011 -774
- package/package.json +3 -3
- package/secure-proxy.d.ts +28 -0
- package/src/adapters/worker-pool/package.json +3 -3
- package/worker.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enclave-vm/core",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.2",
|
|
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",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/standalone": "^7.29.0",
|
|
47
|
-
"@enclave-vm/ast": "2.15.
|
|
48
|
-
"@enclave-vm/types": "2.15.
|
|
47
|
+
"@enclave-vm/ast": "2.15.2",
|
|
48
|
+
"@enclave-vm/types": "2.15.2",
|
|
49
49
|
"@types/estree": "1.0.8",
|
|
50
50
|
"acorn": "8.15.0",
|
|
51
51
|
"acorn-walk": "8.3.4",
|
package/secure-proxy.d.ts
CHANGED
|
@@ -15,6 +15,23 @@
|
|
|
15
15
|
* @packageDocumentation
|
|
16
16
|
*/
|
|
17
17
|
import type { SecureProxyLevelConfig, SecurityLevel } from './types';
|
|
18
|
+
/**
|
|
19
|
+
* Absolute floor for the membrane recursion cap.
|
|
20
|
+
*
|
|
21
|
+
* The recursion counter is a stack-safety backstop, NOT a security control: every level of the
|
|
22
|
+
* membrane already blocks the dangerous properties, so the cap value never decides whether an
|
|
23
|
+
* escape is possible. Its only job is to stop pathological recursion. It must therefore sit
|
|
24
|
+
* comfortably above the deepest value that can legitimately reach the membrane (a tool result is
|
|
25
|
+
* pre-sanitized to at most `maxSanitizeDepth`, which peaks at 50), or legitimate deep data would
|
|
26
|
+
* be rejected (custom host globals are not sanitize-bounded, hence the generous ~5x headroom).
|
|
27
|
+
* The membrane is lazy (one property access = one wrap = O(1) synchronous stack), so a large
|
|
28
|
+
* value costs nothing. Exceeding the cap fails CLOSED (throws) — it must never hand back a raw
|
|
29
|
+
* target.
|
|
30
|
+
*
|
|
31
|
+
* Exported so tests can derive their traversal depth from the real cap instead of hardcoding a
|
|
32
|
+
* value that would silently rot if the cap changed.
|
|
33
|
+
*/
|
|
34
|
+
export declare const MIN_MEMBRANE_RECURSION_DEPTH = 256;
|
|
18
35
|
/**
|
|
19
36
|
* Categorized blocked properties for defense-in-depth
|
|
20
37
|
*
|
|
@@ -25,6 +42,17 @@ export declare const BLOCKED_PROPERTY_CATEGORIES: {
|
|
|
25
42
|
* Core prototype manipulation properties (always blocked except PERMISSIVE)
|
|
26
43
|
*/
|
|
27
44
|
readonly PROTOTYPE: Set<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Property-descriptor and prototype MUTATION gadgets. These are the primitives behind the
|
|
47
|
+
* GHSA-3279 membrane self-leak (`Object.defineProperty(Object, 'getOwnPropertyDescriptor', hook)`
|
|
48
|
+
* to intercept the trap's raw target) and classic prototype pollution (`setPrototypeOf`). They
|
|
49
|
+
* are never needed by AgentScript and are already refused by the single-VM SafeObject
|
|
50
|
+
* (`DANGEROUS_OBJECT_STATIC_METHODS`), so they are blocked at every level that blocks the
|
|
51
|
+
* constructor (all except PERMISSIVE). Read-only reflection (getPrototypeOf, keys, entries,
|
|
52
|
+
* getOwnPropertyNames) is intentionally NOT here: the membrane's own getPrototypeOf/ownKeys traps
|
|
53
|
+
* already neutralize it for proxied values, and it has legitimate uses.
|
|
54
|
+
*/
|
|
55
|
+
readonly DESCRIPTOR_MUTATION: Set<string>;
|
|
28
56
|
/**
|
|
29
57
|
* Node.js 24 Iterator helper method names
|
|
30
58
|
* Blocked at STRICT/SECURE to prevent prototype chain access via iterators
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enclave-vm/core",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.2",
|
|
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",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/standalone": "^7.29.0",
|
|
49
|
-
"@enclave-vm/ast": "2.15.
|
|
50
|
-
"@enclave-vm/types": "2.15.
|
|
49
|
+
"@enclave-vm/ast": "2.15.2",
|
|
50
|
+
"@enclave-vm/types": "2.15.2",
|
|
51
51
|
"@types/estree": "1.0.8",
|
|
52
52
|
"acorn": "8.15.0",
|
|
53
53
|
"acorn-walk": "8.3.4",
|
package/worker.js
CHANGED
|
@@ -565,7 +565,11 @@ var Interpreter = class {
|
|
|
565
565
|
const obj = value ?? {};
|
|
566
566
|
for (const prop of pattern.properties) {
|
|
567
567
|
if (prop.type === "RestElement") continue;
|
|
568
|
-
|
|
568
|
+
if (prop.computed) throw new InterpreterError("Computed destructuring keys are not allowed");
|
|
569
|
+
let key;
|
|
570
|
+
if (prop.key.type === "Identifier") key = prop.key.name;
|
|
571
|
+
else if (prop.key.type === "Literal") key = String(prop.key.value);
|
|
572
|
+
else throw new InterpreterError("Unsupported destructuring key");
|
|
569
573
|
if (BLOCKED_KEYS.has(key)) throw new InterpreterError(`Forbidden destructured key: ${key}`);
|
|
570
574
|
this.bindPattern(prop.value, obj[key], scope, mutable);
|
|
571
575
|
}
|