Quick answer: most API data leaks come from seven mistakes. Missing permission checks on individual records, weak authentication, no rate limits, exposing too much data in responses, trusting user input, unprotected old versions and poor monitoring. Fixing them is mostly discipline, not expensive tools.
Think about what talks to your business today. Your mobile app, your website's dynamic parts, your partners' systems, your own dashboards. They all do it through an API, and an API is simply a menu of things your system will do for whoever asks correctly.
That menu is also exactly what an attacker wants to read. When customer records leak from a startup, it is rarely a Hollywood style break in. It is usually a normal looking request that the system should have refused and did not. Here are the seven mistakes that cause most of those moments.
1. Checking who you are, but not what you may see
This is the biggest one. A user logs in, requests their invoice by number, and your API returns it. Then they change the number by one and receive someone else's invoice, because the system only checked that they were logged in.
The fix is to check permission on every single record, every single time, on the server. Ask "is this user allowed to see this specific item?" and never assume the answer from the login alone.
2. Weak or inconsistent authentication
Long lived tokens that never expire, shared keys pasted into mobile apps, passwords sent in the address line. Use modern token based authentication with short lifetimes, refresh tokens that can be revoked, and multi factor authentication for staff. Treat anything shipped inside a mobile app as public, because anyone can extract it.
3. No limits on how often something can be asked
Without rate limits an attacker can try ten thousand passwords, scrape your whole customer list one page at a time or run up your cloud bill. Add limits per user, per address and per endpoint, and make the sensitive ones, such as login and password reset, much stricter.
4. Returning more data than the screen needs
Developers often return the whole database record and let the app pick what to show. The screen shows a name, but the response also contains an email, a phone number, internal notes and a hashed password. Anyone watching the network traffic sees all of it. Return only the fields each screen needs, and review responses as if a stranger will read them.
5. Trusting whatever the client sends
If your app sends the price, the user role or the discount in the request and your server believes it, someone will change it. The server must calculate prices, decide roles and apply discounts itself. Validate the type, length and range of every incoming field, and reject what does not fit.
6. Forgotten old versions and test endpoints
When you launch version two of an API, version one often stays online "just in case", without the new protections. The same goes for test endpoints, debug routes and documentation pages that list every hidden feature. Keep an inventory of every endpoint, retire what you do not use and protect the rest equally.
7. Nobody is watching
Many breaches continue for weeks because nobody notices a pattern: a single account requesting thousands of records, traffic from unusual countries at 3 am, a sudden wave of failed logins. Log requests with enough detail to investigate, and set alerts for the patterns above.
A fifteen minute test you can do this week
- Create two test customer accounts.
- Log in as the first and note the address of a request that fetches their data.
- Replace the record number with one that belongs to the second account. If the data comes back, you have mistake number one.
- Repeat the same request fifty times quickly. If nothing slows you down, you have mistake number three.
- Look at the full response. If it contains fields the screen never shows, you have mistake number four.
Ask your developers to fix whatever you find and to add a test so it can never return. Our engineers build these checks into every API we deliver, whether it is for a SaaS product, a marketplace or a healthcare platform. If you want your API reviewed, talk to us about a security review within our custom software development work.
Frequently Asked Questions
What is the most common API security vulnerability?
Broken object level authorization, where a user can access another user's records by changing an identifier, is consistently the most common and most damaging API flaw.
Do I need an API gateway to be secure?
A gateway helps with rate limits, authentication and monitoring, but it cannot know your business rules. You still need permission checks inside your own code.
Is HTTPS enough to protect my API?
HTTPS protects data while it travels. It does nothing about who is allowed to see what once the request arrives, so you need authentication and authorization as well.
How often should an API be tested for security?
Run automated checks on every release and schedule a deeper manual review at least once a year, and again before large launches or integrations with new partners.
Be the first to comment.