You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/enclave/core-libraries/enclave-browser/security-architecture.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,12 @@ Every global object exposed to user code is wrapped in a `Proxy` that blocks acc
136
136
137
137
The proxy behavior is configurable per security level. At `STRICT` and `SECURE` levels, accessing blocked properties throws an error. At `PERMISSIVE`, it returns `undefined`.
138
138
139
+
#### Pinned properties
140
+
141
+
A JavaScript `get` trap must report the exact value of a non-configurable, non-writable own data property, so the proxy can neither wrap nor hide one. Primitives in that position are reported as-is — this covers constants such as `Math.PI` and hardened slots pinned to `undefined`. An **object or function** in that position is refused with a `SecurityError` regardless of `throwOnBlocked`, because returning the reference would put an unwrapped object graph in reach of sandboxed code, and that graph's prototype chain leads to a `Function` constructor.
142
+
143
+
This matters for host values that pin object-valued internals: a Zod schema pins `_zod` this way, and every class pins `prototype`. Hand sandboxed code plain serialized data rather than live host objects — a structurally cloned or JSON-projected value has no pinned members and reads normally.
144
+
139
145
Additionally, dangerous static methods on `Object` are neutralized: `defineProperty`, `defineProperties`, `setPrototypeOf`, `getOwnPropertyDescriptor`, and `getOwnPropertyDescriptors`.
0 commit comments