As hinted by Mark, the DEBUG
verb is used to start/stop remote debugging sessions. More specifically, a DEBUG
request can contain a Command
header with value start-debug
and stop-debug
, but the actual debugging is done via an RPC protocol.
So, why does a security scanner perform such request? It appears that poking an ASP.NET website with the DEBUG
requests can be used to reveal if the web.config
has <compilation debug="true">
. The test can be performed with telnet, WFetch or similar, by sending a request like this:
DEBUG /foo.aspx HTTP/1.0
Accept: */*
Host: www.example.com
Command: stop-debug
Depending on whether debugging is enabled or not, you will get either 200 OK
or 403 Forbidden
.
It is generally accepted that you should never have <compilation debug="true"/>
in a production environment, as it has serious implications on the performance of the website. I am not sure if having debugging enabled opens any new attack vectors, unless RPC traffic is enabled as well, in which case you have more serious problems anyway (cf. Mark's answer). Any additional insights on the security perspective will be greatly appreciated.
There is an easy way to avoid accidentally getting <compilation debug="true"/>
in production websites. Simply, add <deployment retail="true"/>
to your machine.config
.
Apparently, having <deployment retail="true"/>
in the machine.config
is not equal to setting <compilation debug="false"/>
in this particular case. The result from throwing DEBUG
requests against the web application can only be changed with the latter. Mind-boggling!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…