Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.

Commit da32007

Browse files
authored
Merge pull request #1610 from theMiddleBlue/CVE-2019-11043
New Rule 921190: HTTP Splitting
2 parents 7f22803 + 4ee4260 commit da32007

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

rules/REQUEST-921-PROTOCOL-ATTACK.conf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,31 @@ SecRule ARGS_GET_NAMES|ARGS_GET "@rx (?:\n|\r)+(?:\s|location|refresh|(?:set-)?c
193193
setvar:'tx.anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
194194

195195

196+
# -=[ HTTP Splitting ]=-
197+
#
198+
# This rule detect \n or \r in the REQUEST FILENAME
199+
# Reference: https://www.owasp.org/index.php/Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-016)
200+
#
201+
SecRule REQUEST_FILENAME "@rx [\n\r]" \
202+
"id:921190,\
203+
phase:1,\
204+
block,\
205+
t:none,t:urlDecodeUni,\
206+
msg:'HTTP Splitting (CR/LF in request filename detected)',\
207+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
208+
tag:'application-multi',\
209+
tag:'language-multi',\
210+
tag:'platform-multi',\
211+
tag:'attack-protocol',\
212+
tag:'paranoia-level/1',\
213+
tag:'OWASP_CRS',\
214+
tag:'OWASP_CRS/WEB_ATTACK/HTTP_SPLITTING',\
215+
ctl:auditLogParts=+E,\
216+
ver:'OWASP_CRS/3.2.0',\
217+
severity:'CRITICAL',\
218+
setvar:'tx.http_violation_score=+%{tx.critical_anomaly_score}',\
219+
setvar:'tx.anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
220+
196221

197222
SecRule TX:EXECUTING_PARANOIA_LEVEL "@lt 2" "id:921013,phase:1,pass,nolog,skipAfter:END-REQUEST-921-PROTOCOL-ATTACK"
198223
SecRule TX:EXECUTING_PARANOIA_LEVEL "@lt 2" "id:921014,phase:2,pass,nolog,skipAfter:END-REQUEST-921-PROTOCOL-ATTACK"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
meta:
3+
author: "Andrea Menin (theMiddle)"
4+
description: "HTTP Splitting"
5+
enabled: true
6+
name: 921190.yaml
7+
tests:
8+
-
9+
test_title: 921190-1
10+
desc: "New line char in request filename (1)"
11+
stages:
12+
- stage:
13+
input:
14+
dest_addr: "127.0.0.1"
15+
headers:
16+
Host: "localhost"
17+
User-Agent: "ModSecurity CRS 3 Tests"
18+
port: 80
19+
uri: "/foo%0Abar"
20+
output:
21+
log_contains: id "921190"
22+
-
23+
test_title: 921190-2
24+
desc: "New line char in request filename (2)"
25+
stages:
26+
- stage:
27+
input:
28+
dest_addr: "127.0.0.1"
29+
headers:
30+
Host: "localhost"
31+
User-Agent: "ModSecurity CRS 3 Tests"
32+
port: 80
33+
uri: "/foo%0abar"
34+
output:
35+
log_contains: id "921190"
36+
-
37+
test_title: 921190-3
38+
desc: "FastCGI variable injection: Nginx + PHP-FPM (CVE-2019-11043)"
39+
stages:
40+
- stage:
41+
input:
42+
dest_addr: "127.0.0.1"
43+
headers:
44+
Host: "localhost"
45+
User-Agent: "ModSecurity CRS 3 Tests"
46+
port: 80
47+
uri: "/index.php/PHP%0Ainfo.php?QQQ"
48+
output:
49+
log_contains: id "921190"
50+
-
51+
test_title: 921190-4
52+
desc: "PHP Settings injection: Nginx + PHP-FPM (CVE-2019-11043)"
53+
stages:
54+
- stage:
55+
input:
56+
dest_addr: "127.0.0.1"
57+
headers:
58+
Host: "localhost"
59+
User-Agent: "ModSecurity CRS 3 Tests"
60+
port: 80
61+
uri: "/index.php/PHP_VALUE%0Asession.auto_start=1;;;?QQQ"
62+
output:
63+
log_contains: id "921190"

0 commit comments

Comments
 (0)