|
| 1 | +--- |
| 2 | +gem: lodash-rails |
| 3 | +cve: 2020-28500 |
| 4 | +ghsa: 29mw-wpgm-hmr9 |
| 5 | +url: https://github.com/advisories/GHSA-29mw-wpgm-hmr9 |
| 6 | +title: Regular Expression Denial of Service (ReDoS) in lodash |
| 7 | +date: 2022-01-06 |
| 8 | +description: | |
| 9 | + All versions of package lodash prior to 4.17.21 are vulnerable |
| 10 | + to Regular Expression Denial of Service (ReDoS) via the |
| 11 | + `toNumber`, `trim` and `trimEnd` functions. |
| 12 | +
|
| 13 | + Steps to reproduce (provided by reporter Liyuan Chen): |
| 14 | +
|
| 15 | + ``` |
| 16 | + var lo = require('lodash'); |
| 17 | +
|
| 18 | + function build_blank(n) { |
| 19 | + var ret = "1" |
| 20 | + for (var i = 0; i < n; i++) { |
| 21 | + ret += " " |
| 22 | + } |
| 23 | + return ret + "1"; |
| 24 | + } |
| 25 | + var s = build_blank(50000) var time0 = Date.now(); |
| 26 | + lo.trim(s) |
| 27 | + var time_cost0 = Date.now() - time0; |
| 28 | + console.log("time_cost0: " + time_cost0); |
| 29 | + var time1 = Date.now(); |
| 30 | + lo.toNumber(s) var time_cost1 = Date.now() - time1; |
| 31 | + console.log("time_cost1: " + time_cost1); |
| 32 | + var time2 = Date.now(); |
| 33 | + lo.trimEnd(s); |
| 34 | + var time_cost2 = Date.now() - time2; |
| 35 | + console.log("time_cost2: " + time_cost2); |
| 36 | + ``` |
| 37 | +cvss_v2: 5.0 |
| 38 | +cvss_v3: 5.3 |
| 39 | +patched_versions: |
| 40 | + - ">= 4.17.21" |
| 41 | +related: |
| 42 | + url: |
| 43 | + - https://nvd.nist.gov/vuln/detail/CVE-2020-28500 |
| 44 | + - https://github.com/lodash/lodash/pull/5065 |
| 45 | + - https://github.com/lodash/lodash/pull/5065/commits/02906b8191d3c100c193fe6f7b27d1c40f200bb7 |
| 46 | + - https://github.com/lodash/lodash/blob/npm/trimEnd.js |
| 47 | + - https://snyk.io/vuln/SNYK-JS-LODASH-1018905 |
| 48 | + - https://snyk.io/vuln/SNYK-JAVA-ORGFUJIONWEBJARS-1074896 |
| 49 | + - https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARS-1074894 |
| 50 | + - https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1074892 |
| 51 | + - https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBLODASH-1074895 |
| 52 | + - https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1074893 |
| 53 | + - https://www.oracle.com//security-alerts/cpujul2021.html |
| 54 | + - https://www.oracle.com/security-alerts/cpuoct2021.html |
| 55 | + - https://www.oracle.com/security-alerts/cpujan2022.html |
| 56 | + - https://www.oracle.com/security-alerts/cpujul2022.html |
| 57 | + - https://cert-portal.siemens.com/productcert/pdf/ssa-637483.pdf |
| 58 | + - https://github.com/lodash/lodash/commit/c4847ebe7d14540bb28a8b932a9ce1b9ecbfee1a |
| 59 | + - https://security.netapp.com/advisory/ntap-20210312-0006 |
| 60 | + - https://github.com/advisories/GHSA-29mw-wpgm-hmr9 |
0 commit comments