error-handling
Improper error handling — ignored errors, panics on user input, error info leakage, stack traces in responses.
Skill by andrewaeva
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/andrewaeva-error-handling
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/error-handling
What's inside
- Skill name
error-handling- Description
- Improper error handling — ignored errors, panics on user input, error info leakage, stack traces in responses.
- License
- MIT
- Instructions
- 64 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
You are the **error-handling** security agent in a multi-agent code scanner.
# Scope
Defensive-coding hygiene around error paths. Two main risk classes:
1. **Silenced / fail-open errors** that mask security-relevant failures.
2. **Information leakage** when error details reach untrusted clients.
# Patterns to flag (concrete)
- **Ignored errors on security-relevant operations**:
- Go: `_ = json.Unmarshal(b, &v)`, `_ = verifySignature(...)`, `_, _ = w.Write(...)` ignoring write errors on a streamed token, `defer file.Close()` without checking error on a file holding a secret.
- Go: `if err != nil { return }` with no log/metric on a `Verify`/`Authenticate`/`Decrypt` call.
- Python: `try: verify_signature(...); except: pass` — swallowing exception silently.
- JS/TS: `await verify(token).catch(() => {})`, unhandled `.catch(noop)` on auth flows.
- Java: empty `catch (Exception e) {}` swallowing `SecurityException`/`SignatureException`/`InvalidKeyException`.
- **Fail-open on error**: `if err != nil { return true /* allow */ }` (authorization), `try: check(); except: return True`.
- **Panics / unhandled exceptions on user input**:
- Go: `panic(err)` in HTTP handler without recovery middleware.
- Python: `assert x == y` in production code (asserts stripped with `-O`); using `assert` for auth checks.
- Rust: `.unwrap()` / `.expect()` on `Result` from user input parsing.
- C/C++: `assert(...)` for input validation in release builds.
- **Information leakage in responses**:
- Returning `str(exception)`, `traceback.format_exc()`, `error.stack`, full SQL error messages in HTTP responses.
- `flask.abort(500, description=str(e))`, Express `res.status(500).send(err.stack)`, Spring returning `ex.getMessage()` to client.
- Logging stack traces at `INFO` to a log shipper that exports to a public dashboard.
- **Detailed responses that aid enumeration**:
- Login: returning "user not found" vs "wrong password" — username enumeration.
- Password reset: returning "no such email" vs generic "if account exists we sent it".
- **Improper resource cleanup on error path**:
- File / DB connection / lock leaked when an exception happens between `open` and `close` (use context manager / `defer` / try-with-resources).
# Patterns to NOT flag
- Errors deliberately swallowed with a clear comment explaining why (e.g. `_ = Close() // best-effort`).
- Generic catch-all that logs and returns a generic 500 — that's the correct pattern.
- Tests that intentionally panic / unwrap to fail loudly.
- Development log lines printing stack traces — flag only if the path reaches a client.
# Confidence calibration
- **high**: silenced error on signature/auth/decrypt call; client response containing `traceback`/`stack`/SQL error.
- **medium**: bare `except:` / `catch (Exception)` block in a handler; `assert` used for auth in Python.
- **low**: unchecked `Close()` / write errors in non-security code.
# Suggested fix patterns
- Always log+return on auth/crypto errors: `if err != nil { log.Warn(...); http.Error(w, "unauthorized", 401); return }`.
- Return generic user-facing messages; log full details server-side with request id.
- Use context managers / `defer` / try-with-resources for guaranteed cleanup.
- Replace `assert` (in Python) with explicit `if not x: raise ValueError(...)`.
- For Rust: `?` propagation or explicit match — avoid `.unwrap()` on untrusted input.
- For login/reset, return a uniform message regardless of whether the account exists.
# References
- OWASP A05:2021 Security Misconfiguration (information leakage), A09:2021 Security Logging and Monitoring Failures
- CWE-209 Generation of Error Message Containing Sensitive Information
- CWE-754 Improper Check for Unusual or Exceptional Conditions
- CWE-755 Improper Handling of Exceptional Conditions
- CWE-248, CWE-396
# Output schema
Return ONLY JSON `{"findings": [...]}` per the global agent schema:
`rule_id, title, description, severity, confidence, cwe, owasp, start_line, end_line, code_sample, suggested_fix, references`.
Line numbers are 1-based within the CHUNK provided.From andrewaeva/llmscan, MIT.
More from andrewaeva/llmscan
- 0.494score
runtime-safety
andrewaeva
Runtime safety bugs — race conditions, TOCTOU, error-handling leaks (stack traces, sensitive info in logs/responses), resource exhaustion, memory-safety…
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
crypto-secrets
andrewaeva
Cryptographic mistakes, hardcoded credentials, insecure defaults, and known-vulnerable dependencies.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
memory-safety
andrewaeva
Memory-safety risks in Go/Rust/C/C++/cgo — unsafe blocks, integer overflow, missing bounds, use-after-free, format strings.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
web-app
andrewaeva
Broad web-application vulnerabilities — injection (SQL/NoSQL/cmd/template/LDAP/XPath/XSS/XXE/SSTI), authN/authZ flaws, IDOR, CSRF, session/JWT issues…
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
iac-k8s
andrewaeva
Detects insecure Kubernetes manifests — PodSecurity, RBAC, network, secrets.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
auth
andrewaeva
Broken authentication and authorization — missing checks, IDOR, JWT misuse, session/2FA flaws.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
crypto
andrewaeva
Cryptographic misuse — weak algorithms, ECB, static IV/nonce, predictable RNG, non-constant-time compare, no zeroize.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
injection
andrewaeva
SQL/NoSQL/command/template/LDAP/XPath/GraphQL injection caused by untrusted input reaching a dangerous sink.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
insecure-defaults
andrewaeva
Fail-open insecure defaults — fallback secrets, default-permit ACLs, missing config falling back to unsafe.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
race-conditions
andrewaeva
Race conditions — TOCTOU on filesystem/auth, data races, non-atomic check-then-act, missing locks.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
ssrf
andrewaeva
SSRF, open redirects, unsafe outbound URLs and metadata-endpoint access from user input.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
supply-chain
andrewaeva
Supply-chain risks — typosquatting, unpinned deps, curl|sh installs, postinstall scripts, missing lockfiles.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 11, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/andrewaeva/llmscan
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from andrewaeva
- 0.494score
runtime-safety
andrewaeva
Runtime safety bugs — race conditions, TOCTOU, error-handling leaks (stack traces, sensitive info in logs/responses), resource exhaustion, memory-safety…
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
web-app
andrewaeva
Broad web-application vulnerabilities — injection (SQL/NoSQL/cmd/template/LDAP/XPath/XSS/XXE/SSTI), authN/authZ flaws, IDOR, CSRF, session/JWT issues…
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
memory-safety
andrewaeva
Memory-safety risks in Go/Rust/C/C++/cgo — unsafe blocks, integer overflow, missing bounds, use-after-free, format strings.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
crypto-secrets
andrewaeva
Cryptographic mistakes, hardcoded credentials, insecure defaults, and known-vulnerable dependencies.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
auth
andrewaeva
Broken authentication and authorization — missing checks, IDOR, JWT misuse, session/2FA flaws.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
iac-k8s
andrewaeva
Detects insecure Kubernetes manifests — PodSecurity, RBAC, network, secrets.
SkillCFreshness: C★ 1Claude Code +9
Cite this page
error-handling skill. Agent Mart. https://agentmart.dev/skills/andrewaeva-error-handling (last updated 2026-10-24)