File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 5
5
# Prevent Apache from responding to `TRACE` HTTP request.
6
6
#
7
7
# The TRACE method, while apparently harmless, can be successfully
8
- # leveraged in some scenarios to steal legitimate users' credentials
8
+ # leveraged in some scenarios to steal legitimate users' credentials.
9
9
#
10
10
# Modern browsers now prevent TRACE requests being made via JavaScript,
11
11
# however, other ways of sending TRACE requests with browsers have been
12
12
# discovered, such as using Java.
13
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!
14
+ # (!) If you have access to the main server configuration file, use the
15
+ # `TraceEnable` directive instead.
16
16
#
17
17
# https://tools.ietf.org/html/rfc7231#section-4.3.8
18
18
# https://www.owasp.org/index.php/Cross_Site_Tracing
19
19
# https://www.owasp.org/index.php/Test_HTTP_Methods_(OTG-CONFIG-006)
20
20
# https://httpd.apache.org/docs/current/mod/core.html#traceenable
21
21
22
- TraceEnable Off
22
+ <IfModule mod_rewrite.c>
23
+ RewriteEngine On
24
+ RewriteCond %{REQUEST_METHOD} ^TRACE [NC]
25
+ RewriteRule .* - [R=405,L]
26
+ </IfModule>
You can’t perform that action at this time.
0 commit comments