Development tools and frameworks usually have options to make debugging easier for developers. Although these features are useful during development, they should never be enabled for applications deployed in production. Debug instructions or error messages can leak detailed information about the system, like the application’s path or file names.

Ask Yourself Whether

There is a risk if you answered yes to any of those questions.

Recommended Secure Coding Practices

Do not enable debugging features on production servers or applications distributed to end users.

Sensitive Code Example

if (unexpectedCondition)
{
  Alert.show("Unexpected Condition"); // Sensitive
}

The trace() function outputs debug statements, which can be read by anyone with a debug version of the Flash player:

var val:Number = doCalculation();
trace("Calculation result: " + val);  // Sensitive

See