Repository navigation
Added
- Every parse failure carries a stable code:
EXPR_SYNTAX,EXPR_TOO_LONG
orEXPR_TOO_DEEP--ExprSyntaxError.codein TypeScript and Python,
ExprSyntaxError::$errorCodein PHP (Exception already owns an integer
$code). Branch on the code; the message may change. The limits are exported
asMAX_EXPRESSION_BYTES(8192) andMAX_EXPRESSION_DEPTH(64), and
ExprErrorCodeas a type in TypeScript and Python.
Changed
- Tests only: the pinned fancy-conformance fixture set moved 0.22.1 ->
0.35.0 in all three legs, and each leg's conformance test now runs the
expr/limitstable (27 rows) from the pinned package -- 27/27 in TypeScript,
PHP and Python.expr/evaluateandexpr/referencesare unchanged at
0.35.0. Nothing a consumer installs changes; do nothing.
Fixed
CHANGELOG.mdis now in the published tarball.filesdid not whitelist it, so npm never shipped it — and this package puts breaking changes in MINOR releases and tells you in the README to read the entry before taking one. The instruction existed for the author, who has the file, and not for the consumer, who is the only one being instructed. Nothing for you to do; the file simply arrives from this release on.
Security
-
Input length and nesting depth are now bounded (GRAMMAR.md "Limits",
conformance suiteexpr/limits). The parser is recursive descent and had no
bound, so((((...from an end user or an agent overflowed the stack:
4000 nested parentheses -- 8001 bytes -- threwRangeErrorin Node and
RecursionErrorin Python, and a 4000-term sum parsed fine and then
overflowed while being EVALUATED. Neither isExprSyntaxError, so a host
validating expressions at save time crashed instead of refusing. PHP's stack
happened to hold at that size. Now an expression over 8192 UTF-8 bytes is
EXPR_TOO_LONG(checked before tokenizing) and one deeper than 64 levels is
EXPR_TOO_DEEP(checked during parsing, before the recursion that would
overflow). Messages no longer quote more than 120 characters of the
expression.Possibly breaking, and what to do: an expression over 8 KiB or nested past
64 levels that used to evaluate now throwsExprSyntaxError, which every
caller already handles as "invalid". Nothing realistic is that deep -- 64
levels is 63 nested parentheses or a 64-term+chain -- so unless you
generate expressions mechanically, do nothing. If you do, keep a generated
+chain under 64 terms.ExprSyntaxError's constructor gained an optional
trailing parameter; existing calls are unaffected. -
Update Vitest to 4.1.12 for security fixes; dev toolchain only, nothing to do.
-
The
allowlistjob inpublish.ymlnow caps its token to
contents: read. It was the only job in that file without a
permissions:block, so it inherited the repository default (CodeQL
actions/missing-workflow-permissions, alert #2). Capped PER JOB rather than
workflow-wide on purpose: the npm and PyPI jobs needid-token: writefor
Trusted Publishing, and a workflow-levelcontents: readwould have read as
the safe choice while breaking every release. Nothing for a consumer to do. -
source-map-jsis pinned forward to^1.2.2viaoverrides. Versions up to
1.2.1 allow an event-loop denial of service through indexed source-map section
offsets, and it arrives here transitively through the build toolchain.
Nothing for a consumer to do, and no runtime change: an npm package does
not ship a lockfile, so this governs builds OF this repo, not anything
installed FROM it. Recorded rather than left silent because the override it
sits beside —shell-quote^1.9.0, added for an earlier advisory — was
carried with no note of why, and had drifted back inside the vulnerable range
before anyone looked. -
Dev toolchain only — no runtime change, nothing for consumers to do. The
lockfile now resolvesvite8.3.5 (was 8.2.2), whose bundled
launch-editorfixes GHSA-587h-7wmj-h5pm (HIGH,fs.existsSync()check
bypassable on Windows), GHSA-698v-4r3x-3vcv (escapeCmdArgs()omits%
escaping on Windows) and GHSA-r825-w8mm-5pxw (editor CLI flag
misinterpretation).viteis only reached through the test/dev toolchain
and the published package does not ship our lockfile, so the exposure was
this repo's own dev server.