/

CVE-2026-42463

Severity:

HIGH RISK

(8.1)

Insecure Direct Object Reference in SQLBot Data Source

CVE-2026-42463

Analyzed

Vulnerability type

Category:

Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Cross-Tenant Data Access and Modification

Severity:

HIGH RISK

(8.1)

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

SQLBot versions prior to 1.8.0 contain a Cross-Workspace Insecure Direct Object Reference (IDOR) issue in the /api/v1/datasource/exportDsSchema and /api/v1/datasource/uploadDsSchema endpoints.

Under certain conditions, an attacker can access or modify database schemas and data sources belonging to other tenants or workspaces, effectively bypassing tenant isolation and authorization boundaries.

Affected context

This vulnerability arises in multi-tenant SQLBot deployments using the affected REST endpoints:

  • /api/v1/datasource/exportDsSchema
  • /api/v1/datasource/uploadDsSchema

The issue is most relevant where:

  • Multiple tenants or workspaces share the same SQLBot instance
  • Tenant isolation relies on server-side access control checks rather than physically separate infrastructure
  • Clients can supply identifiers (e.g., datasource IDs, workspace IDs, schema handles) to reference resources

In such environments, missing or insufficient checks to ensure that a requested data source or schema belongs to the caller's workspace can expose other tenants' resources.

Exploit preconditions

  • Attack surface: HTTP API endpoints /api/v1/datasource/exportDsSchema and /api/v1/datasource/uploadDsSchema.
  • Required access: Ability to authenticate or otherwise reach these endpoints with any valid account or session in the shared SQLBot deployment.
  • Trigger point: Supplying identifiers for data sources or schemas that belong to a different tenant/workspace than the attacker's own.
  • Why exploitation is possible: The backend logic associates operations with resources using client-supplied identifiers but does not consistently verify that the resource is owned by or linked to the caller's workspace, resulting in an IDOR-style authorization bypass.

Why this happens

The underlying bug fits the pattern described by CWE-639: Authorization Bypass Through User-Controlled Key.

The API trusts client-supplied identifiers (such as data source or workspace IDs) to select backend resources, but it does not reliably enforce that those resources belong to the authenticated principal's tenant or workspace.

Without a strict ownership or tenancy check on every request, users can manipulate identifiers to point to objects outside their scope, breaking isolation between workspaces.

This represents a broader class of insecure object reference and multi-tenant authorization design flaws, where access control decisions are either missing or performed only partially.

Potential impact

  • Exposure of database schema information belonging to other tenants or workspaces.
  • Unauthorized modification or replacement of data source configurations across tenants.
  • Indirect access to underlying databases if altered schemas or data sources are used by SQLBot for queries.
  • Disruption of other tenants' operations by corrupting or misconfiguring their data sources.
  • Facilitation of further attacks, such as data exfiltration or integrity violations, if compromised schemas are used in Text-to-SQL workflows.

General mitigation guidance

Effective mitigation centers on tightening object-level authorization and enforcing tenant isolation consistently.

Common defensive patterns include:

  • Implementing strict ownership checks for every operation that references a data source, schema, or workspace by ID, ensuring it belongs to the caller's tenant or workspace.
  • Deriving workspace or tenant context from the authenticated session or token, not from client-controllable parameters, and using that context when querying backend resources.
  • Applying a consistent access control layer that mediates all CRUD operations on multi-tenant resources rather than ad hoc checks in individual handlers.
  • Minimizing the use of raw identifiers in APIs where possible or using opaque, tenant-scoped identifiers that cannot be meaningfully reused across workspaces.
  • Adopting least-privilege principles so that accounts and tokens only have the minimum necessary permissions for their own workspace.

These patterns reduce the chances that a crafted identifier alone can bypass access control boundaries.

How teams detect issues like this

Detecting similar issues often involves both code-focused and behavior-focused techniques:

  • Static analysis and code review:
  • Look for controller or handler logic where user-supplied IDs (e.g., datasourceId, workspaceId) drive database lookups without a subsequent ownership or tenancy check.
  • Flag any queries that select resources by ID alone, rather than by (tenantId, resourceId) pairs or equivalent scoped constraints.
  • Review middleware and access control layers to ensure they are invoked for the relevant endpoints and enforce per-tenant scoping.
  • Automated policy checks:
  • Introduce architectural linting rules that require all multi-tenant resources to be accessed via tenant-scoped queries.
  • Enforce coding patterns in CI/CD (e.g., require use of a specific repository method that automatically scopes by workspace).
  • Runtime monitoring and testing:
  • Add multi-tenant security tests that attempt cross-workspace access using altered IDs.
  • Monitor logs for unusual access patterns, such as a single account touching resources associated with many different tenants or workspaces.

When combined, these approaches can highlight authorization gaps before they reach production or quickly surface abnormal cross-tenant access patterns in live systems.

Sources

SourceLink
github.comgithub.com/dataease/SQLBot/security/advisories/GHSA-pq2r-fj48-xfpp

Frequently asked

questions

The issue is exploitable wherever multiple tenants or workspaces share a SQLBot instance and the affected endpoints are reachable.

An attacker typically needs any valid account or API access within that deployment but does not need elevated privileges to attempt cross-workspace identifiers.

In most scenarios, the attacker requires authenticated access to SQLBot with permission to interact with data source schema endpoints for their own workspace.

From there, they may manipulate resource identifiers to target other tenants' data sources and schemas if no robust ownership checks are enforced.

The most reliable fix is to implement strict object-level authorization:

every access to a data source or schema must verify that the resource belongs to the authenticated user's tenant or workspace, using tenancy information derived from the session or token rather than from client-provided IDs.

In addition, centralizing these checks in a shared authorization layer reduces the likelihood of future omissions.

Designing for multi-tenancy from the outset is key.

Use tenant-scoped queries, avoid trusting client-supplied identifiers for authorization decisions, and mandate that all resource lookups include both tenant and resource identifiers.

Complement this with secure coding guidelines, automated checks that flag unscoped queries, and regular multi-tenant penetration tests focused on cross-tenant access attempts.

Find out what's already
exploitable in your codebase.