Api security checklist

From makifbaysal/tasktrooper · View interactive version

Api security checklist is an AI agent skill from the GitHub repository makifbaysal/tasktrooper. Use when you add or change an endpoint, an auth check, a query by id, an outbound call to a user-supplied URL, file handling, or anything touching credentials — the OWASP API Top 10 (2023) as concrete Go and Java checks

How to use this skill

Skill file

API Security Checklist

Overview

The OWASP API Security Top 10 (2023 edition, still current) orders API risk by how often it actually bites in production. This skill maps each category to a concrete Go/Java check instead of a paragraph of theory — see https://owasp.org/API-Security/editions/2023/en/0x11-t10/ for the source list.

Core principle: the most common API vulnerability is a lookup by id with no ownership check. Assume every id in a URL or body is adversarial.

API1: Broken Object-Level Authorization (BOLA)

The #1 API risk. A lookup that trusts the id alone instead of scoping it to the caller.

// ❌ anyone who guesses/enumerates an id can read or modify it
task, err := repo.Get(ctx, taskID)

// ✅ scoped to the caller/tenant exactly like its neighbours
task, err := repo.GetForOwner(ctx, taskID, ownerIDFromAuth(ctx))

Answer "not yours" the same way the endpoint's neighbours do — usually 404 (don't reveal existence to a non-owner) unless the repo already standardizes on 403. Test it: a second, different authenticated user requesting the first user's object must get the not-yours response, not the object.

API2: Broken Authentication

API3: Broken Object Property-Level Authorization (BOPLA — mass assignment / excessive data exposure)

API4: Unrestricted Resource Consumption

API5: Broken Function-Level Authorization

Admin/privileged routes are behind an explicit role check, not just "authenticated" — verify the route's authorization matches its actual privilege level, not just that some auth middleware ran.

API6: Unrestricted Access to Sensitive Business Flows

Rate-limit a sensitive flow (password reset, bulk export, payment) the same way its neighbours already do; don't ship a new sensitive endpoint with no rate limit when similar ones have one.

API7: Server-Side Request Forgery (SSRF)

Any endpoint that fetches a user-supplied URL (webhooks, image-by-URL, link previews):

API8: Security Misconfiguration

API9: Improper Inventory Management

Keep the OpenAPI document in sync (api-contract-openapi) — an undocumented or "quietly removed" endpoint is still reachable until it's actually gone.

API10: Unsafe Consumption of APIs

Validate and size-limit third-party API responses before trusting them; apply the same timeout/retry discipline to outbound calls as to your own endpoints (resilient-io-and-jobs).

Beyond the Top 10

Commands

Common Mistakes

Red Flags

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.