本文へスキップ
Skillpedia
セキュリティ75k · #3035

stack-trace-exposure

できること

このスキルは、サーバーのコードとAPIの応答におけるエラー処理を確認し、詳細なエラー情報が非公開でログに残り、利用者には表示されないようにします。攻撃者がアプリから得られる情報を減らしたい開発者向けです。

使う場面

  • ✓APIやサーバーのコードのエラー処理をセキュリティの観点から確認するようエージェントに頼むとき。
  • ✓本番環境のエラーの応答に、スタックトレース、ファイルパス、ライブラリの情報が含まれているとき。
  • ✓すべてのルートを同じように扱う中央のエラーハンドラーが欲しいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/stack-trace-exposure/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“何かが壊れると、私のAPIは完全なエラーのスタックをブラウザーに送ります。安全なメッセージを表示して、詳細は非公開でログに残すように変更してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、生のエラーオブジェクト、スタックトレース、内部のパスがクライアントに送られている箇所を見つけます。中央のエラーハンドラーを追加し、完全な詳細はサーバーでログに残し、汎用のメッセージを返します。ログと利用者の報告を結びつけるため、相関IDも付けます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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

よくある質問

スタックトレースはなぜ危険ですか?

このスキルによると、ファイルパス、関数名、ライブラリのバージョンが分かり、攻撃者が既知の弱点を探す手がかりになるからです。

相関IDとは何ですか?

このスキルは、サポートのチームが利用者のエラーをサーバーのログと照合できるように、参照用のコードとして提案しています。

これはOWASPの指針をカバーしていますか?

このスキルは、理由としてOWASPのロギングと監視のリスクに触れていますが、チェックは応答に何が露出しているかに焦点を当てています。

詳細

作者による元の説明

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

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#3035
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル