@zvenigora/ng-eval-core 0.10.0 → 0.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/CHANGELOG.md +119 -1
- package/fesm2022/zvenigora-ng-eval-core.mjs +600 -483
- package/fesm2022/zvenigora-ng-eval-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/zvenigora-ng-eval-core.d.ts +44 -138
package/CHANGELOG.md
CHANGED
|
@@ -14,7 +14,125 @@ Versions 0.1.104–0.1.107 are on npm without entries here.
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
## [0.
|
|
17
|
+
## [0.11.0] - 2026-10-04
|
|
18
|
+
|
|
19
|
+
**A security fix: an expression no longer resolves a name on the prototype-pollution blocklist
|
|
20
|
+
against its context. Also, the member-write policy is asked about built-in methods that write,
|
|
21
|
+
and seventeen unused exports are removed.** A breaking minor, in three ways. An expression that
|
|
22
|
+
names such a key of its context now throws ([B6](../../docs/backlog-retired.md#b6)). An import of
|
|
23
|
+
a removed symbol breaks ([B5](../../docs/backlog-retired.md#b5)). And a context that implements
|
|
24
|
+
`checkMemberWrite` is asked about calls it was not asked about before
|
|
25
|
+
([C4](../../docs/backlog-retired.md#c4)). The one other change to an exported symbol is an
|
|
26
|
+
addition, `EvalMemberWrite.method`. The `.d.ts` loses the seventeen, gains `method`, and changes
|
|
27
|
+
documentation comments: `checkMemberWrite` loses the paragraph that said a method call was outside
|
|
28
|
+
what it sees. `eval-signals` 0.4.0 builds on the change and requires this version.
|
|
29
|
+
|
|
30
|
+
### Security
|
|
31
|
+
- **An expression no longer resolves a name on the prototype-pollution blocklist against its
|
|
32
|
+
context — [B6](../../docs/backlog-retired.md#b6).** An identifier is resolved against the
|
|
33
|
+
context, and for a context built from a plain object or a class instance the lookup was a bare
|
|
34
|
+
property access, so an identifier resolved the members the context inherits from
|
|
35
|
+
`Object.prototype`; so did `this.k` and `this["k"]`. The blocklist guarded member access to the
|
|
36
|
+
objects an expression holds, not resolution against the context, and through `Object`'s own
|
|
37
|
+
static functions an expression could then modify shared prototypes. Every published version
|
|
38
|
+
up to 0.10.0 is affected.
|
|
39
|
+
- **Now refused before any lookup**, with the error the member visitor throws for any other
|
|
40
|
+
object, `Access to dangerous property "constructor" is blocked for security reasons`:
|
|
41
|
+
`__proto__`, `constructor`, `prototype`, the four `__define…` and `__lookup…` accessors,
|
|
42
|
+
`hasOwnProperty`, `isPrototypeOf`, `propertyIsEnumerable`, `toString`, `valueOf` and
|
|
43
|
+
`toLocaleString`, as an identifier, as `this.k` or `this["k"]`, or as a member of an
|
|
44
|
+
`EvalScope` held in the context. This applies over every kind of context: a plain object, a
|
|
45
|
+
`Registry`, a class instance, an `EvalContext`, a prior scope or a signal context. Under
|
|
46
|
+
`caseInsensitive` the key the lookup matched is checked too, so `CONSTRUCTOR` over a context
|
|
47
|
+
that holds `constructor` is refused.
|
|
48
|
+
- **A context key with one of those names can no longer be read by an expression**, even where
|
|
49
|
+
the context holds it as a key of its own, as a `Registry` or a signal context's source can.
|
|
50
|
+
Rename the key. An arrow parameter or a `let` with one of these names was already refused.
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- **`EvalMemberWrite.method`**, optional: the built-in method about to make a write, named as
|
|
54
|
+
the specification names it, `'Array.prototype.push'` or `'Object.assign'`. Undefined for an
|
|
55
|
+
assignment or an update. [C4](../../docs/backlog-retired.md#c4).
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
- **A context that implements `checkMemberWrite` is also asked before a built-in method writes
|
|
59
|
+
into an object it is handed — [C4](../../docs/backlog-retired.md#c4).** The call visitor asks
|
|
60
|
+
before calling `Array`'s `copyWithin`, `fill`, `pop`, `push`, `reverse`, `shift`, `sort`,
|
|
61
|
+
`splice` or `unshift`, the typed arrays' `copyWithin`, `fill`, `reverse`, `set` or `sort`,
|
|
62
|
+
`Map`'s and `WeakMap`'s `set` and `delete`, `Map`'s and `Set`'s `clear`, `Set`'s and
|
|
63
|
+
`WeakSet`'s `add` and `delete`, a `Date` setter, or, when a context supplies `Object`, its
|
|
64
|
+
`assign`, `defineProperty`, `defineProperties`, `setPrototypeOf`, `freeze`, `seal` or
|
|
65
|
+
`preventExtensions`. Each is matched by identity, so a method of your own named `push` is not
|
|
66
|
+
asked about, and `Array.prototype.push` reached under another name is. The target is the object
|
|
67
|
+
the method writes into: its receiver, which is the context itself for a bare call, or, for
|
|
68
|
+
`Object`'s, its first argument. Reached through `Function.prototype.call`, `apply` or `bind`, a
|
|
69
|
+
method is asked about as a direct call of it, with the `this` they pass as its receiver
|
|
70
|
+
([C5](../../docs/backlog-retired.md#c5)); `bind` is asked when it binds, so `[].push.bind(a)`
|
|
71
|
+
is refused before the bound function exists. `createdByEvaluation` comes from the same record
|
|
72
|
+
as for a member write, so `[...a].sort()` on a copy the walk made is allowed; `key` is
|
|
73
|
+
undefined. Throwing refuses the call, and it is not made. A context that does not implement the
|
|
74
|
+
method pays one field read per call, and nothing else changes for it.
|
|
75
|
+
- **Not asked about:** `test` and `exec` on a regex, which advance a global or sticky one's
|
|
76
|
+
`lastIndex`; and a method you wrote.
|
|
77
|
+
- `checkMemberWrite`'s JSDoc no longer says a method call is outside what it sees, and
|
|
78
|
+
`EvalMemberWrite`'s says what `target` and `key` are for a method call.
|
|
79
|
+
|
|
80
|
+
### Removed
|
|
81
|
+
- **Seventeen exports nothing in the library used — [B5](../../docs/backlog-retired.md#b5).**
|
|
82
|
+
No non-spec source in the three packages referenced any of them beyond its own declaration and
|
|
83
|
+
the barrels. Removing an export breaks a consumer that imports it, so this is a breaking minor;
|
|
84
|
+
nothing else about the library changes.
|
|
85
|
+
- **`RecursiveVisitorState`** and **`RecursiveVisitorResult`**, `@deprecated` since 0.3.0. Use
|
|
86
|
+
`EvalHooks` to observe a walk, and `EvalState` and `EvalResult` for its state and result.
|
|
87
|
+
- **`ScopeOptions`**. Use `EvalScopeOptions`, which is what `EvalScope` takes.
|
|
88
|
+
- **`ScopeType`** and **`RegistryOptionType`**, which nothing implemented. No replacement.
|
|
89
|
+
- **`RecursiveVisitorOptions`**, **`RecursiveVisitorContext`**,
|
|
90
|
+
**`RecursiveVisitorResultType`**, **`RecursiveVisitorStackResult`**,
|
|
91
|
+
**`RecursiveVisitorRegistryResult`**, **`RecursiveVisitor`**, **`RecursiveAggregateVisitor`**
|
|
92
|
+
and **`AggregateType`**, the rest of the visitor vocabulary those two belonged to. No
|
|
93
|
+
replacement: the visitors are not public.
|
|
94
|
+
- **`Queue`** and **`QueueType`**. No replacement; an array's `push` and `shift` do the same.
|
|
95
|
+
- **`getContextKey`**. No replacement. `EvalContext.getKey` answers the question for a whole
|
|
96
|
+
context, and unlike this function it answers `undefined` for a key nothing holds.
|
|
97
|
+
- **`isRegistryContext`**. No replacement; `context instanceof Registry` is the test the
|
|
98
|
+
library itself uses.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## [0.10.1] - 2026-10-05
|
|
103
|
+
|
|
104
|
+
**A security fix: an expression no longer resolves a name on the prototype-pollution blocklist
|
|
105
|
+
against its context.** A patch for every version up to 0.10.0, with no exported symbol changed.
|
|
106
|
+
It is a patch although an expression that names such a key of its context now throws where it
|
|
107
|
+
used to read a value: the names are `Object.prototype`'s own, a context key with one of them is
|
|
108
|
+
rare, and the defect is a security one. `eval-signals` 0.3.0 and `eval-forms` 0.3.x admit it in
|
|
109
|
+
their peer ranges.
|
|
110
|
+
|
|
111
|
+
### Security
|
|
112
|
+
- **An expression no longer resolves a name on the prototype-pollution blocklist against its
|
|
113
|
+
context** (B6 in the repository's backlog). An identifier is resolved against the context, and
|
|
114
|
+
for a context built from a plain object or a class instance the lookup was a bare property
|
|
115
|
+
access, so an identifier resolved the members the context inherits from `Object.prototype`; so
|
|
116
|
+
did `this.k` and `this["k"]`. The blocklist guarded member access to the objects an expression
|
|
117
|
+
holds, not resolution against the context, and through `Object`'s own static functions an
|
|
118
|
+
expression could then modify shared prototypes. Every published version up to 0.10.0 is
|
|
119
|
+
affected.
|
|
120
|
+
- **Now refused before any lookup**, with the error the member visitor throws for any other
|
|
121
|
+
object, `Access to dangerous property "constructor" is blocked for security reasons`:
|
|
122
|
+
`__proto__`, `constructor`, `prototype`, the four `__define…` and `__lookup…` accessors,
|
|
123
|
+
`hasOwnProperty`, `isPrototypeOf`, `propertyIsEnumerable`, `toString`, `valueOf` and
|
|
124
|
+
`toLocaleString`, as an identifier, as `this.k` or `this["k"]`, or as a member of an
|
|
125
|
+
`EvalScope` held in the context. This applies over every kind of context: a plain object, a
|
|
126
|
+
`Registry`, a class instance, an `EvalContext`, a prior scope or a signal context. Under
|
|
127
|
+
`caseInsensitive` the key the lookup matched is checked too, so `CONSTRUCTOR` over a context
|
|
128
|
+
that holds `constructor` is refused.
|
|
129
|
+
- **A context key with one of those names can no longer be read by an expression**, even where
|
|
130
|
+
the context holds it as a key of its own, as a `Registry` or a signal context's source can.
|
|
131
|
+
Rename the key. An arrow parameter or a `let` with one of these names was already refused.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## [0.10.0] - 2026-10-04
|
|
18
136
|
|
|
19
137
|
**An opt-in member-write policy on `EvalContext`, and three fixes.** Nothing changes for a context
|
|
20
138
|
that does not opt in, and every change to an exported symbol is an addition: `EvalContext` gains
|