API Endpoint Exposure
APIs power modern web applications, but improperly secured API endpoints can expose sensitive data or allow unauthorised actions. Common issues include unprotected endpoints, exposed Swagger/OpenAPI docs, missing authentication, and APIs that return more data than necessary.
What SecurityStatus Checks
- Common API paths: /api, /api/v1, /graphql, /swagger, /api-docs, /openapi.json
- Whether API documentation endpoints (Swagger UI, GraphQL introspection) are publicly accessible
- Whether API endpoints return sensitive data without authentication
- CORS configuration on API endpoints
Why This Matters
Exposed API documentation tells attackers exactly how your API works — every endpoint, parameter, and response format. GraphQL introspection, when left enabled in production, reveals your entire data model. Unprotected API endpoints allow data extraction at scale without triggering traditional web application firewalls.
How to Fix It
- 1
Require authentication on all sensitive endpoints
Every endpoint that accesses user data or performs actions must require authentication. Use JWT tokens, API keys, or session cookies — but never leave endpoints that return user data accessible without auth.
- 2
Disable GraphQL introspection in production
GraphQL introspection returns your entire schema to any caller. Disable it in production: in Apollo Server, set `introspection: false` in production environments. Developers can still use introspection locally.
- 3
Restrict Swagger/OpenAPI UI
If you expose API documentation, put it behind authentication or restrict it to internal network access. API docs are valuable for your developers but are a roadmap for attackers.
- 4
Apply rate limiting to all API endpoints
Even authenticated endpoints need rate limiting to prevent automated data scraping. Implement rate limits at the API gateway or web server level based on IP, API key, or user account.
Frequently Asked Questions
Should I expose my API documentation publicly?
What is BOLA/IDOR and how do I prevent it?
Is GraphQL less secure than REST?
Related Guides
Check Your Domain Now
Run all 38 security checks including API Endpoint Exposure and get your domain's security grade in under 2 minutes.
Scan Your Domain Free