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
- The code or configuration enabling the application debug features is deployed on production servers or distributed to end users.
- The application runs by default with debug features activated.
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.
The DEBUG
and DUMP
statements can expose sensitive information to attackers and should not be included in production
code.
Sensitive Code Example
H*-------------------------------------------------------------------------
H DATEDIT(*YMD) DEBUG(*YES)
H**************************************************************************
C SR990 BegSR
C 'CVTERR' DUMP DUMP for error
C Move *on *INLR
Compliant Solution
H*-------------------------------------------------------------------------
H DATEDIT(*YMD)
H**************************************************************************
C SR990 BegSR
C Move *on *INLR
See