exceptional-conditions
Skill20 starsChanged 4 months agoMITView on GitHub
Detects error handlers that leak stack traces or fail open on exception. Use
In this repository52 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- authentication-failuresSkill
- broken-access-controlSkill
- concurrency-correctnessSkill
- contract-reviewSkill
- cryptographic-failuresSkill
- crypto-library-misuseSkill
- csrfSkill
- excessive-agencySkill
- file-uploadSkill
- graphql-securitySkill
- hardcoded-secretsSkill
- header-injectionSkill
- hotspotsSkill
- injectionSkill
- insecure-designSkill
- insecure-local-storageSkill
- insecure-output-handlingSkill
- insecure-plugin-designSkill
- integrity-failuresSkill
- ipc-securitySkill
- llm-supply-chainSkill
- logging-failuresSkill
- mass-assignmentSkill
- mcp-securitySkill
- memory-api-misuseSkill
- model-dosSkill
- model-theftSkill
- multi-agent-trustSkill
- nosql-injectionSkill
- numeric-trust-boundarySkill
- oauth-implementationSkill
- open-redirectSkill
- overrelianceSkill
- path-traversalSkill
- privilege-handlingSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- pr-reviewSkill
- race-conditionSkill
- rag-securitySkill
- redosSkill
- security-cleanupSkill
- security-misconfigurationSkill
- security-reviewSkill
- sensitive-disclosureSkill
- ssrfSkill
- supply-chainSkill
- threat-modelSkill
- token-smugglingSkill
- training-data-poisoningSkill
- unsafe-api-consumptionSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Default framework error page left in place, leaking file paths, library versions, or framework banner
- Distinctive: line 28
Client responses carry no internal detail: No stack trace, no file path, no library version, no raw exception message.
- Distinctive: line 32
No catch block exits silently: Every catch / except / recover takes a definite action: re-raise, log, or return a controlled error.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Exceptional Conditions Security Check (A05:2025)
What this checks
Protects against information disclosure and fail-open logic. Stack traces in API responses leak internal paths, library versions, and logic for attackers to target; swallowed exceptions and default-allow error paths grant unintended access.
Vulnerable patterns
- Error handler that returns the raw exception message, stack trace, or internal path in the HTTP response body
- Catch block that silently swallows exceptions with no logging, re-raise, or controlled error
- Authorization or permission exception caught and turned into a success or fall-through that grants access
- Debug or verbose-error flag enabled at deployment, exposing tracebacks to clients
- Default framework error page left in place, leaking file paths, library versions, or framework banner
Fix immediately
Flag the vulnerable code and explain the risk. Then suggest a fix that establishes these properties:
- Client responses carry no internal detail. No stack trace, no file path, no library version, no raw exception message. The client gets a generic message and an opaque reference ID; the full traceback goes to a server-side log keyed by that same ID.
- No catch block exits silently. Every catch / except / recover takes a definite action: re-raise, log, or return a controlled error. A bare catch-and-pass is the exact bug this skill prevents.
- Authorization failures fail closed. A permission or access-denied exception inside a catch block must produce a deny response — never a fall-through or default-allow. The safest pathway on ambiguity is refusal.
- Debug / verbose-error flags are off at deployment. The framework's production-mode switch is set explicitly, not left at its development default.
- Every unhandled exception produces a server-side log entry containing a correlation ID that matches the opaque reference returned to the client, so operators can reconstruct the failure without leaking internals to the user.
Translate these principles to the audited file's language and framework. Use the documented error-handler hook, production-mode switch, and logging facility for that stack — do not invent ad-hoc traceback formatters or response shapes.
Verification
Confirm the following properties hold (language-agnostic):
- No stack trace, file path, library version, exception message, or other internal detail reaches the client response body — only a generic message and opaque reference ID
- Every catch/except/recover block takes a definite action (re-raise, log, or return a controlled error) — no silently swallowed exceptions
- Authorization and permission failures produce a deny response (HTTP 401/403, or equivalent error return) — never a success or fall-through that grants access
- If the code configures a server or application entry point, debug/verbose-error flags are explicitly set to off using the framework's documented production-mode switch. Skip this criterion for library-level code or handlers that have no configuration surface
- Every unhandled exception produces a server-side log entry containing a correlation ID (UUID or equivalent) that matches the opaque reference returned to the client
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

