Your API inventory says you have 47 APIs. You actually have 200+. The difference is shadow APIs: undocumented, unmonitored, and unprotected endpoints that exist in your environment without your security team's knowledge. They weren't built maliciously. They were built by developers who needed a quick integration, a debug endpoint during development, a legacy service nobody decommissioned, or a microservice that bypassed the API gateway.
Shadow APIs are the API equivalent of shadow IT, except more dangerous. Shadow IT is an unapproved SaaS application storing company data. A shadow API is an unapproved endpoint directly connected to your production database, processing real customer data, without authentication, without rate limiting, without logging, and without anyone monitoring it.
Research consistently shows that organisations underestimate their API count by 40% to 60%. The APIs they don't know about are the ones attackers find first, because those are the APIs with the weakest security controls. Every major API breach in recent years has involved endpoints the organisation either forgot existed or didn't know were exposed.
This guide covers what shadow APIs are, how they form, why they're the highest-risk component of your API attack surface, how to discover them, and how API penetration testing finds the shadow APIs that automated discovery tools miss.
What Are Shadow APIs?
Shadow APIs are API endpoints that exist in an organisation's environment but aren't documented in the official API inventory, aren't managed through the API gateway, and aren't monitored by the security team. They process real data and serve real traffic but exist outside the organisation's visibility and governance.
Shadow APIs vs Zombie APIs
Shadow APIs were never documented. They were created without going through the API management process and operate entirely outside official inventory.
Zombie APIs were once documented and managed but have been deprecated, replaced, or abandoned without being decommissioned. The documentation was removed. The monitoring was disabled. But the endpoint still responds to requests.
Both are dangerous because neither receives security updates, monitoring, or testing. The distinction matters for discovery: shadow APIs require active scanning to find because no historical documentation exists. Zombie APIs can sometimes be found by reviewing old documentation, version control history, and archived API gateway configurations.
The Scale of the Problem
Organisations typically discover 30% to 60% more APIs than they knew about when they first conduct comprehensive API discovery. A company with 100 documented APIs commonly has 150 to 200 total endpoints. The undiscovered APIs often have weaker security controls because they never went through security review.
How Shadow APIs Form
Developer-Created Endpoints
Developers create endpoints during development for testing, debugging, or internal tooling. These endpoints bypass the API gateway, skip the security review process, and remain in production after deployment.
Examples: /api/debug/user-lookup created for troubleshooting, returning full user records without authentication. /internal/health-check exposing system configuration details. /test/create-admin left from development that still creates administrative accounts.
Microservice Proliferation
Microservice architectures multiply APIs exponentially. Each microservice exposes its own endpoints. Service-to-service communication creates internal APIs that may be unintentionally accessible externally. New microservices are deployed faster than the API inventory is updated.
The gap: The API gateway knows about 50 customer-facing endpoints. Behind the gateway, 300 microservice endpoints communicate with each other. Some of those internal endpoints are accessible through network misconfiguration, direct IP access, or missing authentication at the service level (relying on the gateway that some paths bypass).
Legacy System Migration
When organisations migrate from monolithic applications to microservices or cloud architectures, old API endpoints persist. The new system is documented. The old system continues running because "something still depends on it." Nobody remembers what depends on it or what the old endpoints expose.
Acquisition and Merger Integration
Acquiring another company means inheriting their entire API surface, including their shadow APIs. Due diligence may catalogue the acquiree's known APIs. The unknown APIs transfer silently into the combined environment. See our M&A pentesting guide for addressing security in acquisitions.
Third-Party Integration Endpoints
Developers create API endpoints specifically for third-party integrations: webhook receivers, callback URLs, data sync endpoints. These endpoints are documented in the integration configuration but often missing from the central API inventory.
Mobile and SPA Backend APIs
Mobile applications and single-page applications communicate with backend APIs that may differ from the documented public API. Mobile-specific endpoints, older API versions kept for backward compatibility, and beta feature endpoints create API surface outside the official inventory.
Why Shadow APIs Are Dangerous
No Authentication
Shadow APIs frequently lack authentication entirely. They were created for internal use, testing, or debugging where authentication was unnecessary. When they become externally accessible (through misconfiguration, network changes, or cloud deployment), anyone can access them.
No Authorisation
Even shadow APIs with authentication often lack proper authorisation. Every endpoint accepting resource IDs without ownership validation is an IDOR vulnerability. Shadow APIs are the most common location for BOLA (Broken Object-Level Authorization), the #1 OWASP API risk.
No Rate Limiting
Official APIs go through the API gateway, which enforces rate limits. Shadow APIs bypassing the gateway have no rate limiting, enabling credential stuffing, data scraping, brute-force attacks, and resource exhaustion at unlimited speed.
No Monitoring
If the security team doesn't know the API exists, they're not monitoring it. No access logs feeding the SIEM. No anomaly detection. No alerting on suspicious activity. An attacker can enumerate the entire database through a shadow API without triggering a single alert.
No Security Testing
Shadow APIs are absent from penetration testing scope because nobody knows they exist. Annual pentests cover documented APIs. Shadow APIs are tested for the first time when an attacker discovers them.
Direct Database Access
Shadow APIs created for internal tooling often have direct database access with overprivileged credentials. The endpoint may return complete database records (including fields the public API filters out) because it was designed for developer convenience, not customer-facing security.
Outdated Code and Dependencies
Shadow APIs from legacy systems run outdated code with unpatched vulnerabilities. Nobody maintains what nobody knows about. These endpoints may use deprecated frameworks with known CVEs that have public exploit code.
Real-World Shadow API Attack Patterns
Pattern 1: API Version Discovery
An attacker interacting with api.example.com/v3/users tests for older versions: /v2/users, /v1/users. Version 1 was deprecated years ago but never decommissioned. V1 has no rate limiting, returns more data fields than v3 (including internal IDs and email addresses), and uses weaker authentication.
Impact: Complete customer data extraction through a zombie API that hasn't been updated since 2019.
Pattern 2: Internal Endpoint Exposure
Cloud migration moved microservices to Kubernetes. Internal service endpoints that were only accessible within the corporate network are now accessible through the cloud load balancer because the ingress controller wasn't configured to restrict internal paths. /internal/admin/users, /service/database/query, and /debug/config are reachable from the internet.
Impact: Unauthenticated administrative access through endpoints designed for internal service communication.
Pattern 3: Forgotten Integration Endpoint
A webhook receiver was created for a vendor integration that ended two years ago. The endpoint accepts POST requests, processes the payload, and writes to the production database. No authentication (the original vendor authenticated via shared secret in the payload, which the attacker can obtain or brute-force).
Impact: Direct database write access through an abandoned, unmonitored endpoint.
Pattern 4: Development Endpoint in Production
A developer created /api/dev/seed-data to populate test data during development. The endpoint creates user accounts, generates transactions, and sets account balances. It was deployed to production with the application code and never removed. No authentication required.
Impact: Arbitrary user creation and balance manipulation through a development endpoint that was never meant to exist in production.
Pattern 5: Mobile API Exploitation
The mobile app communicates with a separate API (mobile-api.example.com) not documented in the public API reference. The mobile API has different (weaker) authentication, returns more user data per request, and has higher rate limits to accommodate mobile app performance requirements.
Impact: The mobile API becomes the preferred attack path because it has weaker controls than the documented public API.
How to Discover Shadow APIs
Passive Discovery Methods
Traffic analysis. Monitor all HTTP/HTTPS traffic at the network perimeter. Compare observed API endpoints against the documented inventory. Every endpoint in traffic that isn't in your inventory is a shadow or zombie API.
Log analysis. Analyse web server, load balancer, and API gateway logs for endpoints not in the official API catalogue. Look for URL patterns suggesting API endpoints: paths containing /api/, /v1/, /internal/, /admin/, /debug/, /test/.
DNS enumeration. Discover subdomains that may host undocumented APIs: api-dev.example.com, internal-api.example.com, staging-api.example.com, mobile-api.example.com. Attack surface management tools automate continuous subdomain discovery.
Cloud resource inventory. Query cloud APIs (AWS, Azure, GCP) for load balancers, API gateways, Lambda functions, and container services that may expose undocumented endpoints. See our cloud security testing guide and AWS testing guide.
Active Discovery Methods
Endpoint brute-forcing. Use wordlists of common API paths (/api/users, /api/admin, /api/v1/, /internal/, /debug/, /graphql) against all domains and subdomains. Tools: ffuf, dirsearch, feroxbuster.
JavaScript analysis. Analyse frontend JavaScript (web application and mobile app bundles) for API endpoints referenced in client-side code. Decompile mobile applications to extract hardcoded API URLs. Many shadow APIs are discoverable in client-side code because the frontend calls them directly.
Source code review. Search repositories for endpoint definitions, route declarations, and URL patterns. grep -r "@app.route\|@RequestMapping\|router.get\|router.post" across all repositories reveals every endpoint defined in code, including those not in the API inventory.
API gateway comparison. Export all routes from the API gateway. Compare against routes defined in application code. The difference reveals endpoints bypassing the gateway.
Penetration Testing Discovery
API penetration testing discovers shadow APIs that automated tools miss. Testers use creative discovery techniques: testing for undocumented parameters, probing for older API versions, analysing error messages revealing internal endpoints, and testing for path-based access to internal services.
Manual penetration testing excels at shadow API discovery because human testers adapt their approach based on what they find. An error message mentioning an internal service name becomes a lead. A response header revealing a backend server becomes a target. This adaptive discovery is what automated scanning cannot replicate.
How to Secure Shadow APIs
Step 1: Comprehensive API Discovery
You can't secure what you don't know about. Run a complete API discovery combining traffic analysis, log analysis, DNS enumeration, cloud resource inventory, code review, and active endpoint scanning. Build a comprehensive inventory of every API endpoint in your environment.
Step 2: Classify and Prioritise
For each discovered API, determine: Is it still needed? What data does it access? Who should be able to access it? Is it documented? Is it in the API gateway?
Classification:
| Status | Action |
|---|---|
| Active, needed, undocumented | Document, add to gateway, secure, test |
| Active, needed, documented | Verify security, ensure monitoring |
| Active, not needed (zombie) | Decommission immediately |
| Development/debug endpoint in production | Remove immediately |
| Legacy endpoint with dependencies | Plan migration, secure in the interim |
Step 3: Route Through API Gateway
Every API endpoint must route through your API gateway. The gateway enforces authentication, authorisation, rate limiting, logging, and monitoring consistently. APIs bypassing the gateway bypass all these controls.
Step 4: Apply Security Controls
For every shadow API being kept, implement authentication (no unauthenticated endpoints in production), authorisation (BOLA/BFLA testing on every endpoint), rate limiting, input validation, output filtering, and logging. Follow API security best practices.
Step 5: Decommission What's Not Needed
Every unnecessary API endpoint is unnecessary attack surface. Zombie APIs, debug endpoints, abandoned integration endpoints, and legacy version endpoints that no client depends on should be decommissioned. Test before decommissioning (monitor traffic to confirm nothing depends on the endpoint).
Step 6: Implement Ongoing Discovery
Shadow APIs form continuously as development continues. Implement continuous API discovery as part of your attack surface management programme. Run discovery quarterly at minimum. Integrate API inventory checks into CI/CD pipelines. Alert when new undocumented endpoints appear.
Step 7: Test Regularly
Include shadow API discovery in every penetration testing engagement. Testers should actively search for undocumented endpoints, not just test documented APIs. Continuous penetration testing discovers new shadow APIs as they emerge between annual assessments.
Shadow APIs and Compliance
Shadow APIs create compliance violations because unmonitored endpoints processing regulated data exist outside compliance controls.
PCI DSS. Shadow APIs accessing cardholder data outside the defined CDE boundary expand PCI scope uncontrolled. Undocumented endpoints don't receive required logging, encryption, or access controls. See our PCI DSS guide.
SOC 2. Shadow APIs outside the SOC 2 system boundary create uncontrolled data access paths. Auditors finding undocumented endpoints accessing in-scope data generate findings. See our SOC 2 guide.
GDPR. Shadow APIs processing personal data without documented purpose, security controls, or monitoring violate Article 32 security requirements. See our GDPR guide.
ISO 27001. Annex A.8.9 (Configuration Management) requires that all assets are identified and managed. Shadow APIs are unmanaged assets. See our ISO 27001 guide.
For comprehensive compliance mapping, see our penetration testing compliance guide.
Shadow API Discovery Checklist
Passive Discovery
- Network traffic analysed for undocumented API endpoints
- Load balancer and web server logs reviewed for unknown paths
- API gateway routes compared against code-defined endpoints
- DNS enumeration completed for API-related subdomains
- Cloud resource inventory queried for undocumented services
- Certificate transparency logs checked for unknown API domains
Active Discovery
- Common API path wordlists tested against all domains
- Frontend JavaScript analysed for hardcoded API URLs
- Mobile application decompiled for API endpoint references
- Source code searched for route/endpoint definitions
- Older API versions tested (v1, v2 alongside current)
- Internal path prefixes tested (/internal/, /admin/, /debug/, /test/)
- Error messages analysed for internal endpoint disclosure
Classification
- Every discovered endpoint classified (active/zombie/development)
- Data access mapped for each endpoint
- Authentication status verified for each endpoint
- Rate limiting status verified for each endpoint
- Logging status verified for each endpoint
- Gateway routing verified for each endpoint
Remediation
- Zombie APIs decommissioned
- Debug/development endpoints removed from production
- Shadow APIs added to API inventory and gateway
- Authentication applied to all production endpoints
- Rate limiting applied to all endpoints
- Logging enabled for all endpoints
- Ongoing discovery programme implemented
Shadow APIs in Different Architectures
Microservices
Microservice architectures create the most shadow APIs because each service exposes its own endpoints. Service mesh configurations, sidecar proxies, and container networking can expose internal service endpoints externally. Cloud penetration testing should evaluate service exposure.
Serverless
Lambda functions, Azure Functions, and Cloud Functions each create API endpoints through API Gateway, ALB, or function URLs. Serverless shadow APIs form when developers create functions with direct invocation URLs bypassing the API gateway, or when function URLs are enabled for testing and never disabled.
GraphQL
GraphQL's single-endpoint architecture reduces shadow API count but introduces a different problem: shadow fields and queries. The GraphQL schema may expose types and mutations the frontend never uses but that are accessible through introspection or schema probing. This is shadow functionality within a known endpoint. See our API security testing guide.
Legacy and Hybrid
Organisations with legacy systems alongside modern architectures have the highest shadow API risk. Old SOAP services, legacy REST endpoints, and custom integrations persist alongside new microservices. Nobody has a complete map of both worlds.
Preventing Shadow API Formation
API Governance
Establish a policy requiring all API endpoints to be registered in the API inventory before deployment. API creation follows a defined process including security review, gateway registration, and documentation.
CI/CD Pipeline Controls
Implement automated checks in the deployment pipeline that compare deployed endpoints against the API inventory. Alert or block deployments introducing endpoints not in the registry.
Secure Development Practices
Train developers that debug endpoints, test utilities, and internal tools must be removed before production deployment. Code review checklists include verification that no unintended endpoints ship to production.
Regular API Audits
Quarterly API audits comparing the official inventory against actual deployed endpoints. Discrepancies investigated immediately. Security audit frequency should include API inventory validation.
How AppSecure Finds Shadow APIs
AppSecure's API penetration testing includes dedicated shadow API discovery as part of every engagement.
Active Discovery. Endpoint brute-forcing, JavaScript analysis, version probing, subdomain enumeration, and cloud resource scanning identify undocumented APIs automated tools miss.
Manual Testing Depth. Manual penetration testing discovers shadow APIs through adaptive techniques: error message analysis, header inspection, and creative path probing. Human testers find what scanners can't.
Complete API Testing. Every discovered endpoint, documented and shadow, receives full API security testing: BOLA/BFLA, authentication bypass, injection, rate limiting, and data exposure. API security best practices validated across the complete API surface.
Full-Stack Coverage. API testing integrates with web application, cloud, network, and mobile testing. Application security assessment and offensive security testing for end-to-end validation.
Zero False Positives. Every shadow API finding includes the endpoint URL, what data it exposes, and exploitation evidence. 3-Week Delivery. 90-day support. Complimentary retesting. Continuous testing and PTaaS for ongoing shadow API discovery.
Contact AppSecure:
Frequently Asked Questions
1. What are shadow APIs?
Shadow APIs are API endpoints that exist in an organisation's environment but aren't documented in the official API inventory, aren't managed through the API gateway, and aren't monitored by the security team. They form when developers create endpoints for testing, debugging, internal tooling, or third-party integrations without going through the API management process. Shadow APIs process real data without authentication, rate limiting, or monitoring, making them the highest-risk component of the API attack surface.
2. What is the difference between shadow APIs and zombie APIs?
Shadow APIs were never documented. They were created outside the API management process and exist entirely outside official inventory. Zombie APIs were once documented and managed but have been deprecated or abandoned without being decommissioned. The documentation was removed but the endpoint still responds. Both are dangerous because neither receives security updates, monitoring, or testing. Shadow APIs are harder to find because no historical record of their existence exists.
3. How common are shadow APIs?
Organisations typically discover 30% to 60% more APIs than they knew about when first conducting comprehensive API discovery. A company with 100 documented APIs commonly has 150 to 200 actual endpoints. Shadow APIs form continuously as developers create new endpoints, microservices proliferate, and third-party integrations are added. Without ongoing discovery, the shadow API count grows steadily.
4. Why are shadow APIs dangerous?
Shadow APIs typically lack authentication (anyone can access them), authorisation (no IDOR/BOLA checks), rate limiting (unlimited request volume), monitoring (no logging or alerting), and security testing (excluded from pentest scope because nobody knows they exist). They often have direct database access with overprivileged credentials and run outdated code with unpatched vulnerabilities. Attackers specifically hunt for shadow APIs because they know these endpoints have the weakest controls.
5. How do attackers find shadow APIs?
Attackers use version probing (testing /v1/, /v2/ alongside documented /v3/), subdomain enumeration (discovering api-dev, internal-api, mobile-api subdomains), path brute-forcing (testing common paths like /admin/, /debug/, /internal/), JavaScript analysis (extracting API URLs from frontend code and mobile apps), and error message analysis (error responses revealing internal endpoint paths). These techniques discover endpoints the organisation doesn't know are exposed.
6. How do I discover shadow APIs in my environment?
Combine passive methods (traffic analysis, log review, DNS enumeration, cloud inventory, API gateway route comparison) with active methods (endpoint brute-forcing, JavaScript analysis, mobile app decompilation, source code search). Run discovery quarterly at minimum. Include shadow API discovery in every penetration testing engagement. Implement continuous discovery through attack surface management.
7. How do I prevent shadow APIs from forming?
Establish API governance requiring all endpoints to be registered before deployment. Implement CI/CD pipeline checks comparing deployed endpoints against the API inventory. Include endpoint verification in code review checklists. Train developers to remove debug and test endpoints before production deployment. Conduct quarterly API audits comparing inventory against actual deployed endpoints.
8. How does API penetration testing find shadow APIs?
API penetration testers actively search for undocumented endpoints through creative discovery: testing older API versions, probing internal path prefixes, analysing error messages for endpoint hints, inspecting response headers for backend service information, decompiling mobile apps for API references, and scanning for common development and debug paths. Human testers adapt based on what they discover, finding shadow APIs that automated scanning tools miss.
9. Do shadow APIs affect compliance?
Yes. Shadow APIs processing regulated data exist outside compliance controls. PCI DSS: shadow APIs accessing cardholder data expand the CDE uncontrolled. SOC 2: undocumented endpoints create uncontrolled data access paths. GDPR: APIs processing personal data without documented purpose violate security requirements. ISO 27001: unmanaged assets violate configuration management requirements. Shadow API discovery is essential for accurate compliance scoping.
10. How often should shadow API discovery be conducted?
Quarterly discovery at minimum. After organisational changes (acquisitions, team restructuring). After infrastructure changes (cloud migrations, architecture redesign). After major development milestones (new product features, new integrations). Continuously through attack surface management tools for external shadow APIs. Include shadow API discovery in every annual penetration testing engagement. Organisations with rapid development cycles should discover monthly.

Vijaysimha Reddy is a Security Engineering Manager at AppSecure and a security researcher specializing in web application security and bug bounty hunting. He is recognized as a Top 10 Bug bounty hunter on Yelp, BigCommerce, Coda, and Zuora, having reported multiple critical vulnerabilities to leading tech companies. Vijay actively contributes to the security community through in-depth technical write-ups and research on API security and access control flaws.






















.webp)




_%20Examples%2C%20Impact%20%26%20How%20to%20Fix%20Them.webp)


_.webp)




















%20Tools%20vs%20Penetration%20Testing.webp)












.webp)







































.webp)
