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

Aperta Adatta ai principianti
#248 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
devtools, security

Direzione di ricerca

Inizia da package.json, yarn.lock e src/utils.js per confermare l’intervallo di versioni di lodash e gli import inclusi nei bundle, quindi verifica come il progetto genera i file in dist/. Aggiorna la risoluzione delle dipendenze, ricostruisci i bundle elencati e verifica che non contengano più il vecchio codice toNumber di lodash. Il lavoro è completato quando i bundle pubblicati usano una versione corretta di lodash e il file di lock delle dipendenze la riflette.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
1.3k
Fork
223
Merge medio
23h 14m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di frappe/datatable

Tutte le issue di frappe/datatable

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.