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

Commit 0f6b881

Browse files
committed
Drop the translate header from the restricted list
Fixes #1410.
1 parent b77507f commit 0f6b881

File tree

5 files changed

+10
-49
lines changed

5 files changed

+10
-49
lines changed

crs-setup.conf.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,15 @@ SecDefaultAction "phase:2,log,auditlog,pass"
431431
# Forbidden request headers.
432432
# Header names should be lowercase, enclosed by /slashes/ as delimiters.
433433
# Blocking Proxy header prevents 'httpoxy' vulnerability: https://httpoxy.org
434-
# Default: /proxy/ /lock-token/ /content-range/ /translate/ /if/
434+
# Default: /proxy/ /lock-token/ /content-range/ /if/
435435
# Uncomment this rule to change the default.
436436
#SecAction \
437437
# "id:900250,\
438438
# phase:1,\
439439
# nolog,\
440440
# pass,\
441441
# t:none,\
442-
# setvar:'tx.restricted_headers=/proxy/ /lock-token/ /content-range/ /translate/ /if/'"
442+
# setvar:'tx.restricted_headers=/proxy/ /lock-token/ /content-range/ /if/'"
443443

444444
# File extensions considered static files.
445445
# Extensions include the dot, lowercase, enclosed by /slashes/ as delimiters.

rules/REQUEST-901-INITIALIZATION.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ SecRule &TX:restricted_headers "@eq 0" \
200200
phase:1,\
201201
pass,\
202202
nolog,\
203-
setvar:'tx.restricted_headers=/proxy/ /lock-token/ /content-range/ /translate/ /if/'"
203+
setvar:'tx.restricted_headers=/proxy/ /lock-token/ /content-range/ /if/'"
204204

205205
# Default HTTP policy: static_extensions (rule 900260)
206206
SecRule &TX:static_extensions "@eq 0" \

util/docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The following environment variables are available to configure the CRS container
2828
| ALLOWED_REQUEST_CONTENT_TYPE_CHARSET | A string indicating the allowed_request_content_type_charset (Default: utf-8\|iso-8859-1\|iso-8859-15\|windows-1252) |
2929
| ALLOWED_HTTP_VERSIONS | A string indicating the allowed_http_versions (Default: HTTP/1.0 HTTP/1.1 HTTP/2 HTTP/2.0) |
3030
| RESTRICTED_EXTENSIONS | A string indicating the restricted_extensions (Default: .asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx/) |
31-
| RESTRICTED_HEADERS | A string indicating the restricted_headers (Default: /proxy/ /lock-token/ /content-range/ /translate/ /if/) |
31+
| RESTRICTED_HEADERS | A string indicating the restricted_headers (Default: /proxy/ /lock-token/ /content-range/ /if/) |
3232
| STATIC_EXTENSIONS | A string indicating the static_extensions (Default: /.jpg/ /.jpeg/ /.png/ /.gif/ /.js/ /.css/ /.ico/ /.svg/ /.webp/) |
3333
| MAX_NUM_ARGS | An integer indicating the max_num_args (Default: unlimited) |
3434
| ARG_NAME_LENGTH | An integer indicating the arg_name_length (Default: unlimited) |

util/docker/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ services:
5353
#- ALLOWED_REQUEST_CONTENT_TYPE_CHARSET=utf-8|iso-8859-1|iso-8859-15|windows-1252
5454
#- ALLOWED_HTTP_VERSIONS=HTTP/1.0 HTTP/1.1 HTTP/2 HTTP/2.0
5555
#- RESTRICTED_EXTENSIONS=.asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx/
56-
#- RESTRICTED_HEADERS=/proxy/ /lock-token/ /content-range/ /translate/ /if/
56+
#- RESTRICTED_HEADERS=/proxy/ /lock-token/ /content-range/ /if/
5757
#- STATIC_EXTENSIONS=/.jpg/ /.jpeg/ /.png/ /.gif/ /.js/ /.css/ /.ico/ /.svg/ /.webp/
5858

5959
#######################################################

util/regression-tests/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920450.yaml

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@
77
tests:
88
-
99
test_title: 920450-1
10-
stages:
11-
-
12-
stage:
13-
input:
14-
dest_addr: "127.0.0.1"
15-
port: 80
16-
headers:
17-
User-Agent: "ModSecurity CRS 3 Tests"
18-
Host: "localhost"
19-
translate: "test"
20-
output:
21-
log_contains: "id \"920450\""
22-
-
23-
test_title: 920450-2
2410
stages:
2511
-
2612
stage:
@@ -34,7 +20,7 @@
3420
output:
3521
log_contains: "id \"920450\""
3622
-
37-
test_title: 920450-3
23+
test_title: 920450-2
3824
stages:
3925
-
4026
stage:
@@ -48,7 +34,7 @@
4834
output:
4935
log_contains: "id \"920450\""
5036
-
51-
test_title: 920450-4
37+
test_title: 920450-3
5238
stages:
5339
-
5440
stage:
@@ -63,7 +49,7 @@
6349
log_contains: "id \"920450\""
6450

6551
-
66-
test_title: 920450-5
52+
test_title: 920450-4
6753
desc: HTTP header is restricted by policy (920450) from old modsec regressions, we no longer block proxy-connection in 3.0
6854
stages:
6955
-
@@ -87,32 +73,7 @@
8773
no_log_contains: id "920450"
8874

8975
-
90-
test_title: 920450-6
91-
desc: HTTP header is restricted by policy (920450) from old modsec regressions
92-
stages:
93-
-
94-
stage:
95-
input:
96-
dest_addr: 127.0.0.1
97-
headers:
98-
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
99-
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
100-
Accept-Encoding: gzip,deflate
101-
Accept-Language: en-us,en;q=0.5
102-
Host: localhost
103-
Keep-Alive: '300'
104-
Proxy-Connection: keep-alive
105-
Translate: f
106-
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv
107-
method: GET
108-
port: 80
109-
uri: /
110-
version: HTTP/1.1
111-
output:
112-
log_contains: id "920450"
113-
114-
-
115-
test_title: 920450-7
76+
test_title: 920450-5
11677
desc: HTTP header is restricted by policy (920450) from old modsec regressions
11778
stages:
11879
-
@@ -136,7 +97,7 @@
13697
output:
13798
log_contains: id "920450"
13899
-
139-
test_title: 920450-8
100+
test_title: 920450-6
140101
stages:
141102
-
142103
stage:

0 commit comments

Comments
 (0)