frappe-datatable 1.22.0 dist bundles lodash 4.17.5 code (CVE-2020-28500 and others in range)

Open Beginner friendly
#248 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js
Domain
devtools, security

Research direction

Start with package.json, yarn.lock, and src/utils.js to confirm the lodash range and bundled imports, then check how the project builds the files in dist/. Update the dependency resolution, rebuild the listed bundles, and verify they no longer contain the old lodash toNumber code. Done when the published bundles use a fixed lodash version and the dependency lockfile reflects it.

Written by the indexing model from the issue text.

Description

While scanning published npm packages for bundled third-party code we found that [email protected] (npm latest) inlines lodash 4.17.5 code into dist/frappe-datatable.cjs.js (the package main), dist/frappe-datatable.js and dist/frappe-datatable.min.js. Rollup bundles lodash/throttle, lodash/debounce and lodash/uniq (src/utils.js:1-3) from the lodash that yarn.lock pins, which is 4.17.5. package.json declares lodash ^4.17.5, so for anyone installing frappe-datatable npm resolves a current lodash (4.18.1), and npm audit and SCA tools report lodash as fixed while main runs the 4.17.5 code.

lodash 4.17.5 is in the range of these advisories:

  • lodash 4.17.5 (debounce/throttle with their toNumber helper, and uniq):
    • CVE-2020-28500 (GHSA-29mw-wpgm-hmr9): ReDoS in toNumber, trim and trimEnd (fixed 4.17.21)
    • CVE-2021-23337 (GHSA-35jh-r3h4-6jhm): command injection in template (fixed 4.17.21)
    • CVE-2020-8203 (GHSA-p6mc-m468-83gw): prototype pollution in zipObjectDeep (fixed 4.17.19)
    • CVE-2019-10744 (GHSA-jf85-cpcp-j695): prototype pollution in defaultsDeep (fixed 4.17.12)
    • CVE-2019-1010266 (GHSA-x5rq-j2xg-h7qm): ReDoS on very long input strings (fixed 4.17.11)
    • CVE-2018-16487 (GHSA-4xc9-xhrj-v574): prototype pollution in merge, mergeWith and defaultsDeep (fixed 4.17.11)
    • CVE-2025-13465 (GHSA-xxjr-mmjv-4gpg): prototype pollution in unset, omit and pullAt (fixed 4.17.23)
    • CVE-2026-4800 (GHSA-r5fr-rjxr-66jc): code injection via template imports key names (fixed 4.18.0)

Only debounce, throttle, uniq and their helpers are in the bundle, so of these only CVE-2020-28500 concerns code that ships: the bundled toNumber still trims with /^\s+|\s+$/g.

We did not find a way for these to lead to an exploit through frappe-datatable: the bundled toNumber is only applied to the wait/maxWait arguments of debounce/throttle, which are numeric constants in the datatable's own code (300 ms and 50 ms). Because the copies ship where dependency audits cannot see them, they are easy to miss. We would suggest updating when convenient.

Suggested fix: update yarn.lock so lodash@^4.17.5 resolves to >= 4.18.0 (for example by raising the declared range to ^4.18.0), rebuild dist/ and publish.

Reproduction

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

npm pack [email protected] [email protected]
mkdir d l
tar xzf frappe-datatable-1.22.0.tgz -C d; tar xzf lodash-4.17.21.tgz -C l
grep -c 'baseTrim' d/package/dist/frappe-datatable.cjs.js l/package/toNumber.js   # added in lodash 4.17.21

Expected: a non-zero count for dist/frappe-datatable.cjs.js.

Actual:

d/package/dist/frappe-datatable.cjs.js:0
l/package/toNumber.js:2

dist/frappe-datatable.cjs.js:482 still has var reTrim = /^\s+|\s+$/g;, used by toNumber at line 533 (dist/frappe-datatable.js:495/546 is the same, and the regex is also in dist/frappe-datatable.min.js).

Additional context

yarn.lock on master (5e2aa92) resolves lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0 to 4.17.5. Dependabot's #134 (2021) proposed bumping that entry to 4.17.21; it was closed unmerged on 2023-06-17 together with 20 other Dependabot PRs, with no comment, so the pin has not changed since.

Dominant language
JavaScript
Stars
1.3k
Forks
223
Avg merge
23h 14m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from frappe/datatable

All issues in frappe/datatable

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.