mishandling-exceptional-conditions

mishandling-exceptional-conditions is a skill for Claude Code, Codex from scholarly360/owasp-top10-web-skills. It costs 150 tokens per session (2,175 once invoked), scanned A, original, MIT.

A Python security guide for handling unusual situations and errors in FastAPI and Flask applications. It covers unhandled exceptions, leaked stack traces, authorization checks that fail open, incomplete transactions, and unsafe cleanup.

In plain words
What is it for?
Use it to audit exception handling, error responses, authentication and authorization failure paths, transaction rollback, resource cleanup, missing default cases, and related race conditions.
Why use it?
It helps prevent crashes, information leaks, unexpected behavior, and insecure states when something goes wrong. It also draws attention to resources and data that may be left in a bad state after an error.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to audit exception handling, error responses, authentication and authorization failure paths, transaction rollback, resource cleanup, missing default cases, and related race conditions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/scholarly360/owasp-top10-web-skills/mishandling-exceptional-conditions
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add scholarly360/owasp-top10-web-skills --skill mishandling-exceptional-conditions
Clone the repo
git clone --depth 1 https://github.com/scholarly360/owasp-top10-web-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mishandling-exceptional-conditions

README.md
[![agentmods](https://agentmods.dev/badge/skills/scholarly360/owasp-top10-web-skills/mishandling-exceptional-conditions/github.svg)](https://agentmods.dev/skills/scholarly360/owasp-top10-web-skills/mishandling-exceptional-conditions)
Your own site
<a href="https://agentmods.dev/skills/scholarly360/owasp-top10-web-skills/mishandling-exceptional-conditions"><img src="https://agentmods.dev/badge/skills/scholarly360/owasp-top10-web-skills/mishandling-exceptional-conditions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mishandling-exceptional-conditions

Your own site · 80×15
<a href="https://agentmods.dev/skills/scholarly360/owasp-top10-web-skills/mishandling-exceptional-conditions"><img src="https://agentmods.dev/badge/skills/scholarly360/owasp-top10-web-skills/mishandling-exceptional-conditions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,175 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00150 $0.02175
Opus 5 $0.00075 $0.01087
Sonnet 5 $0.00030 $0.00435
Haiku 4.5 $0.00015 $0.00217

Measured 12d ago against content hash 47c30bd10860, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

mishandling-exceptional-conditions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mishandling-exceptional-conditions/SKILL.md · 247 lines

How it starts

The opening of the file, as written. The whole thing — 247 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OWASP A10:2025 — Mishandling of Exceptional Conditions

Brand new category for 2025, replacing SSRF (absorbed into A01). Contains 24 CWEs with 769,581 recorded occurrences. Addresses programs that fail to prevent, detect, and respond to unusual situations — leading to crashes, unexpected behaviour, information disclosure, and exploitable states.


Core Concepts

What It Covers

Weakness Risk
Improper error handling Unhandled exceptions crash the app or expose internals
Failing open (CWE-636) Auth/authz checks that pass when an exception is thrown
Sensitive data in error messages (CWE-209) Stack traces, DB details, file paths leaked to clients
Uncaught exceptions (CWE-248) No global safety net → 500 with debug output
Resource exhaustion in exception paths DB connections, file handles never closed on error
State corruption Partial transactions committed on exception
NULL pointer / None dereference (CWE-476) Missing guard for None before attribute access
Missing default cases (CWE-754) if/elif chains with no else; match with no wildcard
Race conditions in error recovery Cleanup logic itself can be interrupted

Prevention Principles

  1. Catch errors where they occur — at the function that can handle them, not three layers up.
  2. Fail closed — when auth/authz logic throws, deny access; never pass through.
  3. Roll back completely — partial DB transactions must be rolled back, never committed.
  4. Separate user messages from technical details — log the stack trace server-side; return a safe, generic message to the client.
  5. Global exception handler as safety net — every app needs one, but it is not a substitute for local handling.
  6. Rate-limit and quota — prevent exceptional conditions (e.g., resource exhaustion) from being triggered intentionally.

FastAPI Testing Checklist

1. Global Exception Handler

# REQUIRED — catches anything not handled locally
@app.exception_handler(Exception)
async def global_handler(request: Request, exc: Exception):
    logger.error("Unhandled exception", exc_info=exc)
    return JSONResponse(status_code=500, content={"detail": "Internal server error"})

Flag if absent. The default FastAPI 500 response may include traceback in development mode.

Read the full file on GitHub · 247 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 247 lines · 150 tokens per session scan A 47c30bd10860

Subscribe to this mod's changes

mishandling-exceptional-conditions is a skill published in the GitHub repository scholarly360/owasp-top10-web-skills (22 stars, last pushed 5mo ago), licensed MIT. It adds 150 tokens to every session and 2,175 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

Web Application Security Testing

OWASP Top 10 testing, injection vulnerability detection, API security assessment, authentication testing, and web vulnerability reporting for authorized assessments.

Masriyan/Claude-Code-CyberSecurity-Skill · 30 tokens

saferskills

Use SaferSkills to find, evaluate, and safely install AI agent capabilities (skills, MCP servers, hooks, plugins, rules) and to assess a whole agent. Run this before you install, add, recommend, or trust any capability — or when asked whether one is safe or what its score is: scan and score it first with npx…

OpenLatch/saferskills · 91 tokens

content-cadence

Pipeline for turning one R&D artefact (PR, PoC, analysis) into one public post — briefing or deep dive — plus a social derivative where the overlay scopes one in. Triggers when an R&D output is ready to become content, or when drafting any blog post for the site. Enforces the anonymisation gate and repo editorial…

lemur47/logic · 76 tokens

evm

Help users answer one question: "Are we on track?" using Earned Value Management metrics. This skill replaces gut-feel status reporting and traffic-light dashboards with four computed numbers (SV, SPI, CV, CPI) that tell you exactly where a project stands — in schedule and in budget — at any point in time.

lemur47/logic · 0 tokens

tco

Help users answer one question: "What will this actually cost?" using Total Cost of Ownership analysis. This skill replaces sticker-price comparisons with lifetime cost calculations that include maintenance, operations, time value of money, and residual value.

lemur47/logic · 0 tokens

montecarlo

Help users answer one question: "What's the probability we finish by this date?" using Monte Carlo schedule simulation. This skill replaces single-point PERT estimates with full probability distributions over project duration.

lemur47/logic · 0 tokens