Désactiver la méthode TRACE sur Apache
SR juillet 28th, 2009
Par défaut sous Apache, la méthode TRACE est activée ce qui peut conduire à des vulnérabilités de type XSS :
# curl -X OPTIONS http://127.0.0.1 -i
HTTP/1.1 200 OK
Date: Tue, 28 Jul 2009 14:04:13 GMT
Server: Apache
Allow: GET,HEAD,POST,OPTIONS,TRACE
Content-Length: 0
Content-Type: text/html
HTTP/1.1 200 OK
Date: Tue, 28 Jul 2009 14:04:13 GMT
Server: Apache
Allow: GET,HEAD,POST,OPTIONS,TRACE
Content-Length: 0
Content-Type: text/html
En ajoutant la directive TraceEnable à Off dans le fichier de conf apache 2.x :
TraceEnable Off
on teste le bon support :
# apachectl -t
Syntax OK
Syntax OK
puis on relance Apache et on teste de nouveau :
# apachectl restart
# curl -X OPTIONS http://127.0.0.1 -i
HTTP/1.1 200 OK
Date: Tue, 28 Jul 2009 14:21:42 GMT
Server: Apache
Allow: GET,HEAD,POST,OPTIONS
Content-Length: 0
Content-Type: text/html
# curl -X OPTIONS http://127.0.0.1 -i
HTTP/1.1 200 OK
Date: Tue, 28 Jul 2009 14:21:42 GMT
Server: Apache
Allow: GET,HEAD,POST,OPTIONS
Content-Length: 0
Content-Type: text/html
Voilà !