| Approach | What it actually covers | What it misses |
|---|---|---|
| API gateway with static rate limits | Basic throughput control per key or IP address | Distributed low-and-slow abuse, business-logic attacks, undocumented endpoints |
| Manual API documentation and inventory | Endpoints the team remembers to register | Shadow APIs from forgotten deploys, third-party integrations, and old mobile app versions |
| Traditional WAF signature rules | Known injection and payload patterns | Broken object-level authorization, since the request looks syntactically valid |
| Continuous discovery plus behavioral analytics | Shadow/zombie inventory, authorization anomalies, and abuse patterns across the full API surface | Still requires tuning and human triage of alerts |
Why API security is now its own discipline
Modern applications are assembled from dozens to hundreds of internal and external APIs, and each one is a direct path to data and functionality that traditional perimeter defenses were never designed to inspect. Unlike a web page, an API endpoint rarely has a human in the loop reviewing what comes back, which means a single authorization flaw can be scripted and harvested at scale before anyone notices. Industry surveys now put the share of organizations that experienced at least one API-related security incident in the prior year at close to universal, and a large share of those incidents trace back to just two root causes: an API nobody knew was exposed, and an authorization check that assumed a user could only ever request their own data.
That combination is why API security programs are built around three connected pillars rather than a single tool: discovery of the full API surface including forgotten and undocumented endpoints, correct object- and function-level authorization enforced on every request, and abuse detection tuned to the behavioral patterns of automated scraping and credential-stuffing rather than only known attack signatures.
Shadow and zombie API discovery
A shadow API is any endpoint running in production that is not tracked in the organization’s official inventory, often created when a developer ships a quick internal integration, a mobile team adds a new backend call, or a third-party partner integration exposes a path nobody registered with the security team. A zombie API is the inverse problem: an old, deprecated version of an endpoint that was supposed to be retired but is still reachable, frequently still running an older authentication scheme or missing security patches applied to the current version.
How effective discovery actually works
- Runtime traffic analysis using eBPF or service mesh telemetry to observe every call actually being made, rather than relying on what developers documented.
- Gateway and load balancer log mining to surface paths that receive real traffic but appear in no OpenAPI specification.
- Cloud provider audit logs and DNS records, which often reveal forgotten subdomains and load balancer rules pointing at retired services.
- Static code analysis across repositories to catch API routes defined in code before they are ever deployed.
- Mobile and client-side binary analysis, since older app versions still installed on user devices frequently call zombie endpoints that were never fully decommissioned.
No single method above is sufficient alone. Runtime traffic analysis misses endpoints that receive no traffic during the observation window, while code analysis misses infrastructure-level routes that never touch application code directly. Mature programs correlate all of these sources into one inventory and treat any endpoint that appears in traffic but not in the documented specification as an immediate finding requiring triage, a discipline that overlaps closely with the continuous scanning approach used for cloud misconfiguration in general.
| Discovery source | Best at finding | Common gap |
|---|---|---|
| Runtime traffic / eBPF telemetry | Live shadow endpoints receiving real requests | Low-traffic or rarely called routes |
| Gateway and WAF logs | External-facing undocumented paths | Internal service-to-service calls that bypass the gateway |
| Cloud audit logs / DNS | Forgotten infrastructure and legacy load balancer rules | Application-layer routing behind a single exposed endpoint |
| Source code scanning | Routes defined but not yet deployed or documented | Dynamically generated or configuration-driven routes |
Authorization failures: BOLA and the misconfiguration problem
Broken object-level authorization, commonly abbreviated BOLA, occurs when an API checks that a user is authenticated but fails to verify that the specific object being requested actually belongs to that user. A classic example is an endpoint like a resource lookup by numeric identifier, where simply incrementing the identifier in the request returns another user’s record because the server only checked for a valid session token, not ownership of that particular resource. Industry data consistently places BOLA and related injection issues as responsible for well over a third of confirmed API security incidents, making it the single most consequential class of API vulnerability in production today.
Common authorization misconfigurations beyond BOLA
- Broken function-level authorization, where an endpoint intended only for administrators is reachable by any authenticated user because the role check happens in the client, not the server.
- Excessive data exposure, where an endpoint returns a full object including sensitive fields, relying on the client application to filter what it displays rather than the server withholding the data.
- Mass assignment, where an API accepts and applies every field in a request body, allowing an attacker to set privileged fields such as an account role that were never intended to be user-editable.
- Improper OAuth scope validation, where a token issued for a narrow purpose is accepted for broader operations because scope enforcement is inconsistent across microservices.
- Weak or missing token expiration, leaving long-lived tokens that remain valid long after a user’s session should have ended.
The fix for object-level authorization is conceptually simple: every request that operates on a specific object must independently verify that the authenticated identity is permitted to access that specific object, not just that the identity is valid. In practice this requires a centralized authorization layer or consistently applied middleware, because leaving the check to be reimplemented in every individual endpoint handler is exactly how these gaps get introduced in large codebases with many contributors.
Anatomy of a BOLA exploit
An authenticated attacker calls a legitimate endpoint with a valid session token, then simply changes the object identifier in the request path or body; the server confirms the token is valid but never checks whether the token’s owner actually has rights to that specific object, returning another user’s data as if it were the requester’s own.
Abuse and bot detection at the API layer
Even a perfectly authorized, fully discovered API surface remains vulnerable to abuse that looks legitimate at the protocol level: credential stuffing against a login endpoint, inventory scraping against a pricing endpoint, or automated account creation against a signup endpoint. These attacks succeed precisely because each individual request is well-formed and passes authentication; the signal that something is wrong only emerges from patterns across many requests over time.
Signals that distinguish abuse from legitimate traffic
- Request velocity and timing regularity that is inconsistent with human interaction, such as requests arriving at perfectly even intervals.
- Sequential or exhaustive parameter enumeration, where a client works through identifiers or values in an ordered pattern rather than the scattered pattern typical of real users.
- Client fingerprint inconsistencies, such as a client claiming to be a particular mobile app version but missing headers or behaviors that version always sends.
- Distributed low-and-slow patterns, where a single logical attack is spread across many IP addresses and accounts specifically to stay under simple per-key rate limits.
- Deviation from an established behavioral baseline for a given user or API key, flagged through machine-learning models trained on months of normal traffic.
Static rate limiting alone is necessary but not sufficient against these patterns, since a well-resourced attacker can trivially distribute requests across enough source identities to stay under any fixed per-key threshold. Effective abuse detection instead combines rate limiting as a baseline control with behavioral analytics that model what normal usage looks like for a given endpoint and flag statistically significant deviations, then apply graduated responses such as step-up authentication challenges before moving to outright blocking.
Common mistake
Teams frequently deploy a single company-wide rate limit, such as a fixed number of requests per minute per API key, and consider abuse detection solved. Sophisticated scraping and credential-stuffing operations easily stay under that threshold by distributing requests across large pools of accounts and IP addresses, so the limit only stops the least sophisticated automated traffic while leaving the real threat unaddressed.
What worked
Combining a conservative default rate limit with a behavioral model trained on 90 days of normal traffic per endpoint, then routing only statistically anomalous sessions into a step-up verification challenge instead of an outright block, cut confirmed credential-stuffing success rates sharply while adding negligible friction for legitimate users.
Building an API security program that covers all three pillars
Discovery, authorization, and abuse detection are not sequential phases to complete once; they are three continuously running processes that feed each other. A newly discovered shadow endpoint needs its authorization logic reviewed immediately, since undocumented endpoints are disproportionately likely to have skipped the authorization review applied to formally onboarded APIs. Abuse detection models need to be retrained whenever the discovered API surface changes meaningfully, since a model trained against yesterday’s inventory will not recognize traffic against a newly found endpoint as anything but noise.
A practical rollout sequence
- Stand up continuous discovery first, correlating gateway logs, runtime traffic, and source code scanning into a single inventory, and flag every undocumented endpoint found.
- Triage discovered shadow and zombie endpoints, prioritizing any that touch authentication, payment, or personal data fields for immediate authorization review.
- Centralize object- and function-level authorization checks into shared middleware or a policy service rather than leaving them to individual endpoint implementations.
- Layer behavioral abuse detection on top of the now-complete inventory, since abuse models are only as good as the endpoint coverage feeding them.
- Establish a recurring cadence, at minimum monthly, to re-run discovery and catch new shadow endpoints introduced since the last cycle.
| Pillar | Primary goal | Representative tooling category |
|---|---|---|
| Discovery | Complete, accurate inventory of every reachable endpoint | API security posture and discovery platforms, traffic analysis |
| Authorization | Correct object- and function-level access checks on every request | Centralized authorization/policy middleware, automated BOLA testing |
| Abuse detection | Identifying automated and malicious traffic patterns that pass authentication | Behavioral analytics, bot management, adaptive rate limiting |
Measuring whether an API security program is actually working
It is easy to buy discovery tooling, write a handful of authorization tests, and declare an API security program complete, but that activity does not automatically translate into risk reduction. The more useful question is whether a small set of outcome metrics is trending in the right direction over time, since raw tool deployment says nothing about whether the underlying gaps are actually closing.
Metrics worth tracking on a recurring basis
- Percentage of discovered endpoints that match the documented inventory, which should trend toward one hundred percent as discovery and documentation processes mature.
- Mean time to authorization review for newly discovered shadow endpoints, since a growing backlog of unreviewed endpoints indicates the triage process is not keeping pace with discovery.
- Number of confirmed BOLA or broken function-level authorization findings per quarter, tracked over time rather than as a single point-in-time audit result.
- Ratio of automated versus manual penetration testing coverage across the API surface, since manual testing alone cannot scale to hundreds of endpoints.
- False positive rate on abuse detection alerts, which directly predicts whether analysts will keep reviewing alerts or start ignoring the queue.
These metrics also give a defensible way to communicate program maturity to leadership without resorting to vague statements about being “more secure.” A shrinking mean time to review, a falling count of new BOLA findings quarter over quarter, and a discovered-versus-documented ratio approaching parity together tell a concrete story that a point-in-time compliance checklist cannot.
Automated API-specific penetration testing, which replays authenticated sessions against every discovered endpoint while systematically varying object identifiers and user roles, has become the standard way to generate the BOLA and function-level authorization metrics above at a scale manual testing cannot match. Pairing that automated testing with periodic manual review for business-logic flaws that automation tends to miss gives the most complete picture of an API’s actual risk posture.
Frequently overlooked parts of an API security program
- Internal, service-to-service APIsPrograms frequently focus discovery and authorization effort only on externally facing APIs, leaving internal microservice-to-microservice calls with weaker checks even though a compromised internal service can pivot through them freely.
- Third-party and partner integrationsAPIs exposed specifically for partners or vendors often get provisioned outside the normal review process because they are treated as a one-off business request rather than a new attack surface.
- GraphQL-specific risksFlexible query languages introduce their own authorization and abuse patterns, such as deeply nested queries used for denial-of-service or field-level authorization gaps that REST-focused tooling does not check.
- API versioning hygieneOld API versions kept alive for backward compatibility rarely receive the same security patches and monitoring as the current version, quietly becoming zombie APIs over time.
- Documentation driftOpenAPI specifications that are written once and never updated give a false sense of complete inventory, actively misleading security reviews that trust the spec over observed traffic.
- Token and key lifecycleAPI keys and OAuth tokens issued to long-departed integrations or employees frequently remain valid indefinitely because no process ties key issuance to an expiration or offboarding trigger.
- Cross-team ownership gapsWhen no single team is accountable for a given API’s security posture, discovery findings and authorization gaps sit unresolved because nobody is clearly responsible for fixing them.
Glossary
- Shadow API
- An API endpoint running in production that is not tracked in an organization’s official inventory or documentation.
- Zombie API
- A deprecated or supposedly retired API version that remains reachable and often still runs outdated authentication or security controls.
- BOLA
- Broken object-level authorization, a flaw where an API checks that a request is authenticated but fails to verify the requester owns the specific object being accessed.
- Mass assignment
- A vulnerability where an API blindly accepts and applies every field in a request body, allowing attackers to modify fields that were never meant to be user-editable.
- API gateway
- A managed entry point that routes, authenticates, and applies policy such as rate limiting to API traffic before it reaches backend services.
- Behavioral baseline
- A statistical model of normal traffic patterns for a given user, API key, or endpoint, used to flag deviations that indicate automated abuse.
Key Takeaways
- Most API security incidents trace back to endpoints nobody knew existed or authorization checks that never verified object ownership, not to sophisticated exploits.
- Shadow APIs come from forgotten internal integrations and unreviewed partner access; zombie APIs come from old versions that were never properly retired.
- Effective discovery correlates runtime traffic, gateway logs, cloud audit logs, and source code scanning, since no single method covers the full API surface alone.
- Broken object-level authorization and related issues account for well over a third of confirmed API security incidents industry-wide.
- Object- and function-level authorization checks should be centralized in shared middleware rather than reimplemented per endpoint.
- Static rate limiting alone cannot stop distributed, low-and-slow abuse; behavioral baselining is needed to catch requests that individually look legitimate.
- Discovery, authorization, and abuse detection are continuous, interdependent processes, not one-time projects to complete and move on from.
FAQs
What is the difference between a shadow API and a zombie API?
A shadow API is an endpoint running in production that was never added to the official inventory or documentation, often created during a quick integration. A zombie API is an old, supposedly retired version of an endpoint that remains reachable, often still running outdated authentication or missing recent security patches.
Why is broken object-level authorization so common in APIs?
BOLA happens because developers correctly verify that a request carries a valid session token but forget to separately verify that the token’s owner actually has rights to the specific object being requested. This second check is easy to skip when authorization logic is implemented individually in each endpoint rather than centrally enforced.
Can a web application firewall stop API abuse on its own?
Not fully. A WAF is effective against known injection patterns and malformed payloads, but abuse such as credential stuffing or scraping typically uses well-formed, authenticated requests that pass signature-based rules. Behavioral analytics and adaptive rate limiting are needed to catch these patterns.
How often should API discovery scans run?
Continuous, real-time traffic-based discovery is ideal, supplemented by a full correlated review, cross-referencing code, gateway logs, and cloud audit trails, at least monthly. New shadow endpoints appear constantly as teams ship integrations, so infrequent point-in-time audits quickly go stale.
Does GraphQL introduce different API security risks than REST?
Yes. GraphQL’s flexible query structure introduces risks like deeply nested queries used for denial-of-service and field-level authorization gaps that traditional REST-focused scanning tools often miss, since a single GraphQL endpoint can expose an entire object graph rather than one fixed resource per URL.
What is mass assignment and why does it matter?
Mass assignment occurs when an API accepts every field submitted in a request body and applies it directly to an object, without restricting which fields a user is actually allowed to set. This lets an attacker include and modify privileged fields, such as an account role, that were never intended to be user-editable.
Should internal, service-to-service APIs get the same security treatment as public APIs?
Yes. Internal APIs are frequently under-protected because teams assume the network perimeter provides sufficient security, but a compromised internal service or credential can move laterally through weakly authorized internal APIs just as easily as through public-facing ones.
What is the single highest-impact first step for a team with no formal API security program?
Running a correlated discovery pass across gateway logs, runtime traffic, and source code to build a first complete inventory, then immediately reviewing authorization logic on any newly found endpoint touching authentication, payment, or personal data, delivers the fastest risk reduction before any advanced tooling is needed.
References
- Wiz, “What Is A Shadow API? Security Risks, Detection, and Prevention”
- Checkmarx, “API Security Best Practices: How to Catch Shadow and Zombie APIs Before Attackers Do”
- OX Security, “Understanding Shadow APIs: Risks and Management”
- APIsec, “Secure Your Shadow APIs: Best Practices for API Discovery”
- Prophaze, “Shadow API Discovery: Why It Matters for Modern Application Security”
Related reading: CI/CD pipeline security, third-party risk management for SaaS sprawl, dependency confusion and typosquatting defence, secure coding practices, and container security.
