Skip to content

build(deps): bump js-toml from 1.1.0 to 1.2.2 - #1058

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/js-toml-1.2.2
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/js-toml-1.2.2

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 16, 2026

Copy link
Copy Markdown
Contributor

Bumps js-toml from 1.1.0 to 1.2.2.

Release notes

Sourced from js-toml's releases.

v1.2.2 — ReDoS fix in multi-line basic strings (GHSA-j4cp-cc36-jxwg)

Security release. All versions up to and including 1.2.1 are affected.

Exponential backtracking in the multi-line basic string grammar

GHSA-j4cp-cc36-jxwg, CWE-1333.

The escaped-newline rule ended in (whiteSpaceChar | newline)*, which is ambiguous with the enclosing content loop over the same characters, so an unterminated multi-line basic string made the lexer enumerate every composition of the whitespace run. Cost doubled roughly every three bytes: a 97-byte document blocked the event loop for about nine seconds, and around 160 bytes for over a year. Unlike a size-proportional CPU bug, request-size limits give no protection here.

The trailing group is redundant, since unescapeString performs line-ending-backslash trimming at interpretation time, so removing it leaves the accepted language unchanged.

Decimal integer literals are now capped at 1000 digits

CWE-400, no advisory published. NonDecimalInteger enforced MAX_RADIX_LITERAL_LENGTH while DecimalInteger passed the whole literal to BigInt() unbounded. There is no amplification to exploit: BigInt() on a decimal string measures at roughly O(n^1.28) on every supported Node, 18 through 24 each parsing a million digits in about 41 ms, and a megabyte of digits costs less to parse than a megabyte of ordinary key/value pairs. It is fixed as a consistency guard rather than as a vulnerability.

Literals longer than 1000 digits now raise SyntaxParseError instead of loading as a bigint. TOML's 64-bit integer range needs at most 20 digits, so this affects only documents that deliberately carry oversized integers.

Reported by @​arpitjain099.

v1.2.1 — official TOML 1.1 test suite + three conformance fixes

The vendored toml-test suite is upgraded from a 2022 snapshot to the official v2.2.0 TOML-1.1.0-gated set (332 → 681 cases, zero exclusions, every file byte-identical to upstream).

Running the full official suite surfaced three long-standing conformance bugs, all fixed here:

  • Dates with years below 100 were rejected — or silently mis-parsed via JavaScript's legacy Date year mapping; 0001-01-01T00:00:00Z now parses correctly.
  • Out-of-range UTC offsets such as +25:00 or +12:60 were accepted; they are now rejected per RFC 3339.
  • Duplicate super-table headers ([a.b] … [a] … [a]) were accepted; redefinition is now an error per the spec.

Note: the last two make js-toml stricter — documents relying on the previously-lenient behavior will now throw a parse error. This is spec-mandated behavior.

v1.2.0 — TOML 1.1 support

js-toml v1.2.0 — TOML v1.1.0 support

js-toml now parses TOML v1.1.0 by default. Every valid TOML 1.0 document parses exactly as before — this is a pure superset.

New syntax (enabled by default)

  • Multi-line inline tables — inline tables may span multiple lines, contain comments, and end with a trailing comma. Newlines remain invalid immediately around = and dotted-key ., per the spec's grammar.
  • \xHH escapes — two-digit hex escapes for code points up to U+00FF (e.g. "\xE9" is é).
  • \e escape — the escape character, U+001B.
  • Optional seconds — times and date-times may omit seconds (14:15, 2026-07-08 14:15); they decode as :00.

Notes

  • dump() intentionally keeps emitting TOML 1.0-compatible output, so documents you serialize stay readable by 1.0-only parsers.
  • Fractional seconds still require whole seconds (13:37.123 is invalid, per the spec).
  • Validated against the official TOML 1.1.0 ABNF; the test suite grew by 27 cases and the vendored toml-test corpus was hand-updated for 1.1 (full re-vendor of toml-test v2.2.0 tracked as a follow-up).

v1.1.2

Security

... (truncated)

Changelog

Sourced from js-toml's changelog.

[1.2.2] - 2026-08-04

Security

  • Fix exponential backtracking in the multi-line basic string grammar (GHSA-j4cp-cc36-jxwg, CWE-1333). The escaped-newline rule ended in (whiteSpaceChar | newline)*, which is ambiguous with the enclosing content loop over the same characters, so an unterminated multi-line basic string made the lexer enumerate every composition of the whitespace run. Cost doubled roughly every three bytes of input: a 97-byte document blocked the event loop for about nine seconds, and ~160 bytes for over a year. Unlike a size-proportional CPU bug, request-size limits give no protection. The trailing group is redundant, since unescapeString performs line-ending-backslash trimming at interpretation time, and removing it leaves the accepted language unchanged. All versions up to and including 1.2.1 are affected. Found while triaging an unrelated report.
  • Cap decimal integer literals at 1000 digits, matching the existing radix-prefixed cap (CWE-400). NonDecimalInteger enforced MAX_RADIX_LITERAL_LENGTH while DecimalInteger passed the whole literal to BigInt() unbounded. No advisory was published for this one: BigInt() on a decimal string measures at roughly O(n^1.28) on every supported Node (18 through 24 each parse a million digits in ~41 ms), and a megabyte of digits costs less to parse than a megabyte of ordinary key/value pairs, so there is no amplification to exploit. It is fixed as a consistency guard. Reported by @​arpitjain099.

Changed

  • Decimal integer literals longer than 1000 digits now raise SyntaxParseError instead of loading as a bigint. TOML's 64-bit integer range needs at most 20 digits, so this affects only documents that deliberately carry oversized integers.

[1.2.1] - 2026-07-08

Fixed

  • Dates with years below 100 (e.g. 0001-01-01T00:00:00Z) were rejected or mis-parsed via JavaScript's legacy Date year mapping; they now parse correctly.
  • Out-of-range UTC offsets (+25:00, +12:60) were accepted; they are now rejected per RFC 3339.
  • Duplicate super-table headers ([a.b] then [a] twice) were accepted; redefinition is now an error per the spec.

Changed

  • The vendored toml-test suite is upgraded to the official v2.2.0 TOML-1.1.0-gated set (332 → 681 cases, zero exclusions).

[1.2.0] - 2026-07-08

Added

  • TOML v1.1.0 support, enabled by default (spec changelog):
    • toml-lang/toml#904= or a dotted-key .), exactly as the spec ABNF requires.
    • \xHHtoml-lang/toml#796
    • \etoml-lang/toml#790
    • toml-lang/toml#894:00 (13:37 loads as "13:37:00"). Fractional seconds still require whole seconds per the spec ABNF.

Changed

  • Documents that were syntax errors under TOML 1.0.0 but are valid TOML 1.1.0 (see above) now parse successfully instead of throwing SyntaxParseError. Every valid TOML 1.0.0 document parses exactly as before.
  • dump() intentionally keeps emitting TOML v1.0.0-compatible output (single-line inline tables, no trailing commas, \uXXXX escapes, full-precision datetimes) so generated documents remain readable by 1.0-only parsers.

[1.1.3] - 2026-06-30

Security

  • Fix uncontrolled recursion that let deeply nested input (arrays / inline tables) or a long dotted key drive load() past the V8 call stack and throw an uncaught RangeError, violating the documented SyntaxParseError contract and enabling a denial-of-service in services that parse untrusted TOML (GHSA-3g82-77xr-68x5, CWE-674). Neither the recursive-descent parser nor the tree-walking interpreter bounded nesting depth. load() now enforces a configurable maximum depth (load(toml, { maxDepth }), default 100), rejecting over-deep input as SyntaxParseError, with a top-level backstop that converts any residual native stack overflow into SyntaxParseError as well. Reported by @​kaimandalic.

Added

  • LoadOptions with a maxDepth option for load(), and an exported DEFAULT_MAX_DEPTH constant.

[1.1.2] - 2026-05-28

... (truncated)

Commits
  • f225d38 chore(release): 1.2.2
  • 5ca2c15 fix(security): remove exponential backtracking in multi-line basic strings
  • 39f7f23 fix(security): cap decimal integer literals at 1000 digits
  • 5e7319e chore: sync package.json dev dep ranges with lockfile
  • 3bbd016 chore: bump js-yaml to 4.3.0 to fix Dependabot alert (GHSA-h67p-54hq-rp68)
  • 0551c79 docs: refresh Trusted By list and state toml-test suite pass
  • 0e30a87 chore: release v1.2.1
  • 09d9e59 Merge pull request #7 from sunnyadn/chore/toml-test-revendor
  • dd3804a fix(test): path-separator-agnostic encoding-case guard for Windows
  • 781ece3 chore: re-vendor toml-test v2.2.0 (TOML 1.1 gated set) and fix three conforma...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps [js-toml](https://github.com/sunnyadn/js-toml) from 1.1.0 to 1.2.2.
- [Release notes](https://github.com/sunnyadn/js-toml/releases)
- [Changelog](https://github.com/sunnyadn/js-toml/blob/main/CHANGELOG.md)
- [Commits](sunnyadn/js-toml@v1.1.0...v1.2.2)

---
updated-dependencies:
- dependency-name: js-toml
  dependency-version: 1.2.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Nov 16, 2026
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.27%. Comparing base (5301f43) to head (d269882).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1058   +/-   ##
=======================================
  Coverage   27.27%   27.27%           
=======================================
  Files           9        9           
  Lines          22       22           
  Branches        1        1           
=======================================
  Hits            6        6           
  Misses         16       16           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants