September 2, 2026
Information Disclosure Through Verbose Error Messages
I Sent an Empty POST Request. The Server Showed Me Its Source Code.

By Ananya Rathod
3 min read
While testing an application's OAuth functionality, I came across something interesting at its token endpoint.
Normally, when an OAuth token endpoint receives an invalid or incomplete request, you would expect a standard error response explaining that the required parameters are missing.
Instead, this application returned a full Symfony exception page.
The response exposed internal application details, including file paths, framework information, stack traces, middleware details, and even parts of the application's source code.
Testing the OAuth Token Endpoint
The application exposed an OAuth token endpoint.
To see how the endpoint handled invalid requests, I sent a simple POST request with no request body.
The request looked like this:
POST /oauth/token HTTP/1.1
Host: [REDACTED]
Content-Length: 0
There was nothing complicated about the request.
No authentication was required, and no specially crafted payload was needed.
I was simply checking how the application handled an incomplete request.
The Response
Instead of returning a generic OAuth error, the server responded with a detailed exception page.
The response included a Symfony exception showing an internal application error.
More importantly, the error page exposed information that should generally not be available to external users in a production environment.
The response revealed details such as:
- Internal application file paths
- Symfony/Laravel framework information
- Backend stack traces
- Middleware and routing details
- Source code references
- Parts of the application's internal request flow
The screenshot also showed the specific location where the exception was triggered within the application.
Why Does This Matter?
A detailed error page may not immediately lead to account compromise or remote code execution.
However, it gives an attacker useful information about the application.
For example, the exposed stack trace can help identify:
- The frameworks being used
- How requests move through the application
- Internal directory structures
- Middleware involved in processing requests
- Specific application components and files
This information can be useful during reconnaissance.
Attackers often don't start with a complete picture of an application's backend. Small pieces of information collected from different places can help build that picture over time.
An exposed stack trace might be one of those pieces.
The Bigger Problem: Verbose Errors in Production
Detailed error pages are useful during development.
Developers need stack traces, file names, line numbers, and debugging information to understand what went wrong.
The problem starts when the same information is exposed in a production environment.
A production application should return a controlled error response to the user while logging the technical details internally.
Instead of showing something like:
A full exception page with source code and stack traces
The application should return a generic response such as:
500 Internal Server Error
or an appropriate OAuth error response.
The detailed exception should remain available only through server-side logs and monitoring tools.
What Could Have Caused This?
Based on the response, the application appears to have verbose error handling exposed to external users.
This behavior is consistent with debug functionality or detailed exception handling being available in a production-facing environment.
It's important to note that seeing a detailed Symfony exception page alone doesn't necessarily prove a specific configuration value. However, the result clearly shows that internal debugging information is being returned to unauthenticated users.
Impact
The exposed information could assist an attacker during reconnaissance by revealing:
- Internal application structure
- Backend technologies
- Framework and middleware information
- Source code locations
- Internal file paths
- Request processing flow
On its own, this may be classified as an information disclosure issue.
However, the information could become more valuable when combined with other vulnerabilities or weaknesses within the application.
Remediation
The application should ensure that detailed exception information is never exposed to external users in production.
Some recommended steps include:
- Disable debug mode in production environments.
- Configure generic error pages for production.
- Prevent stack traces from being returned in HTTP responses.
- Store detailed exception information only in server-side logs.
- Review framework error-handling configurations.
- Verify that development settings are not deployed to production systems.
For Laravel/Symfony-based applications, production environment settings should be reviewed carefully to ensure debugging information is not publicly accessible.
Final Thoughts
This finding was a good reminder that sometimes the simplest requests are worth testing.
There was no complex payload involved here.
I sent an incomplete POST request to an OAuth endpoint and looked at how the server responded.
That response ended up revealing much more about the application's backend than it should have.
Error handling is often overlooked during security testing, but it's still part of the application's attack surface.
A user needs to know that something went wrong.
They don't need to see the application's internal files, stack traces, middleware, and source code to understand it.
Keep detailed errors in the logs. Keep them out of production responses.