REST API OWASP API Security Risks

OWASP is a respected non-profit that studies software security. Its API Security Top 10 list names the weaknesses that cause the most real-world incidents. Reading this list helps designers build defenses before problems appear, and it gives reviewers a ready checklist.

The House Security Picture

A secure house needs more than a strong front door. Windows must lock, spare keys need careful storage, and visitors should enter only the rooms they need. API security works the same way. Many small gaps matter as much as one big gap.

Risk 1: Broken Object Level Authorization

An API receives an object id and returns the object without checking whether the caller owns it. A user changes /invoices/1001 to /invoices/1002 and reads another person's invoice.

User A (id 7) ── GET /invoices/1002 ──→ Server
                                          │ loads invoice 1002 (owner: user 9)
                                          │ owner != caller ?
User A ←── 403 Forbidden ─────────────────┘   (the required check)

Defense: check ownership or permission on every object access. Random UUIDs help, and the ownership check remains essential.

Risk 2: Broken Authentication

Weak login rules, endless tokens, or missing lockouts let attackers take over accounts. Defense: use proven libraries, limit login attempts, expire tokens, and support multi-factor sign-in.

Risk 3: Broken Object Property Level Authorization

This risk joins two older problems. An API may return fields the caller should not see, such as internal notes. An API may also accept fields the caller should not change, such as a role or a price. Defense: define exactly which fields each role may read and write, and filter both directions.

Update profile body:  { "name": "Asha", "role": "admin" }
Server accepts only:  name, phone, city       ← role ignored

Risk 4: Unrestricted Resource Consumption

Requests that return huge pages, upload giant files, or trigger expensive work can exhaust CPU, memory, or budget. Defense: set rate limits, page size caps, body size caps, timeouts, and spending alerts.

Risk 5: Broken Function Level Authorization

A normal user finds an admin endpoint, such as DELETE /admin/users/5, and the server executes it. Defense: deny by default, and check the role on every function, including rarely used ones.

Risk 6: Unrestricted Access to Sensitive Business Flows

Automated scripts misuse legitimate features, such as buying all limited tickets in seconds or creating thousands of fake accounts. Defense: add rate limits per user and device, bot detection, and checks on suspicious patterns.

Risk 7: Server Side Request Forgery

An endpoint accepts a URL from the client and fetches it. An attacker supplies an internal address, and the server reaches systems that the outside world cannot. Defense: allow only approved destinations, block private network ranges, and avoid following redirects blindly.

Risk 8: Security Misconfiguration

Default passwords, open cloud storage, verbose error messages, missing HTTPS, and loose CORS settings all fall here. Defense: use hardened templates, automate configuration checks, and turn off features you do not need.

Risk 9: Improper Inventory Management

Teams forget old versions, test servers, and undocumented endpoints. Those forgotten doors stay unpatched. Defense: keep a living list of every API, version, and environment, and retire what nobody uses.

Risk 10: Unsafe Consumption of APIs

Your API calls other APIs and trusts their responses too much. A compromised partner can send harmful data. Defense: validate third-party data like any other input, and use timeouts and size limits.

Quick Reference

RiskCore Defense
Object level authorizationCheck ownership on every object
AuthenticationStrong login, short tokens, lockouts
Property level authorizationAllowlist readable and writable fields
Resource consumptionLimits on rate, size, and time
Function level authorizationDeny by default, check roles
Sensitive business flowsAbuse detection and per-user limits
Server side request forgeryDestination allowlists
MisconfigurationHardened, automated settings
Inventory managementComplete API catalog
Unsafe API consumptionValidate all third-party data

Using the List in Practice

  • Review each new endpoint against the ten risks before release.
  • Write automated tests that call endpoints with the wrong user and expect 403.
  • Include the list in code review checklists.
  • Run security scans on a schedule and fix findings by priority.

Common Mistakes

Relying on Hidden URLs

Secret-looking paths protect nothing. Every endpoint needs real authorization.

Checking Only the Gateway

Services behind a gateway must enforce their own rules too.

Fixing Symptoms

Patching one endpoint leaves the same flaw in ten others. Build shared authorization code and reuse it.