API Security
API security is protecting the application programming interfaces (APIs) that let apps, websites and services talk to each other, so attackers can't use them to steal data, abuse business logic or overwhelm systems.
Also called: Application Programming Interface security, API protection, REST API security
What is API security?
An API (application programming interface) is how software talks to software: your mobile app to your servers, your website to a payment provider, your CRM to your accounting system. APIs often expose data more directly than a website does, and they're designed to be used by programs, which makes them easy for attackers to automate against.
The top API risks
OWASP's API Security Top 10 (2023) lists the most critical risks. The first few:
- Broken object level authorization (BOLA): requesting another user's record by changing an ID, see IDOR.
- Broken authentication: weak or missing checks on who is calling the API.
- Broken object property level authorization: returning or allowing changes to fields the user shouldn't see or edit.
- Unrestricted resource consumption: no rate limiting, so attackers can overload the API or run up costs.
- Broken function level authorization: regular users can call admin functions.
The list also covers unrestricted access to sensitive business flows, server-side request forgery, misconfiguration, poor API inventory (forgotten "shadow" APIs), and unsafe use of third-party APIs.
API security best practices
- Authenticate every request with strong API authentication, and check authorization for every object and function.
- Return only the data each caller needs.
- Apply rate limits and quotas.
- Keep an inventory of every API and version, and retire old ones.
- Store API keys and secrets securely and rotate them.
- Include APIs in penetration testing and monitor API logs for abuse.
Related terms
Sources
- OWASP API Security Top 10 (2023) (OWASP Foundation)
- REST Security Cheat Sheet (OWASP)
Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.
