Nexus Void Research
API Security, OWASP API Security Top 10, BOLA, Authorization, Rate Limiting, API Inventory, How-to
How to Secure API Endpoints: OWASP API Top 10 Checklist
How to secure API endpoints: inventory, auth by default, function, object and property-level authorization, schema validation, rate limits and monitoring.
To secure API endpoints, keep an inventory of every endpoint, require authentication by default, check authorization at three levels (the function, the object and each property), validate every request against a schema, return only the fields the caller may see, rate-limit and paginate, use TLS everywhere, and log and monitor access. Retire old API versions instead of leaving them running.
APIs are now the main way applications expose data, and attackers know it. The OWASP API Security Top 10 lists the risks that show up again and again: broken object-level authorization, broken authentication, excessive data exposure, missing rate limits, broken function-level authorization and forgotten endpoints. Vulnerability exploitation was the leading way breaches started in Verizon's 2026 Data Breach Investigations Report, at 31%, as our 2026 vulnerability statistics summarise. This guide turns the OWASP list into steps that apply to any framework.
The OWASP API Security Top 10 at a glance
Risk (2023 edition) | What it means | Step below |
|---|---|---|
API1 Broken Object Level Authorization | Changing an ID returns another user's data | 3 |
API2 Broken Authentication | Weak tokens, missing checks, credential stuffing | 2 |
API3 Broken Object Property Level Authorization | Reading or writing fields you should not | 4, 5 |
API4 Unrestricted Resource Consumption | No rate limits, unbounded page sizes | 6 |
API5 Broken Function Level Authorization | Normal users calling admin endpoints | 3 |
API6 Unrestricted Access to Sensitive Business Flows | Bots abusing signup, checkout, booking | 6 |
API7 Server Side Request Forgery | API fetches attacker-chosen URLs | 4 |
API8 Security Misconfiguration | Debug mode, open CORS, verbose errors | 7 |
API9 Improper Inventory Management | Old versions and shadow endpoints left running | 1 |
API10 Unsafe Consumption of APIs | Trusting third-party API responses blindly | 4 |
Step 1: Inventory every endpoint
You cannot secure an endpoint you do not know exists. Keep a list of every route, with its owner, whether it is public, what data it returns and which version it belongs to. Generate it from code or your OpenAPI spec rather than maintaining it by hand, and compare it with what your gateway and logs actually see. Old versions (/v1/), debug routes and endpoints left over from a migration are where attackers look first.
Step 2: Authenticate by default
Require authentication globally and mark the few public endpoints explicitly.
Use a standard protocol: OAuth 2.0 or OpenID Connect for user-facing APIs, signed tokens or mTLS for service-to-service.
Verify tokens fully on every request: signature, a fixed algorithm, issuer, audience and expiry.
Keep access tokens short-lived and refresh tokens revocable.
Protect login, token and password reset endpoints with rate limits and lockouts against credential stuffing.
Never put tokens or API keys in URLs, where they end up in logs.
The OWASP REST Security Cheat Sheet covers these authentication controls in more detail.
Step 3: Authorize every function and every object
Two separate checks on every request:
Function level: may this user call this operation at all? Admin and internal endpoints must check roles on the server, not rely on clients not knowing the URL.
Object level: may this user access this specific record? Scope every lookup by owner or tenant. This is the number one API risk; see how to prevent IDOR and how to fix broken access control.
Centralise both in middleware or a policy layer, and deny by default.
Step 4: Validate every request
Validate against a schema for every body, query string, path parameter and header: types, lengths, formats and allowed values. Reject unknown fields.
Allow-list writable fields per endpoint, so clients cannot set
role,owner_idorprice(mass assignment).Use parameterised queries for every database call; see how to prevent SQL injection.
Validate URLs the API fetches on a user's behalf; see how to prevent SSRF.
Treat third-party API responses as untrusted too, validating them before use; see how to secure third-party API integrations.
Step 5: Return only what the caller may see
Many APIs return a full database object and leave the frontend to hide fields. Attackers read the raw response. Define an explicit response schema per endpoint, exclude internal fields such as password hashes, tokens, internal IDs and other users' data, and apply property-level rules for fields only some roles may see.
Step 6: Limit consumption and protect business flows
Rate-limit per user, per API key and per IP, with tighter limits on authentication and expensive operations.
Cap page sizes, request body sizes, upload sizes, query complexity (for GraphQL, depth and cost limits) and execution time.
Protect sensitive flows such as signup, checkout, booking and coupon redemption against automation with velocity checks, bot detection or step-up verification.
Set spending limits on paid downstream services, such as AI APIs, that a client can trigger.
Step 7: Configure transport and errors safely
TLS everywhere, with HSTS on browser-facing domains.
CORS restricted to exact origins; never wildcard with credentials.
Generic error messages; no stack traces, SQL or internal hostnames in responses.
Debug modes, admin consoles and interactive docs off or restricted in production for private APIs.
Security headers such as
X-Content-Type-Options: nosniffandCache-Control: no-storeon sensitive responses.
Step 8: Log, monitor and test
Log authentication events, authorization failures, rate-limit hits and changes to sensitive data, without logging secrets or personal data.
Alert on spikes in 401, 403 and 404 responses, which often mean someone is probing IDs or endpoints.
Test every release: automated tests that call endpoints as anonymous, normal, other-tenant and admin users; dynamic scanning in staging; and periodic penetration tests.
Retire old versions on a schedule, and remove routes nobody owns.
API security checklist
Check | Done when |
|---|---|
Inventory | Every endpoint listed with owner, version and data |
Auth by default | Global authentication; explicit public list |
Tokens verified | Signature, algorithm, issuer, audience, expiry |
Function-level authz | Admin and internal operations check roles server-side |
Object-level authz | Every lookup scoped by owner or tenant |
Schema validation | Unknown fields rejected; writable fields allow-listed |
Response schemas | No internal or other-user fields returned |
Limits | Rate limits, size and page caps, business-flow protection |
Transport and errors | TLS, strict CORS, generic errors, no debug |
Monitoring and tests | Access failures alerted; multi-role tests in CI |
How does ARGUS help secure API endpoints?
API inventory from code. ARGUS extracts the HTTP routes your code defines and lists each with method, endpoint, authentication state, category, whether it handles personal data, and risk. Routes with no authentication found are reported as findings; routes whose auth cannot be determined are treated as open when scoring risk.
AI business logic analysis looks for IDOR, privilege escalation, authentication bypass, broken sequences and unsafe API chains in Python, JavaScript, TypeScript and Ruby, and taint analysis follows request data into SQL, shell calls and outbound requests.
Remediation from the endpoint. Each endpoint links to its findings, where you can Assign to Agent for a verified fix pull request, assign it to a teammate or create a ticket.
Opt-in API DAST probes a running API you point it at, deny-by-default: it needs an explicit base URL and host allow-list, and uses only read-only HTTP methods unless you allow others.
Limits: the inventory covers routes defined in your code, not traffic from other systems; AI passes run when AI scanning is enabled. See how ARGUS works, or scan a repository free.
Frequently asked questions
How do you secure API endpoints?
Inventory every endpoint, require authentication by default, check authorization for each function, object and property, validate requests against schemas, return only permitted fields, rate-limit and cap resource use, use TLS and strict CORS, return generic errors, log access failures, and test with multiple user roles every release.
What is the most common API security vulnerability?
Broken object level authorization (BOLA), also called IDOR, ranks first in the OWASP API Security Top 10. It happens when an endpoint returns or changes a record by ID without checking that the caller may access it, so changing the ID exposes other users' data.
What is the OWASP API Security Top 10?
It is OWASP's list of the most critical API risks. The 2023 edition covers broken object level authorization, broken authentication, broken object property level authorization, unrestricted resource consumption, broken function level authorization, sensitive business flows, SSRF, security misconfiguration, improper inventory management and unsafe consumption of APIs.
Is an API gateway enough to secure an API?
No. A gateway is good at authentication, rate limiting, TLS and logging, but it does not know your business rules, so it cannot check whether user 58 may read order 1043. Object-level and property-level authorization must be enforced in the application code.
Should API keys or OAuth tokens be used for APIs?
Use OAuth 2.0 or OpenID Connect tokens for user-facing APIs, because they identify the user, expire and can be scoped. API keys suit simple server-to-server access but should be scoped, rotated and never used in browsers. Both must be sent in headers, never in URLs.
How do you prevent excessive data exposure in APIs?
Define an explicit response schema for every endpoint and return only those fields, rather than serialising whole database objects and relying on the client to hide data. Apply property-level rules for fields only certain roles may see, and review responses, not just requests, in testing.
How do you rate limit an API?
Apply limits per user, per API key and per IP at the gateway or in middleware, with stricter limits on login, password reset and expensive operations. Also cap page sizes, body sizes and query complexity, and add business-flow protections for actions such as signup and checkout.
How do you find undocumented or shadow APIs?
Generate an inventory from your code or OpenAPI specs, compare it with routes seen in gateway and access logs, and look for old versions, debug routes and services with no owner. Anything running that is not in the inventory should be documented and secured, or removed.
DATA SOURCES
OWASP API Security Top 10: https://owasp.org/API-Security/ ; OWASP REST Security Cheat Sheet ; Verizon DBIR 2026 (via Nexus Void stats)