Security Risks Identified Through API Specifications
I've been digging into API security incidents and research lately, and there's a consistent pattern: the specification itself is an attack surface. Not the API implementation the documentation of it. Here's what the evidence shows.
Exposed Swagger/OpenAPI Specs Are Actively Hunted
SANS Internet Storm Center tracks scanning activity against common spec paths. As of mid-2026, /swagger.json alone had logged over 32,000 requests from attackers, with /api/v2/swagger.json at 14,000+ and /swagger/v1/swagger.json at 13,000+. This isn't theoretical—attackers are systematically probing for exposed specs because they know what's inside.
Why? A public Swagger file is essentially a directory listing for your API. It reveals endpoint paths, parameter names, expected data formats, and authentication mechanisms. Attackers don't need to fuzz blindly when you've handed them the blueprint.
2. Real CVEs Have Been Assigned for Spec Exposure
This isn't just "best practice" hand-wringing. CVE-2026-21759 was assigned to HCL Hive for publicly exposed Swagger documentation. The analysis notes that even without credentials or PII in the docs, exposure "allows unauthenticated users to enumerate the application's functional capabilities" and "reduces the effort required for an attacker to craft malicious requests".
A separate critical CVE (CVE-2026-22237, CVSS critical) affected BLUVOYIX due to "exposure of sensitive internal API documentation," allowing unauthenticated attackers to abuse internal functionality via crafted requests.
3. CloudSEK Found Live Specs + Tokens in the Wild
A 2025 audit of a semiconductor company found publicly accessible Swagger UI files and Postman workspaces with authentication tokens still attached. The spec exposure alone was bad enough—combined with leaked tokens, attackers had both the map and the keys.
The remediation advice was blunt: keep internal documentation private, remove tokens from public tools, and assume any doc might accidentally become public.
4. The Bigger Problem: Spec-Based Scanning Creates False Confidence
Here's where it gets uncomfortable. Most teams that do scan their APIs do it against the OpenAPI spec. But Radware's research argues this is fundamentally inadequate:
"OpenAPI/Swagger files are merely documentation artifacts describing intent. The runtime system is a living entity. Endpoints are added without spec updates, internal service-to-service routing is undocumented, and old versions long officially deprecated remain active."
The numbers cited: a spec might claim 47 endpoints while 112 exist in live traffic. Shadow APIs are the norm, not the exception.
More critically: the vulnerabilities that actually get exploited—BOLA, broken authentication, chained business logic bypasses—cannot be found by stateless spec-based scanning. BOLA requires maintaining session state across multiple users, understanding role boundaries, and replaying multi-step flows. A scanner that doesn't do that will never surface it.
5. OWASP Confirms: Inventory Management (Spec Accuracy) Is a Top 10 Risk
OWASP's API Security Top 10 (2023) includes API9:2023 – Improper Inventory Management, which directly implicates spec drift. The description: "APIs tend to expose more endpoints than traditional web applications, making proper and updated documentation highly important... deprecated API versions and exposed debug endpoints" are key risks.
The Optus breach (11.2 million customer records exposed, A$140 million set aside) was attributed to an unmanaged API vulnerability—exactly the kind of thing that proper inventory (and accurate specs) should catch.
What This Means for Defenders
A few practical takeaways from the research:
Treat your spec as sensitive by default. Gate /swagger.json, /openapi.json, and /docs behind auth or IP allowlists. If it's public, assume it's been catalogued.
Reconcile spec against runtime. The spec says what should exist. Traffic capture says what does exist. The delta is where shadow APIs live.
Don't confuse spec compliance with security. One research thread put it well: "The spec passes review, the implementation passes the spec, but the gap between what is required and what is safe becomes an attack surface".
Scan with context. BOLA and business logic flaws require stateful, multi-identity testing—not static spec analysis.

p/mindpal-ai
p/meridian-16
p/runevr
p/many-displays
p/burnlink
p/classroomio
p/teaserkit
p/reso
p/pushary
p/dots-7
p/producthunt
p/citable
p/kodlo
p/faraday-4
p/clipjack
p/neoagent
p/temp-mail-370
p/leantake
p/iphotron
p/comcent
Replies
Be the first to reply
Have a question or a thought to share? Add a comment above to start the conversation.