Skip to content
Skillpedia
Security75k · #3035

stack-trace-exposure

What it does

This skill reviews error handling in server code and API responses to make sure detailed error information is logged privately and not shown to users. It is for developers who want to reduce what attackers can learn from their app.

When to use it

  • ✓When you ask the agent to review error handling in your API or server code for security.
  • ✓When production error responses include stack traces, file paths, or library details.
  • ✓When you want a central error handler that treats all routes the same way.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/stack-trace-exposure/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/stack-trace-exposure/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“When something breaks, my API sends the full error stack to the browser. Can you change it to show a safe message and log the details privately?”

5 new skills a week. 1 minute to read.

How it works

The agent finds places where raw error objects, stack traces, or internal paths are sent to the client. It adds a central error handler that logs full details on the server and returns a generic message, with a correlation ID to match logs to user reports.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Prevent stack trace exposure in production error responses

Stack traces reveal file paths, function names, library versions, and sometimes database schema or configuration details. An attacker uses this information to identify the exact version of a framework or ORM, look up known CVEs for that version, and craft a targeted exploit. OWASP lists "Security Logging and Monitoring Failures" (A09) as a top-10 risk partly because organisations often expose this information without realising it.

Quick Reference

  • Never return raw error objects or stack traces in API responses
  • Log full error details server-side; send only a generic message to the client
  • Use a central error handler to ensure consistent sanitisation across all routes
  • Assign correlation IDs so support teams can match client-visible errors to server logs

Check

Check whether production API error responses include stack traces, file paths, or internal implementation details.

Fix

Implement a central error handler that logs full details server-side and returns only a sanitised, generic error message to the client.

Explain

Explain what information stack traces reveal and how attackers use that information to identify and exploit vulnerabilities.

Code Review

Review error handlers, catch blocks, and API response code. Flag any location where error.stack, error.message (raw), or internal paths are serialised directly into a response body.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/stack-trace-exposure

FAQ

Why are stack traces risky?

The skill says they can reveal file paths, function names, and library versions that attackers use to find known weaknesses.

What is a correlation ID?

The skill suggests it as a reference code, so support teams can match a visitor's error to the server logs.

Does this cover the OWASP guidance?

The skill mentions OWASP's logging and monitoring risk as a reason, but its checks focus on what is exposed in responses.

Details

Original description by the author

Use when reviewing error handling middleware, API route handlers, or server responses for security-sensitive information disclosure.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#3035
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills