When WordPress Errors Leak Too Much: Lessons From a Real-World C
A WordPress site with Contact Form 7 returned a 500 error that included a full stack trace when a malformed form submission triggered a missing mail() function. An attacker could use the disclosed file paths, plugin details and PHP internals for reconnaissance.
Published on medium.com
Error handling in production systems is often overlooked — until something goes wrong. Recently, while testing a WordPress site running the Contact Form 7 plugin, I came across a scenario where a 500 Internal Server Error exposed much more than it should have.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely debugging was left enabled in production and PHP errors were displayed instead of logged, so a fatal error from a missing mail() function leaked a stack trace in the JSON response.
Impact
The error response could reveal absolute server file paths, hosting structure, plugin and dependency details, and PHP internals, giving attackers reconnaissance data that could be chained with other exploits.
What the attacker needed
WordPress with Contact Form 7; Debugging enabled in production; Malformed form input
The fix
The text does not state that it was fixed; it should be fixed by disabling WP_DEBUG and display_errors in production, logging errors privately, and ensuring the mail transport is correctly configured.
How it was found
- Send a malformed form submission to the Contact Form 7 REST API endpoint.
- Observe the 500 Internal Server Error response containing a detailed error message.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When a website hits an unexpected problem, it can show an error page. If that page includes technical details like file paths and code, it helps someone who wants to break in learn about the system. Here, a bad form submission caused such a detailed error.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.