Skip to content

Releases

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 07:31

Added

  • Every parse failure carries a stable code: EXPR_SYNTAX, EXPR_TOO_LONG
    or EXPR_TOO_DEEP -- ExprSyntaxError.code in TypeScript and Python,
    ExprSyntaxError::$errorCode in PHP (Exception already owns an integer
    $code). Branch on the code; the message may change. The limits are exported
    as MAX_EXPRESSION_BYTES (8192) and MAX_EXPRESSION_DEPTH (64), and
    ExprErrorCode as 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/limits table (27 rows) from the pinned package -- 27/27 in TypeScript,
    PHP and Python. expr/evaluate and expr/references are unchanged at
    0.35.0. Nothing a consumer installs changes; do nothing.

Fixed

  • CHANGELOG.md is now in the published tarball. files did 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 suite expr/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 -- threw RangeError in Node and
    RecursionError in Python, and a 4000-term sum parsed fine and then
    overflowed while being EVALUATED. Neither is ExprSyntaxError, 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 throws ExprSyntaxError, 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 allowlist job in publish.yml now 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 need id-token: write for
    Trusted Publishing, and a workflow-level contents: read would have read as
    the safe choice while breaking every release. Nothing for a consumer to do.

  • source-map-js is pinned forward to ^1.2.2 via overrides. 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 resolves vite 8.3.5 (was 8.2.2), whose bundled
    launch-editor fixes 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). vite is 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.

v0.1.1

Choose a tag to compare

@wishborn wishborn released this 30 Sep 23:26

Changed

  • Re-released through CI so latest carries provenance. No code changed
    between 0.1.0 and this; the tarballs are the same package.

    0.1.0 was published from a laptop to claim the npm name, because OIDC
    publishes to an existing name and cannot create one. A laptop publish
    carries no attestations — provenance is signed from OIDC inside CI, which
    could not run until the name and its Trusted Publisher existed. 0.1.0 is
    therefore the only version of this package that will ever lack provenance,
    and it stays on the registry: published versions are never unpublished.

    Consumer action: none. Take 0.1.1 if you want the signed artifact;
    0.1.0 is byte-identical in behaviour.