In the first week of November, we got a call from a client: the monthly infrastructure bill for their mobile app had nearly tripled compared with the previous month. The app hadn't climbed the store rankings, there was no campaign, and user growth was modest. We dug into the logs and saw the picture: the overwhelming share of the traffic wasn't coming from real users but from bots hammering the API directly. Trial-and-error on the login endpoint, data scraping on the product list, SMS triggering on the OTP endpoint... The API behind the app was an open buffet sitting out in the middle of the room.
This case reminded us once again: the API behind your mobile app is a bigger attack surface than your website. Because the attacker doesn't care about the browser, the interface or your buttons; they talk directly to your endpoints. Routing the app's traffic through a proxy and extracting every endpoint is a five-minute job, and after those five minutes your API is exposed.
The topic is also personal for us: in our vehicle tracking systems, thousands of devices push data to our APIs day and night. Mobile app, web panel, device telemetry, customer integrations: they all pass through the same door, and the security of that door is non-negotiable. That's also why it makes sense that OWASP publishes a Top 10 specifically for APIs, separate from its web list: API security is no longer a footnote to web security, but a discipline in its own right.
Knowing who someone is isn't knowing what they're entitled to
Let me start with the most expensive conceptual confusion in API security: treating authentication and authorization as the same thing. Authentication is the question "who are you?"; authorization is the question "are you allowed to do this?" They are separate questions, and both need to be asked on every request.

In an API that validates the token but doesn't check authorization, the classic scenario goes like this: an ordinary user captures the request that fetches their own order, changes the order ID in the URL and sees someone else's order. This vulnerability is called BOLA (Broken Object Level Authorization), and it is number one on OWASP's API Top 10 list, updated this year; that's no coincidence. It's the first thing we look for in the APIs we audit, and unfortunately it's usually the first thing we find. Every endpoint that says "token is valid, carry on" is a potential data leak.
There's no mystery to the solution: before returning anything, every endpoint that returns data has to check on the server "does this record belong to this user / can this user access this record?" It's boring, repetitive, unheroic work. Most of security is like that.
There is a way to lighten that repetitive load, too: instead of writing the authorization check by hand in every endpoint, gather it in a central layer, such as middleware or a policy structure. That way the rule lives in one place, no endpoint gets forgotten, and the sentence "the new team member didn't know about the check" becomes history. In the APIs we audit, the presence of this layer is one of the quickest indicators of overall security maturity.
How a token should be carried and stored
On the identity side, I can sum up our practice in three points:
- Short-lived access token + refresh token: Measure the access token's lifetime in minutes, so that if it's stolen, the damage window stays narrow. Long life is the refresh token's job, and it should be revocable.
- If you use JWT, follow its rules: Pin the algorithm on the server (the case of a library that reads the algorithm from the header and swallows alg=none is a classic), verify the signature on every request and don't put sensitive data in it. A JWT isn't encrypted, only signed; anyone can read the payload.
- On mobile, tokens live in secure storage: Keychain on iOS, Keystore on Android. A plain-text token in SharedPreferences is a gift-wrapped present on a rooted device.
Then there's the belief that "we'll embed the API key inside the app, nobody will find it." They find it. The APK gets unpacked, the strings get scanned, and the key comes out in five minutes. No secret embedded in the client is a secret; design your architecture accordingly.

Authorization also has a lesser-known sibling: excessive data exposure. If an endpoint returns far more than what's shown on screen (a hashed password inside the user object, internal notes, other users' email addresses), the attacker sees those fields even if the interface doesn't display them; in a proxy, everything is exposed. Another member of the same family is mass assignment: in an API that writes the JSON coming from the client straight into the model, an eager user simply adds "role": "admin" to the request body. The solution is the same discipline in both directions: explicit allowlists for incoming and outgoing fields. Nothing extra goes in, nothing extra comes out.
Rate limiting: the least discussed, hardest-working measure
Let's go back to the bill case from the start of this post, because its solution lies right under this heading. An API without limits is an invitation to brute force, to data scraping, to bots that inflate your bill. The first intervention we made for that client was layered rate limiting: a general ceiling per IP, a separate ceiling per user, and much stricter dedicated limits on critical endpoints (login, OTP, password reset). Requests that exceed the limit are politely turned away with a 429 code.

The result: the limit placed on the login endpoint alone cut fake attempt traffic by 97%. The bill went back to normal, and real users didn't notice a thing. (The bot operator tried for a few days with different IPs, then gave up and moved on to an easier target. That's the nature of this business; not being an easy target is often enough.)
When designing rate limits, the one key trick is this: don't tie the limit to IP alone. Bots roam with IP pools; a second, user/token-based layer is essential. And log limit violations; those logs are the record of who has been rattling your door.
Then there's the matter of inventory, and it's no accident that it made OWASP's current API list. Our most unsettling findings in the field are always of the same kind: endpoints that aren't in the documentation but are running live. A v1 opened for an old mobile version and then forgotten; an endpoint opened for testing and never closed; an export service added "temporarily" that has been sitting there for three years. An endpoint nobody remembers is an endpoint nobody protects. Taking an API inventory every six months and asking "is this endpoint still needed, and who protects it?" is one of the cheapest audits you can do.
The six questions we use in audits
Let me list the questions we ask ourselves when we first take an API under review; you can use them as a quick test for your own API. Is all traffic over HTTPS, or is there an endpoint left open because "it's internal anyway"? Does every endpoint that returns data have an object-level authorization check? Is input validation done on the server, or does it rely on the good manners of the mobile app? Is layered rate limiting in place? Can the logs answer the question of who accessed what, and when? And do the error messages leak household secrets like stack traces, SQL errors or internal IPs?
If you can confidently answer "yes, we've checked" to all six questions, you're off the attackers' list of easy targets. If you hesitated on some of them (as the client on the phone did), send us a message and let's take a tour of your API through an attacker's eyes. The bill for that tour always comes out smaller than the one the bots run up.