Skip to content

Commit 0a2f70e

Browse files
committed
Add TraceEnable Off
Fix #59
1 parent 4d28cd7 commit 0a2f70e

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

htaccess.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ disable "src/security/strict-transport-security.conf"
7575
enable "src/security/x-content-type-option.conf"
7676
disable "src/security/x-xss-protection.conf"
7777
disable "src/security/referrer-policy.conf"
78+
disable "src/security/trace_method.conf"
7879
enable "src/security/x-powered-by.conf"
7980
enable "src/security/server_software_information.conf"
8081

src/security/trace_method.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ----------------------------------------------------------------------
2+
# | Disable TRACE HTTP Method |
3+
# ----------------------------------------------------------------------
4+
5+
# Prevent Apache from responding to `TRACE` HTTP request.
6+
#
7+
# The TRACE method, while apparently harmless, can be successfully
8+
# leveraged in some scenarios to steal legitimate users' credentials
9+
#
10+
# Modern browsers now prevent TRACE requests being made via JavaScript,
11+
# however, other ways of sending TRACE requests with browsers have been
12+
# discovered, such as using Java.
13+
#
14+
# (!) The `TraceEnable` directive will only work in the main server
15+
# configuration file, so don't try to enable it in the `.htaccess` file!
16+
#
17+
# https://tools.ietf.org/html/rfc7231#section-4.3.8
18+
# https://www.owasp.org/index.php/Cross_Site_Tracing
19+
# https://www.owasp.org/index.php/Test_HTTP_Methods_(OTG-CONFIG-006)
20+
# https://httpd.apache.org/docs/current/mod/core.html#traceenable
21+
22+
TraceEnable Off

test/htaccess_fixture.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ enable "src/security/strict-transport-security.conf"
7373
enable "src/security/x-content-type-option.conf"
7474
enable "src/security/x-xss-protection.conf"
7575
enable "src/security/referrer-policy.conf"
76+
omit "src/security/trace_method.conf"
7677
enable "src/security/x-powered-by.conf"
7778
enable "src/security/server_software_information.conf"
7879

0 commit comments

Comments
 (0)