Vulnerability library
Security checkJuly 21, 2026

js-toml has silent type confusion via falsy-primitive duplicate-key bypass

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpmjs-toml

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

js-toml’s interpreter checks whether a key already exists in a parser-built container with if (object[key]) instead of if (key in object). When the prior value is a falsy primitive — false, 0, 0n, 0.0, -0, or "" — the duplicate-key branch is skipped and the value is silently overwritten by a later sub-table, dotted-key sub-table, or array-of-tables sharing the same name.

Recommendation

Update the js-toml package to the latest compatible version. Followings are version details:

  • Affected version(s): <= 1.1.1
  • Patched version(s): 1.1.2

References

Could your website be exposed too?

SmartScanner can check your website for js-toml has silent type confusion via falsy-primitive duplicate-key bypass and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated July 21, 2026