maelrx/skills-aletheia/02-backend-api-security
Claude Code and agent skill by maelrx/skills-aletheia
- community
Checking that the SKILL.md file is still in the repository.
Use when auditing or hardening APIs, Next.js API routes, Server Actions, webhooks, and server-side business logic. Checks authentication, authorization, IDOR, input validation, mass assignment, rate limits, timeouts, and safe error handling.
Install
npx vskill@latest install maelrx/skills-aletheia/02-backend-api-securitySKILL.md
The same SKILL.md was published earlier as maelrx/skills-aletheia/02-backend-api-security.
Backend and API Security
Mission
Make the backend the trust boundary. Every request can be forged. Every header can lie. Every body can contain hostile fields. The backend must verify identity, permission, input shape, rate limits, and ownership before touching data or money.
Use when
- The project has
app/api/*,pages/api/*, Server Actions, tRPC routes, Express/Fastify handlers, webhooks, or external API calls. - The user asks about API security, auth, authorization, IDOR, paid API abuse, Stripe webhooks, OpenAI endpoints, or backend hardening.
Workflow
1. Inventory server entry points
Build a route table:
| Route/action | Method | Auth required | Data touched | External services | Risk |
|---|
2. Verify authentication and authorization
Search:
Required:
- Every sensitive route verifies a valid session/token before work.
- Every operation verifies permission/role on the server.
- Multi-tenant operations filter by
tenantId/organizationIdon every query. - Admin operations never rely only on frontend role checks.
3. Audit IDOR and ownership checks
Search for externally supplied IDs:
Vulnerable pattern:
Safer pattern:
For Supabase:
Return 404 for resources the user cannot access to avoid confirming existence.
4. Validate input and reject mass assignment
Search:
Required:
- Validate body, params, query strings, and uploaded metadata with schemas.
- Enforce max lengths and allowed enum values.
- Reject unknown fields.
- Whitelist fields written to DB.
- Never pass raw request body directly to
create,update,insert, orupsert.
5. Add rate limits where abuse costs money or data
Required on:
- login/signup/reset-password,
- public forms,
- AI endpoints,
- search/filter endpoints,
- email/SMS/notification endpoints,
- endpoints that trigger expensive jobs.
Search:
6. Add explicit timeouts around external calls
Search:
Every external call needs a timeout shorter than the platform timeout. Use AbortController for fetch.
7. Verify webhook signatures
Search:
Required:
- Validate signature/secret before processing.
- Read raw/text body when provider requires it.
- Return 2xx quickly and process heavy work asynchronously.
- Make webhook handlers idempotent.
8. Sanitize errors
Search:
Production responses must be generic. Log structured details server-side only.
Output contract
Stop criteria
Stop and report immediately for auth bypass, cross-tenant access, webhook trust without signature on payment/subscription flows, or unbounded paid API endpoints.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/02-backend-api-security/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/maelrx/skills-aletheia/02-backend-api-security)