When an API gets breached, it’s rarely because an attacker found a zero-day exploit in your cloud provider’s load balancer. Usually, the API did the exact thing it was programmed to do: it took a request, saw a valid login token, ran a database query, and returned a 200 OK.

Automated security scanners are terrible at catching these bugs because scanners don't understand your product's business logic. They can't tell the difference between a user downloading their own invoice and a user downloading their competitor's invoice.

As a Product Manager, if you treat API design as an invisible engineering implementation detail, these logic gaps will ship to production. Here are five technical API bugs that routinely slip through sprint reviews, why they happen during normal feature work, and how to close them in both your PRDs and your architecture.

1. Validating the Token, But Not the Tenant (BOLA)

How it happens in a sprint: You’re shipping a feature that lets users export their monthly billing report. The acceptance criteria in the ticket says: "Logged-in users can click 'Download' to fetch their report via GET /api/v1/reports/{report_id}."

Engineering puts standard auth middleware on the route. The middleware checks that the user’s JWT signature is valid and not expired. Then the controller runs:

SELECT * FROM reports WHERE id = 9402; 

QA tests the happy path in staging, the download works, and the ticket gets closed.

The vulnerability: Your auth middleware checked who the caller was, but the query never checked if that caller actually owns report 9402. Any customer on a free trial can open Chrome DevTools, change 9402 to 9403, and pull another company's report. This is Broken Object-Level Authorization (BOLA), and it is still the #1 cause of API data leaks.

How to fix it (Product + Eng):

  • In the code: Never trust resource IDs from the URL alone. Pull the tenant_id or user_id directly from the verified JWT claims and force it into the data access layer:

    SELECT * FROM reports WHERE id = 9402 AND tenant_id = :jwt_tenant_id; 
  • In the PRD: Stop allowing sequential integer IDs (9401, 9402) in external URLs—require UUIDv4 or ULIDs so attackers can't loop through your database with a Python script. And write negative acceptance criteria explicitly: "User A with a valid token must receive a 403/404 when requesting a report_id belonging to Tenant B."

2. Shipping the Whole Database Row to Save Sprint Time

How it happens in a sprint: You’re building a collaboration view where users can see who else commented on a ticket. The UI design only shows each commenter's firstName and avatarUrl.

To avoid writing a net-new backend serializer and delaying the sprint, the developer reuses the existing User ORM model and returns the raw object: return res.json(user). The React frontend grabs the two fields it needs and ignores the rest.

The vulnerability: The UI looks clean, so it passes product sign-off. Meanwhile, the raw JSON payload sitting in the browser's Network tab is leaking user.email, user.phone, user.role, user.mfaEnabled, and user.stripeCustomerId for every user on the thread.

The reverse happens on PATCH and PUT routes (Mass Assignment). If the backend takes the incoming JSON body and passes it straight into User.update(req.body), a user can intercept their own profile-update request, inject "role": "admin" or "plan_tier": "enterprise" into the JSON payload, and overwrite columns they were never meant to touch.

How to fix it (Product + Eng):

  • In the code: Ban raw ORM serialization. Force every response through an explicit Data Transfer Object (DTO) or serializer schema that acts as a strict allowlist of fields. Do the same for incoming mutation payloads.
  • In the PRD: Treat the API response contract as part of the product spec, not just the Figma mockup. Define which exact attributes are allowed to leave the server for a given role.

3. Relying on IP Rate Limits for Expensive Endpoints

How it happens in a sprint: You’re launching an SMS OTP login flow, a PDF export feature, or an AI summary button powered by an LLM API. During the security review, someone asks about rate limiting. DevOps confirms that Cloudflare or Nginx is already configured to block any IP address that exceeds 1,000 requests per minute. Everyone checks the box and moves on.

The vulnerability: A blanket 1,000 req/min IP limit protects your infrastructure from a basic DDoS, but it does nothing to protect your product logic or your cloud budget:

  1. Attackers stuffing credentials or scraping data use residential proxy pools that rotate across thousands of IPs at 2 requests per minute per IP. Your IP threshold never triggers.
  2. If an endpoint triggers a Twilio SMS, spins up a headless browser to render a PDF, or calls OpenAI, a single user firing 400 requests a minute will stay well under your IP limit while racking up a massive third-party bill ("Denial of Wallet") or starving your background worker queues.

How to fix it (Product + Eng):

  • In the code: Move rate limiting past the network edge. For authenticated routes, key your rate-limiting buckets (e.g., in Redis) by user_id, org_id, or api_key, not just the client IP.
  • In the PRD: Define tier-based and cost-based quotas as functional requirements. A cheap GET /notifications check can run at 60 req/min, while an expensive POST /generate-ai-report or POST /send-sms route should have a strict sliding window (e.g., 3 requests per minute per user, max 20 per day).

4. Stripping Auth Context at the API Gateway

How it happens in a sprint: As the product scales from a monolith to microservices, the team puts an API Gateway at the edge to centralize authentication. The gateway verifies the user's JWT, extracts the user ID, strips the token, and forwards the request inside the VPC with a plaintext header like X-User-Id: 4821. Internal microservices trust that header implicitly because "it came from inside our private network."

The vulnerability: This creates a hard shell with a soft center. If an attacker finds a Server-Side Request Forgery (SSRF) bug in a peripheral service—like a webhook tester, an image importer, or an outdated third-party library—they can trick that service into making internal HTTP requests across your cluster with any X-User-Id or X-Tenant-Id header they want, completely bypassing the API Gateway.

How to fix it (Product + Eng):

  • In the code: Stop trusting mutable plaintext headers inside the cluster. Either propagate the original signed JWT downstream, or have the gateway mint a short-lived internal JWT signed with an internal key so the microservice owning the database can verify the cryptographic signature before running a query. Pair this with mTLS or strict network policies so a compromised worker pod can't open connections to core billing or user-data services.
  • In the PRD: When scoping platform or multi-tenant architecture initiatives, make zero-trust service-to-service verification a baseline non-functional requirement.

5. Refusing to Kill /api/v1 Because of Two Legacy Customers

How it happens in a sprint: Your team rebuilds the checkout or user-management flow in /api/v2 with strict schema validation, better RBAC checks, and cleaner error handling.

When it’s time to turn off /api/v1, someone points out that an old iOS app build from 18 months ago—or one enterprise customer's custom webhook script—is still hitting the v1 routes. Nobody wants to deal with customer complaints, so PM and Eng agree to leave /api/v1 running quietly in the background.

The vulnerability: Six months later, nobody on the team remembers /api/v1 exists. It isn't included in new threat models, and when security patches are applied to v2 controllers, nobody backports them to v1. Yet that unmaintained v1 code is still wired directly into your live production database. When pentesters or attackers hit a wall on /api/v2/users/export, the very first thing they try is changing the URL to /api/v1/users/export or /api/beta/users/export.

How to fix it (Product + Eng):

  • In the code: Compare your runtime ingress/gateway logs against your documented OpenAPI spec to spot shadow or zombie routes still taking traffic. Add standard HTTP Deprecation and Sunset headers to legacy responses, and log which specific api_key or user_id is still calling them.
  • In the PRD: API deprecation is a product decision, not an engineering cleanup chore. Never ship a v2 endpoint without a hard sunset date for v1 in the rollout plan. Give customers a 90- or 180-day migration window, notify the exact accounts still hitting the old routes, and delete the legacy controller code from the repo when the window closes.

The 3-Question Pre-Launch Check

Before you click "Sign Off" on a user story or approve an API-backed feature during sprint review, sit down with your tech lead and ask these three specific questions. Here is how to evaluate their answers:

1. "If I swap the resource ID in this request with another tenant's ID, what line of code stops the query?"

  • Why it matters: This directly targets BOLA (Broken Object Level Authorization). You are checking if authorization is checked at the database layer or if the system blindly trusts the URL.
  • The red-flag answer to watch out for: "Well, the UI button only appears if you are logged in, so a normal user can't click it to get another tenant's ID." (This means security is entirely reliant on frontend visibility, which can be bypassed in seconds using Postman or curl).
  • What "Good" looks like: "We extract the tenant_id from the cryptographically verified JWT inside the request context and append it as a hard bind parameter directly to the database query."

2. "If I open the browser Network tab on this screen, are we returning database columns the UI doesn't actually use?"

  • Why it matters: This targets Excessive Data Exposure. You want to confirm that the backend is executing strict payload serialization instead of dumping raw database rows.
  • The red-flag answer to watch out for: "Yes, the API returns the full User table row, but don't worry, the React code is configured to only render the name and profile picture." (This means the sensitive data is still traveling over the public internet in plaintext).
  • What "Good" looks like: "No, we created a specific UserMinifiedDTO serializer class for this endpoint. It explicitly allowlists and outputs only the first_name and avatar_url fields, and strips out everything else before the payload is serialized to JSON."

3. "If someone writes a script to hit this endpoint 5,000 times tonight, does it cap out per user, or does it blow up our cloud bill?"

  • Why it matters: This targets Rate Limiting and Denial of Wallet vulnerabilities. It forces the team to look at the computational or financial cost of an endpoint.
  • The red-flag answer to watch out for: "Cloudflare is configured to rate-limit any single IP address to 1,000 requests per minute, so we're covered." (This fails against distributed proxy scrapers, and 1,000 requests to an expensive AI model or SMS endpoint will still drain your budget instantly).
  • What "Good" looks like: "This endpoint is rate-limited at the application layer using Redis. We've set a token-bucket limit of 5 requests per minute per authenticated user_id because it triggers an upstream PDF generation, and we have an active alert configured if our daily Twilio/OpenAI spend spikes past our safety threshold."