Summary
Hoppscotch exposes sensitive infrastructure configuration secrets in plaintext via an unauthenticated GET /v1/onboarding/config endpoint when the ONBOARDING_RECOVERY_TOKEN stored in the database is an empty string.
Under these conditions, any network-accessible, unauthenticated requester can retrieve deployment secrets intended to be protected by onboarding state and recovery token checks.
Affected context
This issue affects Hoppscotch deployments that:
- Enable the onboarding flow and store onboarding configuration in the backend
- Rely on ONBOARDING_RECOVERY_TOKEN for protecting onboarding-related access
- Are reachable over a network (e.g., public internet, internal VLAN, or VPN)
The vulnerability is triggered specifically when the ONBOARDING_RECOVERY_TOKEN persisted in the database is an empty string, causing the GET /v1/onboarding/config endpoint to skip effective access control and return sensitive configuration values in plaintext to any caller.
Exploit preconditions
- Attack surface: HTTP(S) API, specifically GET /v1/onboarding/config
- Required access: Network reachability to the Hoppscotch API; no authentication required
- Configuration condition: The ONBOARDING_RECOVERY_TOKEN value in the database is an empty string
- Trigger point: Issuing an unauthenticated GET request to /v1/onboarding/config while onboarding recovery token checks do not enforce a non-empty secret
- Why exploitation is possible: The endpoint performs insufficient authorization logic tied to a token that can be empty, effectively disabling access control and allowing unrestricted disclosure of onboarding configuration and associated secrets.
Why this happens
The vulnerability stems from incomplete enforcement of authorization and authentication semantics around the onboarding configuration endpoint.
While the POST /v1/onboarding/config path was updated to validate onboardingCompleted and canReRunOnboarding, the GET /v1/onboarding/config endpoint still relies on ONBOARDING_RECOVERY_TOKEN in a way that permits an empty string to satisfy or bypass checks.
This maps to CWE-284: Improper Access Control, where resources are exposed without ensuring that the caller is authorized, and is closely related to CWE-287: Improper Authentication, since the system treats an empty or missing credential as effectively valid.
At a higher level, the design couples sensitive secret retrieval to a configuration flag and token that are not strictly validated, allowing untrusted callers to read secrets that should only be accessible after secure onboarding and authenticated access.
Potential impact
- Disclosure of API keys, database credentials, or other infrastructure secrets configured during onboarding
- Unauthorized access to dependent services such as databases, queues, or third-party APIs using leaked credentials
- Lateral movement within the hosting environment by reusing compromised secrets in other systems
- Full compromise of the Hoppscotch deployment configuration, including environment-specific endpoints and tokens
- Facilitation of further attacks such as data exfiltration, service impersonation, or persistent backdoor creation in related infrastructure
General mitigation guidance
Mitigation generally focuses on enforcing strict access control on configuration endpoints and eliminating reliance on weak or nullable tokens for authorization.
Recommended patterns include:
- Treat all configuration and onboarding endpoints as sensitive, requiring authenticated and authorized access by default
- Validate that any token or credential used for onboarding or recovery is non-empty, random, and cryptographically strong, and reject requests when the token is absent or invalid
- Separate "recovery" and "read secrets" capabilities from initial onboarding, ensuring that reading secrets always requires authenticated administrative context
- Minimize the amount of secret material ever returned from APIs; where possible, avoid returning secrets after initial provisioning
- Store secrets in a dedicated secrets manager and gate retrieval behind role-based access control, rather than generic onboarding state flags
- Apply the principle of least privilege to the application's runtime environment so that leaked configuration does not automatically grant unrestricted infrastructure access
How teams detect issues like this
Detection efforts can focus on both code-level patterns and runtime behavior:
- Static analysis and code review:
- Flag endpoints that return configuration objects or environment variables without explicit authorization checks
- Look for authorization conditions that depend on nullable or default-able values (such as empty strings) representing tokens or secrets
- Identify uses of onboarding or recovery tokens where validation does not verify presence, format, and integrity
- Policy enforcement:
- Enforce service-wide policies that all endpoints under paths like /v1/onboarding, /config, or /admin require authentication and role checks
- Use API gateway or reverse proxy rules to restrict unauthenticated access to configuration-related routes
- Runtime monitoring:
- Monitor logs for unexpected unauthenticated requests to onboarding or configuration endpoints
- Configure anomaly detection for spikes in GET calls to sensitive endpoints, especially from external IP addresses
- Automated tooling:
- Incorporate API security scanners and DAST tools to test for unauthenticated access to configuration and secret-bearing endpoints as part of CI/CD pipelines

