Disable Trace and Track for Better Security
The shared server on which I host Perishable Press was recently scanned by security software that revealed a significant security risk. Namely, the HTTP request methods TRACE
and TRACK
were found to be enabled on my webserver. The TRACE
and TRACK
protocols are HTTP methods used in the debugging of webserver connections.
Although these methods are useful for legitimate purposes, they may compromise the security of your server by enabling cross-site scripting attacks (XST). By exploiting certain browser vulnerabilities, an attacker may manipulate the TRACE
and TRACK
methods to intercept your visitors’ sensitive data. The solution, of course, is disable these methods on your webserver.
How to disable the TRACE and TRACK methods
To disable TRACE
and TRACK
HTTP methods on your Apache-powered webserver, add the following directives to either your main configuration file or root HTAccess file:
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
These directives disable the TRACE
and TRACK
methods via the following process:
RewriteEngine on
— enables Apache’s rewrite module (this directive is not required if already present in your htaccess file)RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
— targets all TRACE and TRACK request methods for the following ruleRewriteRule .* - [F]
— return a403 Forbidden
error response for all matched conditions (i.e., all TRACE and TRACK methods)
With these rules in place, your site is protected against one more potential security vulnerability :)
27 responses to “Disable Trace and Track for Better Security”
Thanks for the information, Abraham – it definitely helps :)
Did you guys know if you have root access to your servers you can disable trace with a command.
TraceEnable Off
Thought i would just share it with you incase you are not aware.
I OFF the TraceEnable but still i can see HTTP Request trace from firebug.