There are plenty of performance reasons why apps shouldn’t be run in debug=”true” mode (good rundown from Scott Gu), but are there any attack vectors exposed by this practice? It’s not a question of “should you or shouldn’t you”, that much is clear, it’s a question of whether it introduces any specific vulnerabilities.
I’m inclined to think that the ability to remotely detect it combined with the known performance issues could lead to an exploit against service availability but I’d like something a bit more definite. Does anyone know of a specific attack that can be orchestrated against an app running debug=”true”?
I’ve had some interesting feedback on this question, particularly over on the Security Stack Exchange. There have been lots of responses related to stack traces (a custom errors issue, not a debug issue) and performance (not [directly] a security issue).
The most compelling response is that conditional compilation constants (#if DEBUG…) could cause unexpected behavior, but this again is more of a functionality risk (unintended code being executed in a live environment), than a security risk.
I suspect debug mode may open some pathways to other exploits based on the performance overhead it places on the app and the ability to remotely detect it (service continuity risk, perhaps). I’ve written up my conclusions as part of OWASP Top 10 for .NET developers part 6: Security Misconfiguration.
So for the sake of completeness, the answer appears to be that there is no clear security risk from running in debug mode, but it certainly isn’t a good idea for production apps given the factors mentioned above.