API inventory gaps: shadow, zombie, and undocumented endpoints
You cannot protect APIs you do not know about. How old versions, debug routes, and undocumented services stay reachable, and how to build an inventory from gateways, traffic, specs, and DNS.
Diagram
Building an API inventory from four sources
Step 1 of 4
Specs
OpenAPI files in repositories list intended routes.
$ fd -e yaml -e json openapi . | wc -l 14
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Zombie versions
- What fails
- An old API version stays live after clients moved on, without the newer checks.
- Who is affected
- Users whose data the old version still serves.
- What you would notice
- Traffic on /v1 paths after a v2 launch.
- What you change
- Announce sunset dates, return Sunset headers, then remove the route.
Shadow endpoints
- What fails
- Routes added outside the spec, such as debug or partner-only paths.
- Who is affected
- Whatever the undocumented route touches.
- What you would notice
- Paths in logs that appear in no OpenAPI file.
- What you change
- Require a spec entry for every gateway route.
Ownerless services
- What fails
- Nobody patches or reviews an API without an owner.
- Who is affected
- Users of an unmaintained service.
- What you would notice
- Inventory rows without a team.
- What you change
- Assign an owner or schedule the service for removal.
Hosts as well as paths
API hosts hide in DNS: api-old, staging-api, partner-api. Certificate transparency logs and your own DNS zones list them. The subdomain discovery tools in the tool library, such as subfinder and amass, help build that list for domains you own.
Retiring an endpoint cleanly
Announce, measure, and remove. Sunset and Deprecation headers tell clients in-band, and gateway logs show when traffic reaches zero.
Deprecation: true Sunset: Thu, 31 Dec 2026 23:59:59 GMT Link: <https://developer.example.test/migrate-v2>; rel="sunset"
Check yourself
Recognition and the fix. Nothing here is a procedure.
Logs show steady traffic on /api/v1/orders a year after v2 launched. What is the risk?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
- 01Broken API authentication: tokens, keys, and the checks that get skippedCommon API authentication failures: unvalidated JWT claims, API keys in URLs, missing rate limits on token endpoints, and long-lived tokens.
- 02API security misconfiguration: defaults, debug modes, and permissive CORSThe configuration mistakes that turn a sound API into an exposed one: debug endpoints, verbose errors, wildcard CORS with credentials, open documentation consoles, and missing TLS settings, with a scan-and-fix workflow.
- 03Injection through API fields: JSON bodies reaching SQL, NoSQL, and shellsWhy JSON APIs are still injection targets: operator injection in MongoDB-style queries, typed fields that are never type-checked, and filter parameters passed to query builders.
- 04Unsafe consumption of third-party APIs: treating partner data as trustedWhen your service calls a partner or SaaS API, its responses are input too.
- 05GraphQL security: introspection, resolver authorization, and query costWhere GraphQL APIs go wrong — missing authorization in resolvers, unbounded nested queries, batching that defeats rate limits, and injection in resolver code — and how to review a schema and test it with a tool like InQL or graphql-cop.