GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lodash.truncate 4.4.2 still has the pre-fix lodash toNumber (CVE-2020-28500), and npm audit cannot see it · Issue #241 · gajus/table

lodash.truncate 4.4.2 still has the pre-fix lodash toNumber (CVE-2020-28500), and npm audit cannot see it #241

New issue
Copy link
New issue
Copy link
Closed
Closed
lodash.truncate 4.4.2 still has the pre-fix lodash toNumber (CVE-2020-28500), and npm audit cannot see it#241
Copy link
Labels
released

Description

@taxor03
taxor03
opened on Nov 4, 2026
Issue body actions

While scanning published npm packages for third-party code that audits miss, we found that [email protected] (npm latest) depends on lodash.truncate ^4.4.2 (dist/src/truncateTableData.js:7). lodash.truncate 4.4.2, its latest release (2016), contains lodash's toNumber from before the CVE-2020-28500 fix:

  • CVE-2020-28500 (GHSA-29mw-wpgm-hmr9): ReDoS in toNumber, trim and trimEnd through /^\s+|\s+$/g (fixed in lodash 4.17.21, which replaced it with baseTrim)

In lodash.truncate the regex is var reTrim = /^\s+|\s+$/g; (index.js:24), used by toNumber (:507). truncate() reaches it through toInteger(options.length) (:582).

The advisory lists lodash, lodash-es, lodash-rails, lodash.trim and lodash.trimend, but not lodash.truncate, and no fixed lodash.truncate release exists. So npm audit and SCA tools report nothing for table or for the bundles that inline it (for example aws-cdk through @aws-cdk/cloudformation-diff). #136 moved from lodash to per-method packages to avoid CVE reports, and #186 later asked to move back. With per-method packages, this code stays in the tree without any advisory pointing at it.

We did not find a way for it to lead to an exploit through table: truncateString passes the column's numeric truncate width as length, and toNumber returns early for numbers. Because the code ships where dependency audits cannot see it, it is easy to miss. We would suggest updating when convenient.

Suggested fix: replace lodash.truncate with a small local truncate (table only needs length and the … omission, and truncateString was just reworked for #220 and #113), or with lodash/truncate from lodash >= 4.17.21.

Reproduction

Checked against the published tarballs on 2026-11-04 (npm latest):

npm pack [email protected] [email protected]
mkdir t lt
tar xzf table-6.10.0.tgz -C t; tar xzf lodash.truncate-4.4.2.tgz -C lt
node -p "require('./t/package/package.json').dependencies['lodash.truncate']"
grep -n 'require("lodash.truncate")' t/package/dist/src/truncateTableData.js
grep -n "var reTrim\|value.replace(reTrim\|toInteger(options.length)" lt/package/index.js

Output:

^4.4.2
7:const lodash_truncate_1 = __importDefault(require("lodash.truncate"));
24:var reTrim = /^\s+|\s+$/g;
507:  value = value.replace(reTrim, '');
582:    length = 'length' in options ? toInteger(options.length) : length;

Activity

  1. gajus
    closed this as completedin b8688bdon Nov 4, 2026
  2. github-actions commented on Nov 4, 2026

    @github-actions
    github-actionsBot
    on Nov 4, 2026 – with GitHub Actions
    More actions

    🎉 This issue has been resolved in version 6.10.1 🎉

    The release is available on:

    • npm package (@latest dist-tag)
    • GitHub release

    Your semantic-release bot 📦🚀

  3. github-actions
    added
    released
    on Nov 4, 2026
  4. gajus commented on Nov 4, 2026

    @gajus
    gajus
    on Nov 4, 2026
    Owner
    More actions

    Thanks for the clear report. Confirmed: lodash.truncate 4.4.2 still contains the pre-fix toNumber, and the advisory does not cover it, so audits cannot flag it. As you found, table cannot reach it: the only value it passes as length is the truncate option, which is validated as an integer, and toNumber returns before the regex for numbers. 6.10.1 removes the dependency; truncation now uses table's own character handling.

    Reacted by Sungmin Park
  5. karthiksenv
    added a commit that references this issue on Nov 13, 2026

    fix(cli): stop bundling lodash.truncate 4.4.2 (CVE-2020-28500) (aws#2137

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    released

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.