Security Notice: OpenAPI Schema Public Accessibility (SCR-22)
Security Notice: OpenAPI Schema Public Accessibility (SCR-22)
Version introduced: v1.0.98
Control reference: SCR-22
Category: Competitive Exposure
Overview
During a supply chain security review, it was confirmed that two API endpoints are publicly accessible without authentication:
| Endpoint | Type | Public? |
|---|---|---|
/api/v1/docs | Human-readable API documentation | ✅ Yes |
/api/v1/openapi.json | Machine-readable OpenAPI schema | ✅ Yes |
Both routes are covered by the isPublic allowlist in middleware.ts. The /api/v1/openapi.json endpoint additionally responds with Access-Control-Allow-Origin: *, making it accessible from any origin via cross-origin requests.
What is exposed
The OpenAPI JSON schema includes:
- All API endpoint paths
- Request and response field names and data types
- Available contact categories (e.g. Seller, Landlord, Buy-to-Let Investor, Active Tenant)
- Pagination mechanisms
- CRM integration patterns and data structures
This information is sufficient for a third party to reconstruct a detailed picture of the platform's data model and integration surface without holding a valid API key or account.
Current status
Public access to /api/v1/docs is likely intentional — CRM integration partners (agentOS, Reapit, Alto, Street, Loop) need a stable reference to implement and maintain their integrations.
Public access to /api/v1/openapi.json (the machine-readable schema) is the higher-risk surface because it is trivially consumable by automated tooling and provides field-level detail beyond what a human-readable page offers.
Recommended actions
Option A — Accept public access, reduce discoverability
If public schema access is a deliberate business decision:
- Document the decision explicitly so it is not re-raised in future security reviews.
- Add a
robots.txtdisallow rule for/api/v1/to prevent search engine indexing:
User-agent: *
Disallow: /api/v1/
Option B — Restrict the machine-readable schema
If the full OpenAPI JSON should not be freely accessible:
- Remove
/api/v1/openapi.jsonfrom theisPublicallowlist inmiddleware.ts. - Require a valid API key in the
Authorizationheader to access the schema, or restrict to an IP/token allowlist of known CRM partners. - Keep
/api/v1/docspublic if human-readable documentation is still intended to be open.
Example middleware change (conceptual):
// middleware.ts
const isPublic = [
'/api/v1/docs', // keep public for CRM developers
// '/api/v1/openapi.json' — removed; now requires API key
];
Option C — Full authentication for both endpoints
Require authentication (API key or OAuth token) for both /api/v1/docs and /api/v1/openapi.json. This provides the strongest protection but may increase friction for new CRM integration partners onboarding.
Affected file
src/app/api/v1/openapi.json/route.ts
References
- Internal control: SCR-22
- Supply chain review category: competitive_exposure
- Middleware configuration:
middleware.ts—isPublicallowlist