pentesting, updated
Testing for stack traces
Check whether an unhandled exception returns a full stack trace to the client.
Goal
Confirm the app never returns a raw stack trace, even on an unexpected server error.
How to test
Push inputs likely to trigger unhandled exceptions (type confusion, null values, malformed JSON/XML, oversized payloads) and inspect the response body, not just the status code:
curl -s https://example.com/api/endpoint -H "Content-Type: application/json" -d 'null'
curl -s https://example.com/api/endpoint -H "Content-Type: application/json" -d '{"id": "not-a-number"}'
What to look for
A stack trace in the response — file paths, line numbers, framework/library versions, sometimes even source snippets.
Notes
A stack trace is also a fast way to fingerprint the exact framework/library version for further vulnerability research.
References
- OWASP WSTG-ERRH-02 — Testing for Stack Traces.