Loading...
Loading...
OWASP API Security Top 10 - prevention, detection, and remediation for REST/GraphQL/API security. Use when designing or reviewing APIs - object- and function-level authorization, authentication, rate limiting and resource consumption, sensitive business flows, SSRF, API inventory and versioning, or consumption of third-party APIs.
npx skill4agent add yariv1025/skills owasp-api-security-top-10| Risk | Read |
|---|---|
| API1 Broken Object Level Authorization | references/api1-broken-object-level-authorization.md |
| API2 Broken Authentication | references/api2-broken-authentication.md |
| API3 Broken Object Property Level Authorization | references/api3-broken-object-property-authorization.md |
| API4 Unrestricted Resource Consumption | references/api4-unrestricted-resource-consumption.md |
| API5 Broken Function Level Authorization | references/api5-broken-function-level-authorization.md |
| API6 Unrestricted Access to Sensitive Business Flows | references/api6-sensitive-business-flows.md |
| API7 Server Side Request Forgery (SSRF) | references/api7-ssrf.md |
| API8 Security Misconfiguration | references/api8-security-misconfiguration.md |
| API9 Improper Inventory Management | references/api9-improper-inventory-management.md |
| API10 Unsafe Consumption of APIs | references/api10-unsafe-consumption-of-apis.md |
| Task | Approach |
|---|---|
| Object-level auth (IDOR) | Verify user owns/can access the resource by ID server-side. See API1. |
| Function-level auth | Check user role before admin/sensitive operations. See API5. |
| Rate limiting | Apply per-user/IP limits, quotas, and timeouts. See API4. |
| SSRF prevention | Validate/allowlist URLs; block internal ranges. See API7. |
| Third-party APIs | Validate responses, use TLS, set timeouts. See API10. |
@app.get("/api/orders/{order_id}")
def get_order(order_id: int, current_user: User):
order = Order.query.get(order_id)
if order.user_id != current_user.id:
raise HTTPException(403, "Access denied")
return order@app.get("/api/orders/{order_id}")
def get_order(order_id: int):
return Order.query.get(order_id) # Any user can access any order!from slowapi import Limiter
limiter = Limiter(key_func=get_remote_address)
@app.get("/api/search")
@limiter.limit("10/minute")
def search(query: str):
return perform_search(query)