Skip to content

Commit ad39293

Browse files
committed
docs(core): replace the dangling SECURITY_FIX_SUMMARY @see with its rationale
`SimpleExpressionEvaluator`'s doc block pointed at https://github.com/objectstack-ai/objectui/blob/main/SECURITY_FIX_SUMMARY.md. That file was deleted in ea72f18 — a 20-file bulk removal of the root-level PR #300 / v0.4.0 summaries, 6742 deletions and zero insertions, so the content was dropped outright rather than migrated. The link has 404'd since. Reading `git show ea72f18^:SECURITY_FIX_SUMMARY.md` shows the doc block already repeats most of what it carried (the operator list, the LIMITATIONS list verbatim). One thing it carried is NOT in the doc block and is load-bearing: the parser exists because CodeQL flagged the previous `new Function(...contextKeys, "'use strict'; return (…)")` as "Unsafe code constructed from library input". That makes the ban on dynamic code execution a remediation constraint a future maintainer must not trade away for expressiveness or speed, not a style preference. That sentence is now inline, and the provenance points at the immutable git object instead of a `main` blob path that no longer resolves. Comment-only: `SimpleExpressionEvaluator` is not exported, so nothing changes in the emitted `.d.ts`, and no behaviour, type or API surface moves.
1 parent 79ebf30 commit ad39293

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
---
3+
4+
Comment-only change in `@object-ui/core`: the `SimpleExpressionEvaluator` doc block
5+
no longer points at the deleted `SECURITY_FIX_SUMMARY.md`, and states the security
6+
rationale inline instead. Releases nothing — the class is not exported, so the doc
7+
block reaches no `.d.ts`, and no behaviour, type or API surface changes.

‎packages/core/src/validation/validators/object-validation-engine.ts‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,15 @@ export interface ValidationExpressionEvaluator {
199199
* Simple expression evaluator using a simple parser (no dynamic code execution)
200200
*
201201
* SECURITY: This implementation parses expressions into an AST and evaluates them
202-
* without using eval() or new Function(). It supports:
202+
* without using eval() or new Function(). That is a remediation, not a style
203+
* preference: an earlier revision compiled the predicate with
204+
* `new Function(...contextKeys, "'use strict'; return (" + expression + ")")`,
205+
* and CodeQL flagged it as "Unsafe code constructed from library input" —
206+
* expressions reach this class from validation metadata, so that shape is a
207+
* code-injection vector in any consumer that renders metadata it does not
208+
* control. Never reintroduce eval(), new Function() or any other dynamic-code
209+
* path here to buy expressiveness or speed; extend the parser, or inject a
210+
* richer evaluator through the constructor (see NOT CEL below). Supports:
203211
* - Comparison operators: ==, !=, >, <, >=, <=
204212
* - Logical operators: &&, ||, !
205213
* - Property access: record.field, record['field']
@@ -218,7 +226,10 @@ export interface ValidationExpressionEvaluator {
218226
* pre-check agree with the server on richer predicates, pass a CEL-backed
219227
* `ValidationExpressionEvaluator` to the constructor.
220228
*
221-
* @see https://github.com/objectstack-ai/objectui/blob/main/SECURITY_FIX_SUMMARY.md
229+
* The write-up this block used to link to (`SECURITY_FIX_SUMMARY.md`) was
230+
* deleted with no successor; its load-bearing reasoning is inline above, and
231+
* the original text remains readable at
232+
* `git show ea72f1886^:SECURITY_FIX_SUMMARY.md`.
222233
*/
223234
class SimpleExpressionEvaluator implements ValidationExpressionEvaluator {
224235
evaluate(expression: string, context: Record<string, any>): any {

0 commit comments

Comments
 (0)