Back to Blog
2026-03-28

Shadow APIs: The Invisible 10-20% That Will Breach You

Organizations have 10-20% more active APIs than they know about. These shadow APIs bypass security controls, lack authentication, and become the perfect entry points for attackers.

Shadow APIs: The Invisible 10-20% That Will Breach You

Critical: 40,000+ API Attacks in 6 Months

Last month, a Reddit post in r/sysadmin went viral for all the wrong reasons: "Just found out we had 200+ shadow APIs after getting pwned. During forensics they found over 200 undocumented APIs in prod that nobody knew existed."

This isn't a rare occurrence. Security researchers consistently find that organizations typically have 10-20% more active APIs than they are aware of. In an era where 48,185 CVEs were published in 2025—a 20.6% year-over-year increase—and API attack incidents exceeded 40,000 in just six months, these invisible endpoints aren't just technical debt. They're an unguarded backdoor.

⚠️ The Discovery Problem

Shadow APIs aren't just "forgotten" endpoints. They're actively maintained code paths that bypass your API gateway, evade your WAF rules, and operate outside your authentication policies. When your security team runs a penetration test against what they think is your entire API surface, they're actually testing 80-90% of reality.

Where Shadow APIs Come From

Shadow APIs aren't created by malicious actors—they emerge from legitimate development practices that outpace security visibility:

Microservice Proliferation: A developer spins up a new service for a marketing campaign. It lives for three months, serves its purpose, but never gets catalogued. The service keeps running because shutting it down "might break something."

Direct Deployments: Engineers with cloud access deploy APIs directly to infrastructure, bypassing the API gateway "just for testing." The test endpoint gains production traffic because it's faster than routing through the corporate gateway.

Third-Party Integrations: Your CRM has an undocumented webhook endpoint. Your payment processor calls a callback URL that isn't in your API documentation. These integrations create API surface area your team never designed.

Version Drift: Version 1 of your API deprecates, but three mobile apps still use it. Version 2 introduces new endpoints that security never reviewed. Version 3 launches as a "soft release" without documentation. You now maintain three versions of reality.

10-20%
More APIs exist than security teams know about
48,185
CVEs published in 2025 (20.6% increase)
40,000+
API attack incidents in 6 months
1,800+
AI apps running on enterprise devices (CrowdStrike)

Why Attackers Love Shadow APIs

From an attacker's perspective, shadow APIs are Christmas morning. Here's what they're looking for:

Missing Authentication: Shadow APIs often predate your centralized auth service. They accept API keys that were rotated two years ago. They validate JWTs against a signing key that no longer exists in your infrastructure. An attacker with a 2019 API key from a leaked log file discovers it still grants admin access through an endpoint your security team doesn't know exists.

Outdated Dependencies: These forgotten endpoints run on frameworks with known CVEs. The shadow API handling file uploads still uses a vulnerable image processing library because "upgrading broke something in 2021 and we never got back to it."

Debug Endpoints: Internal APIs often ship with /debug, /admin, or /health endpoints that expose stack traces, environment variables, or raw database connections. When these aren't in your API gateway rules, they bypass rate limiting and logging.

Data Escalation Paths: A shadow API designed for internal use might accept user IDs without validation. The attacker who discovers it can iterate through IDs and extract data that your public API would never expose.

Real-World Exploitation Pattern

Attackers don't need sophisticated zero-days when shadow APIs exist. A common pattern: harvest subdomain certificates using certificate transparency logs, fuzz endpoints with common paths like /api/v1/, /api/v2/, /internal/, or /admin/, then look for responses that don't match your public API gateway's behavior. Shadow APIs often return different error formats, missing CORS headers, or verbose stack traces that give attackers a map of your internal infrastructure.

Discovering Your Shadow APIs

You can't secure what you can't see. Here's how to start inventorying your actual API surface:

1. Passive Discovery Through Traffic Analysis

Monitor your network at the edge. API calls that bypass your gateway will still hit your load balancer or ingress controller. Parse access logs for paths not in your catalog:

import re
from collections import Counter

KNOWN_PATHS = {'/api/v2/users', '/api/v2/orders', '/health', '/metrics'}

def discover_apis_from_logs(log_file):
    """Parse access logs to find undocumented API paths."""
    api_pattern = r'(GET|POST|PUT|DELETE|PATCH)\s+(/[^\s]+)'
    discovered_paths = Counter()
    
    with open(log_file, 'r') as f:
        for line in f:
            match = re.search(api_pattern, line)
            if match:
                path = match.group(2).split('?')[0]  # Strip query params
                discovered_paths[path] += 1
    
    # Filter out known paths
    shadow_candidates = {
        path: count for path, count in discovered_paths.items()
        if path not in KNOWN_PATHS and count > 100  # Threshold for significance
    }
    
    return sorted(shadow_candidates.items(), key=lambda x: x[1], reverse=True)

# Usage: mystery_apis = discover_apis_from_logs('/var/log/nginx/access.log')

2. Infrastructure as Code Scanning

Your APIs are defined somewhere—Terraform, Kubernetes manifests, CloudFormation. Scan these for API definitions that don't appear in your gateway configuration:

# Find ingress/controllers not referenced in your API gateway
kubectl get ingress --all-namespaces -o json | \
  jq '.items[] | select(.metadata.annotations."kubernetes.io/ingress.class" != "kong") | 
      {namespace: .metadata.namespace, host: .spec.rules[0].host}'

3. Runtime Discovery with eBPF

Modern API discovery tools use eBPF to capture API traffic at the kernel level, creating an inventory from actual runtime behavior rather than declared configuration.

4. Certificate Transparency Log Monitoring

New subdomains often host new APIs. Monitor certificate transparency logs for certificates issued to your domain:

# Query crt.sh for subdomains discovered via certificate transparency
curl -s "https://crt.sh/?q=%.yourcompany.com&output=json" | \
  jq -r '.[].name_value' | sort | uniq

5. Cloud API Inventory

If you're hosting on AWS, use CloudTrail to identify API Gateway stages, Lambda function URLs, and AppSync endpoints that don't match your inventory:

# List all API Gateway deployments across regions
aws apigateway get-rest-apis --region us-east-1
aws apigatewayv2 get-apis --region us-east-1  # For HTTP/WebSocket APIs

# Find Lambda function URLs (potential shadow APIs)
aws lambda list-functions --query 'Functions[?FunctionUrlConfig != null].{Name:FunctionName,Arn:FunctionArn}'

Remediation: From Discovery to Governance

Finding shadow APIs is only step one. Here's how to actually fix the problem:

Immediate Actions:

  1. Categorize each shadow API: Is it production traffic? Is it authenticated? What data does it access?

  2. Document the API in your gateway or service catalog—even if it's slated for deprecation. If you can't destroy it immediately, at least monitor it.

  3. Apply baseline security: Even if the API is "temporary," add authentication, rate limiting, and logging. Shadow APIs that can't be deprecated immediately need the same protection as your public surface.

Long-term Governance:

  1. Infrastructure Policy as Code: Use Open Policy Agent (OPA) or Sentinel to block deployments that don't route through your API gateway. This isn't bureaucratic overhead—it's how you prevent the next shadow API from being born.

  2. Automated Discovery Pipelines: Run weekly scans that compare your infrastructure state against your API catalog. Flag any discrepancies for review before they become shadow APIs.

  3. Developer Workflow Integration: Make API registration part of your CI/CD pipeline. If the API isn't in your catalog, the deployment should fail. Period.

  4. Sunset Policies: Every API gets an expiration date. When that date arrives, automatic alerts trigger. If no one claims ownership, the API goes away. Shadow APIs thrive because they have no accountability.

Format JSON Without Data Leaks

Stop pasting sensitive API responses into online formatters. Our client-side JSON tool handles your data locally, with validation and error highlighting.

Open JSON Formatter →

The Bottom Line

Shadow APIs aren't a solved problem—they're a fundamental consequence of how modern development works. Microservices, rapid deployment, and developer autonomy create an environment where APIs proliferate faster than security teams can track.

The good news: shadow API discovery is a solvable problem. The bad news: most organizations discover their shadow APIs the same way—that Reddit sysadmin did. After the breach.

Don't wait for forensics to reveal your actual attack surface. The attackers are already scanning for endpoints without authentication, out of date dependencies, and verbose error messages. If you haven't run a comprehensive API inventory in the last quarter, you almost certainly have shadow APIs. And if you have them, someone's already probing them.

Start your discovery today. Your security posture depends on it.

Share this: