Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated
Debug mode enabled means development features are left on in production. Debug mode is a feature that outputs detailed information not normally shown, in order to find faults in a program. MITRE's CWE-489 defines, as Active Debug Code, the weakness of shipping a product with debug code still active.
How does debug mode enabled work?
Picture a shop that opens while the work passages and blueprints of its renovation are still pinned to the wall. They were handy during the work, but they are not for customers to see.
During development, it is easier to fix things when error contents and the middle steps of processing appear in detail. If the setting is not reversed before publishing, information meant only for insiders mixes into screens visible from outside. Verbose error messages are a typical way it shows.
WordPress's official documentation explains that WP_DEBUG, which turns debugging on, is off by default. It is normal to turn it on in a development copy, and turning it on displays all PHP errors and warnings. The same document says it does not recommend using this feature on a live site. How to check and fix it is on the security misconfiguration page.
Why does debug mode enabled matter?
Information that was not meant to be shown becomes visible from outside. Knowing the kind and version of the software in use and where files sit makes the research for an attack easier. Even if the site has no other vulnerability, the information is handed over first.
For preventing security misconfiguration, OWASP Top 10:2021 lists preparing development, test, and production the same way and separating only the credentials. Removing features and parts you do not use is in the same item, and debug functions fit what production does not use.
MITRE's CWE-489 measure is to remove debug code before publishing. WordPress's official documentation shows a setting that disables display on screen and keeps only a record of errors in a file. Putting the debug setting on the checklist for moving to production reduces forgetting to switch it back.
If you cannot confirm what your production setting is, contact us.
Related terms
- Verbose error messages: internal information shown on an error screen.
- Vulnerability: a weakness in a program or setting that can become an entry for attack.
- Security misconfiguration: a hole created by a setting mistake or by running with default settings.
- Information disclosure: a flaw where internal information not meant to be shown becomes visible from outside.
Next step
The whole picture of configuration flaws is on the security misconfiguration page. The free URL check shows only what is visible from outside. For how to proceed when reviewing settings, contact us.
Frequently asked questions
Where can I tell whether debug mode is on in WordPress?
It is decided by an item called WP_DEBUG in the site's configuration file. The default is off. Ask the company that manages the site, or the person who edited it, to confirm the current value.
What if I want to use debug mode to investigate a fault?
Use it on your own machine or a test environment, not on the live site. WordPress's official documentation also advises against using it on a live site. If you must use it in production, turn off display on screen and keep only the record.
Frequently asked questions
Where can I tell whether debug mode is on in WordPress?
It is decided by an item called WP_DEBUG in the site's configuration file. The default is off. Ask the company that manages the site, or the person who edited it, to confirm the current value.
What if I want to use debug mode to investigate a fault?
Use it on your own machine or a test environment, not on the live site. WordPress's official documentation also advises against using it on a live site. If you must use it in production, turn off display on screen and keep only the record.