mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
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]>
This commit is contained in:
@@ -46,9 +46,9 @@ describe('scope security', function () {
|
||||
await expect(liquid.parseAndRender('{{ constructor.name }}', scope)).resolves.toBe('Custom')
|
||||
})
|
||||
|
||||
it('should still block inherited blocked keys when ownPropertyOnly=true', async function () {
|
||||
it('should block inherited properties when ownPropertyOnly=true', async function () {
|
||||
const scope = { foo: Object.create({ __proto__: { bar: 'BAR' }, constructor: { name: 'Evil' } }) }
|
||||
await expect(liquid.parseAndRender('{{ foo.__proto__.bar }}', scope)).resolves.toBe('')
|
||||
await expect(liquid.parseAndRender('{{ foo.constructor.name }}', scope)).resolves.toBe('')
|
||||
await expect(liquid.parseAndRender('{{ foo.__proto__ }}', scope)).resolves.toBe('')
|
||||
await expect(liquid.parseAndRender('{{ foo.constructor }}', scope)).resolves.toBe('')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user