/

CVE-2026-55583

Severity:

HIGH RISK

(7.6)

Cross-workspace IDOR (CWE-639) in Twenty AI Monitor

CVE-2026-55583

Deferred

Vulnerability type

Category:

Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Cross-tenant data exposure and unauthorized actions

Severity:

HIGH RISK

(7.6)

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

A cross-workspace insecure direct object reference in Twenty's AI agent monitor allows authenticated users to access or act on agent turns belonging to other workspaces.

When an attacker knows another workspace's agentId or turnId, they can retrieve sensitive chat histories and submit evaluations against those foreign turns, bypassing workspace isolation.

Affected context

This vulnerability occurs in Twenty instances that use the AI agent monitor features and share infrastructure across multiple workspaces (tenants).

It is relevant when:

  • The AgentTurnResolver and related services query agent turns using only agentId or turnId
  • Workspace-level isolation is expected but not enforced in the data access layer
  • Users can see non-guessable identifiers (UUIDs) for agents and turns in URLs or UI elements

Exploit preconditions

  • Attack surface: HTTP API endpoints backing the AI agent monitor (e.g., agentTurns(agentId) query and evaluateAgentTurn(turnId) mutation).
  • Required access: Authenticated user with the AI settings capability in any workspace on the affected instance.
  • Trigger point: Calling the resolver or service methods with an agentId or turnId that belongs to a different workspace.
  • Why exploitation is possible: The data access logic filters by agentId or id only and omits workspaceId in the WHERE clause. Class-level guards confirm the caller is authenticated in some workspace but do not verify that the targeted AgentTurnEntity belongs to that workspace, allowing cross-workspace access when identifiers are known.

Why this happens

The underlying bug is a classic insecure direct object reference mapped to CWE-639, where authorization is performed on the user or session but not on the specific object being accessed.

The AgentTurnResolver and agent-turn-grader service retrieve and manipulate AgentTurnEntity records using only agentId or turnId, even though those records are also scoped by workspaceId.

Because the workspaceId column is not included in the query filters and the guards only ensure that a user is logged into some workspace, the code assumes that possession of a valid identifier implies authorization, breaking tenant isolation and enabling cross-workspace data access and actions.

Potential impact

  • Authenticated users may access full AI agent chat histories in other workspaces, including raw chat text, tool calls, and tool outputs.
  • Attackers could submit evaluations (agentTurnEvaluation rows) tied to a victim's workspace, potentially polluting analytics or feedback signals.
  • Sensitive business or customer information processed by AI agents could be exposed across tenants.
  • Misattributed AI evaluation data can distort model performance metrics or monitoring dashboards.

General mitigation guidance

Effective mitigation focuses on enforcing object-level authorization and tenant scoping across all data access paths.

Common patterns include:

  • Ensuring every query and mutation involving tenant-scoped entities includes workspaceId (or equivalent tenant key) in the WHERE clause derived from the caller's current context.
  • Centralizing authorization checks so that services validate that an object belongs to the caller's workspace before returning or mutating it.
  • Avoiding reliance on opaque identifiers (like UUIDs) as proof of authorization, treating them strictly as locators not access tokens.
  • Designing APIs so that identifiers exposed in URLs or front-end configurations cannot cross tenant boundaries without additional verification.
  • Applying least privilege principles to feature flags and role assignments, limiting cross-workspace features to clearly separated admin surfaces.

How teams detect issues like this

Detection typically involves a combination of code-level and behavioral analysis:

  • Static analysis or manual code review to identify ORM or query builder usage that filters by primary key or foreign key without also filtering by tenant/workspace fields.
  • Review of resolver and service layers to confirm that authorization logic checks record ownership (e.g., workspaceId) rather than just authentication status or feature flags.
  • Application-level tests that attempt to access data across workspaces using valid identifiers from another tenant to validate isolation boundaries.
  • Logging and monitoring for unusual patterns where users in one workspace repeatedly access agentIds or turnIds from different workspaces, indicating potential abuse.

Sources

SourceLink
github.comgithub.com/twentyhq/twenty/security/advisories/GHSA-v39r-w5vg-j9pp

Frequently asked

questions

Exploitation is limited to authenticated users with AI settings access on the same instance, but within that scope, any such user who can obtain a victim's agentId or turnId can target other workspaces, making it a significant cross-tenant risk.

The attacker must be logged into some workspace on the Twenty instance, have the AI settings flag (typically as a workspace owner), and be able to see or capture another workspace's agentId or turnId, which may be exposed in URLs or shared configuration links.

The robust fix is to enforce object-level authorization by always validating that the requested entity's workspaceId matches the caller's current workspace context and to ensure all queries and mutations are tenant-scoped, rather than relying solely on authentication.

Adopting a consistent multi-tenant design that centralizes tenant resolution, enforcing workspaceId checks in a shared authorization layer, using automated tests and code review templates for access control, and treating identifiers as untrusted inputs rather than implicit authorization tokens can prevent similar vulnerabilities.

Find out what's already
exploitable in your codebase.