/

CVE-2026-28216

Severity:

HIGH RISK

(8.3)

Insecure Direct Object Reference (IDOR) in Hoppscotch User

CVE-2026-28216

Analyzed

Vulnerability type

Category:

Insecure Direct Object Reference (IDOR)

CWE:

CWE-639

Impact:

Unauthorized Access to Sensitive Data and Modification/Deletion of User Resources

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Hoppscotch versions prior to 2026.2.0 contain an access control flaw that allows any authenticated user to read, modify, or delete another user's personal environment using only the environment ID.

Because ownership is not enforced at the data access layer, an attacker who obtains a valid environment ID can access API keys, auth tokens, and other secrets stored in that environment.

Affected context

This vulnerability occurs in Hoppscotch's GraphQL API handling user environments, specifically in operations that update or delete user environment records.

The affected paths rely on a valid environment identifier (CUID) but do not consistently enforce that the caller actually owns the targeted environment.

As a result, in deployments where users can discover or infer other environment IDs—through logs, collaboration workflows, or information leaks—cross-tenant access to sensitive configuration data becomes possible.

Exploit preconditions

  • Attack surface: Hoppscotch backend GraphQL API endpoints handling updateUserEnvironment and deleteUserEnvironment.
  • Required access: The attacker must be an authenticated user of the Hoppscotch instance.
  • Identifier knowledge: The attacker needs the CUID of a target user's environment, obtained through guesswork, logging artifacts, link sharing, or other information disclosure.
  • Trigger point: Submitting GraphQL mutations using the victim's environment ID, which are then processed without a proper ownership constraint in the database query.
  • Why exploitation is possible: The service uses queries like prisma.userEnvironment.update({ where: { id } }) and delete with only id in the where clause, omitting userUid or equivalent ownership filters, so authorization is not tied to the resource owner.

Why this happens

The underlying issue is a broken object-level authorization pattern, mapping directly to CWE-639: Insecure Direct Object Reference.

Although authentication is enforced via @UseGuards(GqlAuthGuard), the resolver never binds the operation to the authenticated user when performing the database update/delete.

In updateUserEnvironment, the resolver omits the @GqlUser() decorator, so the service never learns which user is making the request and uses only the supplied id.

In deleteUserEnvironment, the user is extracted but not incorporated into the WHERE clause, so the query still targets any record with the given id.

Abstractly, the pattern is: accepting a user-supplied identifier for a multi-tenant resource, then performing data operations keyed only on that identifier, without verifying that it belongs to the caller.

Potential impact

  • Unauthorized reading of another user's API keys, auth tokens, and other confidential secrets stored in environments.
  • Silent modification of environment variables to malicious values, enabling request hijacking, data exfiltration, or account takeover in downstream systems.
  • Deletion of other users' environments, resulting in loss of configuration and disruption of their workflows.
  • Lateral movement within an organization by abusing internal API credentials found in compromised environments.
  • Facilitation of broader supply-chain or integration attacks by tampering with secrets used to access third-party services.

General mitigation guidance

Effective mitigation focuses on enforcing strong, resource-level authorization and removing trust in client-supplied identifiers alone.

Recommended patterns include:

  • Always deriving the acting user from the authenticated context (e.g., via a decorator or middleware), not from request parameters.
  • Enforcing ownership checks at the data layer by including the user identifier in all WHERE clauses for user-specific resources (e.g., WHERE id = :id AND userUid = :user).
  • Centralizing authorization logic (e.g., service-layer helpers, policies) so that access checks are not reimplemented ad hoc in each resolver or controller.
  • Using explicit multi-tenant scoping in the ORM or query builder, such as tenant-aware repositories that automatically scope queries to the current user.
  • Minimizing exposure of raw internal IDs, or using additional scoping tokens where feasible, to reduce the impact of ID leakage.

How teams detect issues like this

To detect this class of issue, organizations can:

  • Perform static code analysis looking for data-access calls on multi-tenant tables that filter only by primary key/ID, without user or tenant qualifiers.
  • Review GraphQL resolvers, controllers, and services for patterns where authenticated context is not used in authorization or is retrieved but not applied to queries.
  • Implement security-focused code review checklists requiring explicit verification that every user-specific resource access is bound to the requesting user.
  • Add automated tests that attempt cross-user access (e.g., use environment IDs from one test user in requests authenticated as another) to catch IDOR regressions.
  • Use policy-as-code or authorization frameworks (e.g., attribute-based access control) that make it easier to declaratively define and validate object-level permissions.

Sources

SourceLink
github.comgithub.com/hoppscotch/hoppscotch/releases/tag/2026.2.0
github.comgithub.com/hoppscotch/hoppscotch/security/advisories/GHSA-72rv-vc3j-5vqr

Frequently asked

questions

Yes, if the Hoppscotch instance is exposed over the internet, any authenticated remote user who can obtain another user's environment ID can exploit the issue via the GraphQL API.

No. Only standard authenticated access is required; the flaw lies in missing ownership enforcement, not in administrative permissions.

Tie every environment operation to the authenticated user by consistently extracting the user from the auth context and ensuring all queries include both the environment ID and the user identifier (or tenant identifier) in the WHERE clause.

Adopt a strict object-level authorization model, centralize authorization checks, enforce multi-tenant scoping at the data access layer, and add automated tests and static checks specifically looking for ID-only queries on user-owned resources.

Find out what's already
exploitable in your codebase.