Chuyển đến nội dung
Skillpedia
Bảo mật75k · #3035

stack-trace-exposure

Skill này làm gì

Skill này rà soát cách xử lý lỗi trong code máy chủ và phản hồi API, bảo đảm thông tin lỗi chi tiết được ghi nhật ký riêng tư và không hiển thị cho người dùng. Nó dành cho lập trình viên muốn giảm những gì kẻ tấn công có thể biết về ứng dụng.

Khi nào nên dùng

  • ✓Khi bạn yêu cầu agent rà soát xử lý lỗi trong API hoặc code máy chủ về mặt bảo mật.
  • ✓Khi phản hồi lỗi trên môi trường thật chứa stack trace, đường dẫn file hoặc thông tin thư viện.
  • ✓Khi bạn muốn một bộ xử lý lỗi trung tâm đối xử như nhau với mọi route.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/stack-trace-exposure/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Khi có gì đó hỏng, API của tôi gửi toàn bộ stack lỗi về trình duyệt. Bạn có thể đổi nó để hiện thông báo an toàn và ghi chi tiết riêng tư không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm những chỗ gửi đối tượng lỗi thô, stack trace hoặc đường dẫn nội bộ về phía client. Nó thêm một bộ xử lý lỗi trung tâm ghi đầy đủ chi tiết trên máy chủ và trả về thông báo chung, kèm mã đối chiếu để khớp nhật ký với báo cáo của người dùng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

Câu hỏi thường gặp

Tại sao stack trace lại rủi ro?

Skill cho biết chúng có thể tiết lộ đường dẫn file, tên hàm và phiên bản thư viện mà kẻ tấn công dùng để tìm lỗ hổng đã biết.

Mã đối chiếu (correlation ID) là gì?

Skill gợi ý nó như một mã tham chiếu, để đội hỗ trợ khớp lỗi của người xem với nhật ký máy chủ.

Điều này có bao gồm hướng dẫn của OWASP không?

Skill nhắc tới rủi ro ghi nhật ký và giám sát của OWASP như một lý do, nhưng các kiểm tra tập trung vào những gì bị lộ trong phản hồi.

Chi tiết

Mô tả gốc của tác giả

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

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#3035
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự