Summary
Hoppscotch mock server creation previously failed to persist the isPublic access flag, while the underlying schema defaulted this field to true.
As a result, mock servers tied to private collections could become publicly accessible without authentication, risking exposure of sensitive API data whenever private mocks were created or managed.
Affected context
This vulnerability appears in Hoppscotch deployments where mock servers are used to expose or test API behavior via collections.
It affects workflows in which:
- Collections are marked private or assumed to be restricted
- Mock servers are created or linked from those private collections
- Access control relies on the
isPublicflag being correctly persisted and enforced
Under these conditions, mismatched defaults and missing field persistence can inadvertently make private mock endpoints accessible to any unauthenticated user.
Exploit preconditions
- Attack surface: HTTP endpoints provided by Hoppscotch mock servers
- Required access: Network access to the mock server URLs; no authentication is required when
isPublicis effectively treated astrue - Trigger point: Accessing mock server endpoints that are expected to be private but were created without correctly persisting the
isPublicflag - Why exploitation is possible: The service layer does not store the
isPublicinput while the database schema defaults to public, leading to a mismatch between user intent (private collections) and actual enforcement (public mock servers)
Why this happens
The core issue is an access control misconfiguration stemming from inconsistent handling of authorization metadata between the application logic and the data model.
Specifically, the mock-server service neglects to persist the isPublic field provided by the user, while the Prisma schema defaults isPublic to true. This design causes newly created mock servers to be public even when they belong to private collections.
This maps to CWE-284: Improper Access Control and CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, as authorization state is assumed rather than explicitly stored and enforced, resulting in unintended data exposure.
Potential impact
- Private mock APIs may be reachable by any unauthenticated user
- Sensitive request/response samples and API schemas could be exposed
- Leakage of internal service names, endpoints, or debugging data can aid further attacks
- Violation of data protection or confidentiality policies due to unintended public access
General mitigation guidance
A robust mitigation strategy centers on making access control explicit, consistent, and secure-by-default.
Common defensive patterns include:
- Ensuring that all access control flags (such as
isPublic) are persisted and validated at every layer: UI, service, and database model - Avoiding permissive defaults; treat new resources as private unless clearly marked otherwise
- Implementing centralized authorization checks that derive access from a single, authoritative source of truth
- Designing APIs so that collection privacy and mock-server visibility cannot diverge without explicit administrative action
- Incorporating defense-in-depth controls such as token-based access or IP restrictions for mock endpoints that may contain sensitive data
How teams detect issues like this
Organizations can detect similar access control issues by:
- Reviewing API and service code for fields that influence authorization but are not consistently persisted or checked
- Using static analysis or schema validation to flag mismatches between model defaults and business logic expectations
- Implementing automated tests that verify private collections never yield publicly reachable mock endpoints
- Adding policy-based checks in CI/CD pipelines to ensure that security-related flags have conservative defaults and clear enforcement points
- Periodically scanning mock server URLs and access logs to identify endpoints that are publicly accessible but associated with private or sensitive content

