Last updated: April 29, 2026
The API is your backend’s public interface. If your mobile app or SPA depends on the API, every endpoint is exposed to the internet whether you intended it or not. Yet developers routinely treat APIs as “internal” because the API documentation is not public. This mental-model error is where most modern web compromises start.
Why this happens
APIs grow organically. An endpoint is added for the mobile app. Another for the web SPA. Another for a back-office tool. Another for a third-party integration. Each has its own authentication assumptions, its own authorization model, its own rate limit. Nobody maintains the canonical inventory. Security reviews cover the “main API” but miss the half-dozen auxiliary ones.
Worse: mobile apps often call endpoints that web apps don’t. Those endpoints were designed assuming “the mobile app is the only caller and we can control the mobile app’s behaviour.” Neither of those assumptions is true once the mobile app is in the wild.
How it goes wrong
1. Shadow endpoints
Documented API has 50 endpoints. Actual deployed API has 80. The 30 undocumented ones existed for internal tools, beta features, debugging, or historical reasons. Attackers find them via JavaScript bundle analysis, mobile app decompilation, API discovery tools, or Wayback Machine archives.
2. Auth model drift
Main API uses bearer tokens with scope checks. Admin API uses session cookies. Webhook-receiver API uses HMAC signature. Each has different code paths. Attackers target the weakest.
3. Mobile-only trust
Backend endpoint checks for User-Agent: MyApp/1.0 or X-API-Version: 2 headers. Assumes only mobile app sends these. Attacker sets the headers from curl. Done.
4. Versioning landmines
/v1/ deprecated but still live. Has bug. /v2/ fixed the bug. Attacker calls /v1/ directly. Fix not retrofitted.
5. Internal-service calls exposed
Backend Service A calls Backend Service B at http://service-b.internal:8080/api/admin-reset. Internal. Until the cluster networking is misconfigured, or until A is compromised, or until you run the endpoint on a shared ingress.
6. Over-returning data
Endpoint designed for mobile app returns full user object including password hash, internal flags, or PII. Mobile app displays only name. Attacker queries the endpoint and sees everything.
7. Under-validating schemas
Endpoint accepts JSON body. Schema says “name, email.” User sends “name, email, role”. Backend’s ORM object mass-assigns role. User becomes admin.
Why we look
Because APIs are the modern attack surface. Web page XSS is an attacker-effort-to-reach-one-user. API BOLA is attacker-effort-to-reach-all-users. The blast radius is orders of magnitude bigger. In 2024, OWASP API Top 10 moved from a supplementary to the primary focus of many security programs. That reflects reality.
Mobile apps make this worse. The mobile client is distributed to attackers by design (it’s downloaded from app stores). Every endpoint called from mobile is in reach of any attacker who decompiles the app — and they will. Assuming otherwise is the fundamental error.
What we find
- Undocumented endpoints discovered via JS bundle / mobile app decompilation
- Debug endpoints (
/debug,/metrics,/health) exposing internal state - Old API versions (
/v1/) still live, unpatched - Mobile-only endpoints with looser auth than web-mirror endpoints
- Admin API at
/admin/api/— different code path, different authz (or none) - Endpoints that differ in auth for “registered app ID” header — spoofable
- Mass assignment: endpoint accepts fields beyond the documented schema
- Response payloads containing extra fields mobile doesn’t display but server sends anyway
- Internal service-to-service endpoints exposed through misrouting or shared ingress
- GraphQL endpoints with introspection enabled
- OpenAPI / Swagger JSON publicly accessible without auth (gives attack map)
- Webhook receivers that don’t verify HMAC signature, or accept multiple signatures
- Rate limits that apply to authenticated but not unauthenticated endpoints (signup, password reset)
How to enumerate
- Intercept everything. Proxy mobile app + web app + desktop app. Extract every unique URL
- Decompile JS bundles. Mobile bundle (IPA, APK), web JS (webpack output). Grep for URLs
- Wayback Machine. Historical endpoints that may still be live
- Subdomain enumeration.
api-staging.,admin-api.,internal-api.often hit by DNS enumeration - OpenAPI / swagger.json paths at
/swagger,/openapi,/v3/api-docs,/graphql - API version brute force.
/v1/,/v2/,/api/v1/,/api/2023-01-01/ - Endpoint parameter fuzz. Known endpoint accepts ID; try fuzzing other param names
Defence checklist
- API gateway as authoritative inventory — endpoints not in gateway = don’t exist
- Uniform auth model across all endpoints — one mechanism, consistently applied
- Deprecation with hard sunset — after a date, the old version returns 410 Gone
- Schema validation on every endpoint with strict mode (reject unexpected fields)
- Response payload schemas that explicitly exclude sensitive fields
- Scoped tokens (read vs write, tenant-specific)
- Rate limits on unauthenticated endpoints (signup, password reset, OTP request)
- Webhook verification mandatory with rotated signing keys
- Regular API discovery scans (from outside) to detect drift between gateway inventory and deployed reality
Mindset takeaway
Your mobile app is public. Your web JS is public. Any endpoint either calls is public by extension. The question isn’t “who should call this?” — it’s “who CAN call this?” The two are often different. Enumerate your real API surface, not the documented one. For pentesters: the first hour of any web/mobile engagement is endpoint enumeration. For defenders: your gateway should be the source of truth, and drift from it is a vulnerability.
Module Quiz · 15 questions
Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.
Custom team training + practitioner advisory
Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.