Commit Graph
12 Commits
Author SHA1 Message Date
Yang JunandCursor e8d5487a43 test: cover readSize branches in Context
Co-authored-by: Cursor <[email protected]>
2026-07-24 00:49:10 +08:00
Yang JunandCursor 047b110939 fix: restore BLOCKED_SCOPE_KEYS gated by ownPropertyOnly
Dangerous keys (__proto__, constructor, prototype) are blocked only when
ownPropertyOnly is true (default). With false, full prototype access is
allowed as an explicit opt-out; use bourne for untrusted input.

Co-authored-by: Cursor <[email protected]>
2026-07-23 23:14:15 +08:00
Yang JunandCursor bba5c43c09 fix: remove BLOCKED_SCOPE_KEYS; ownPropertyOnly is the sole read policy
Proto keys were incorrectly blocked even when ownPropertyOnly=false.
Inherited access is now gated only by ownPropertyOnly; docs updated.

Co-authored-by: Cursor <[email protected]>
2026-07-23 23:05:16 +08:00
Yang JunandCursor 85321c6d64 fix: apply ownPropertyOnly uniformly in readJSProperty
Proto keys block inherited access only; ownPropertyOnly is checked once before return for all keys. Own __proto__/constructor/prototype properties are readable—sanitize untrusted scope input.

Co-authored-by: Cursor <[email protected]>
2026-07-23 22:59:37 +08:00
Yang JunandCursor 12fa904ebd fix: address scope-security review findings
Restore null-prototype hardening for Jekyll include bindings, colocate blocked-key checks with readJSProperty, align ownPropertyOnly JSDoc with security docs, and drop integration tests duplicated in context.spec.

Co-authored-by: Cursor <[email protected]>
2026-07-21 20:38:46 +08:00
Yang JunandCursor bc207a66b7 refactor: drop redundant tag write-path blocking
Write blocking on assign/capture/increment/decrement duplicated read-side
protection in readJSProperty; null-proto scopes from push already prevent
prototype pollution on managed writes.

Co-authored-by: Cursor <[email protected]>
2026-07-21 20:31:38 +08:00
Yang JunandCursor aa58a45021 test: trim redundant scope-security integration tests
Co-authored-by: Cursor <[email protected]>
2026-07-19 23:38:54 +08:00
Yang JunandCursor cbc317508b fix: unify blocked-key checks in findScope
Use shouldBlockScopeKeyRead in findScope hasKey so inherited
constructor/__proto__/prototype do not falsely match environments.
Remove redundant globals hasKey check; globals remains the fallback scope.

Co-authored-by: Cursor <[email protected]>
2026-07-19 14:09:46 +08:00
Yang JunandCursor 04354ce36f fix: revert ownPropertyOnly iteration hardening
Iteration is documented as an ownPropertyOnly exception; restore
isIterable/toEnumerable and document inherited Symbol.iterator behavior.

Co-authored-by: Cursor <[email protected]>
2026-07-19 14:00:05 +08:00
Yang JunandCursor 072f63c2c0 fix: tie proto key blocking to ownPropertyOnly policy
Block __proto__, constructor, and prototype only when ownPropertyOnly
is true or when access would traverse the prototype chain. Allow own
properties with those names when ownPropertyOnly is false.

Co-authored-by: Cursor <[email protected]>
2026-07-19 13:54:43 +08:00
Yang JunandCursor 3c385f74ec feat: harden scope writes, iteration, and readSize (#898)
Block writes to dangerous keys in assign/capture/increment/decrement, use own-property Symbol.iterator for plain objects when ownPropertyOnly is true, fix inherited size reads, and sanitize filter iteration scopes.

Co-authored-by: Cursor <[email protected]>
2026-07-18 19:58:14 +08:00
Yang JunandCursor 6bdf65a6a1 feat: block dangerous scope keys and harden findScope (#898)
Co-authored-by: Cursor <[email protected]>
2026-07-15 23:02:06 +08:00