Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
Cristian-Alexandru Staicu Michael Pradel
TU Darmstadt www.software-lab.org
Freezing the Web: A Study of ReDoS Vulnerabilities in - - PowerPoint PPT Presentation
Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers Cristian-Alexandru Staicu Michael Pradel TU Darmstadt www.software-lab.org 15 th August 2018 Regular Expression Denial of Service (ReDoS) i n p u t :
TU Darmstadt www.software-lab.org
1/18
1/18
1/18
1/18
1/18
,” x 1000
1/18
,” x 1000
1/18
,” x 1000
2/18
2/18
2/18
3/18
var regEx = /^a*a*b$/;
3/18
var regEx = /^a*a*b$/;
ǫ ǫ ǫ a ǫ ǫ b ǫ ǫ ǫ ǫ ǫ a ǫ
3/18
var regEx = /^a*a*b$/;
ǫ ǫ ǫ a ǫ ǫ b ǫ ǫ ǫ ǫ ǫ a ǫ
3/18
var regEx = /^a*a*b$/;
ǫ ǫ ǫ a ǫ ǫ b ǫ ǫ ǫ ǫ ǫ a ǫ
3/18
var regEx = /^a*a*b$/;
ǫ ǫ ǫ a ǫ ǫ b ǫ ǫ ǫ ǫ ǫ a ǫ
3/18
var regEx = /^a*a*b$/;
ǫ ǫ ǫ a ǫ ǫ b ǫ ǫ ǫ ǫ ǫ a ǫ
3/18
var regEx = /^a*a*b$/;
ǫ ǫ ǫ a ǫ ǫ b ǫ ǫ ǫ ǫ ǫ a ǫ
4/18
Npm modules (Phase 1) ReDoS analysis
4/18
Npm modules (Phase 1) ReDoS analysis
Exploits creation Module level vulnerabilities Usage scenarios (Phase 2)
4/18
Npm modules (Phase 1) ReDoS analysis
Exploits creation Module level vulnerabilities Usage scenarios (Phase 2) List of websites using Node.js ReDoS analysis
Payloads using HTTP requests List of vulner- able websites (Phase 3)
4/18
Npm modules (Phase 1) ReDoS analysis
Exploits creation Module level vulnerabilities Usage scenarios (Phase 2) List of websites using Node.js ReDoS analysis
Payloads using HTTP requests List of vulner- able websites (Phase 3) Local machines Live websites
5/18
6/18
b l
k i n g I / O callback
6/18
b l
k i n g I / O callback
7/18
8/18
8/18
8/18
8/18
8/18
9/18
9/18
9/18
10/18
10/18
10/18
10/18
/^([^\/]+\/[^\ s;]+) (?:(?:\s*;\s*boundary =(?:"([^" ]+)"|([^;"]+)))|(?:\s*;\s *[^=]+=(?:(?: "(?:[^" ]+)")|(?:[^;"]+))))*$/i
10/18
/^([^\/]+\/[^\ s;]+) (?:(?:\s*;\s*boundary =(?:"([^" ]+)"|([^;"]+)))|(?:\s*;\s *[^=]+=(?:(?: "(?:[^" ]+)")|(?:[^;"]+))))*$/i
/ip[honead ]+(.* os\s([\w]+)*\ slike\smac |;\ sopera)/
11/18
11/18
11/18
var MobileDetect = require("mobile -detect"); var headers = req.headers["user -agent"]; var md = new MobileDetect (headers); md.phone ();
11/18
var MobileDetect = require("mobile -detect"); var headers = req.headers["user -agent"]; var md = new MobileDetect (headers); md.phone ();
11/18
var MobileDetect = require("mobile -detect"); var headers = req.headers["user -agent"]; var md = new MobileDetect (headers); md.phone ();
12/18
ua-parser-js
12/18
ua-parser-js useragent
12/18
charset fresh forwarded content mobile-detect platform ua-parser-js useragent
13/18
13/18
13/18
13/18
14/18
15/18
16/18
16/18
charset
16/18
fresh forwarded ua-parser-js useragent mobile-detect platform charset content
17/18
17/18
17/18
18/18
18/18
18/18
18/18
18/18
18/18
18/18
18/18
50 100 150 200 250 300 350 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , Number of vulnerable websites Popularity ranking
18/18