Paperclip Cross-Tenant Agent API Key IDOR Vulnerability
A Paperclip API vulnerability allows a board user from one company to create, list, and revoke agent API keys in another company, leading to full cross-tenant compromise due to insufficient authorization checks on `/agents/:id/keys` routes.
A critical vulnerability exists in the Paperclip control-plane API, specifically in versions prior to 2026.416.0. The vulnerability allows a board user with membership in one company (e.g., Company A) to manipulate agent API keys for agents belonging to a different company (e.g., Company B). This is due to an Insecure Direct Object Reference (IDOR) in the /agents/:id/keys routes (GET, POST, DELETE) where the API only validates the user’s board-type session but fails to verify access to the company owning the target agent. By exploiting this flaw, an attacker can mint a new agent API key for an agent in the victim tenant, granting them full agent-level access within that tenant. This cross-tenant compromise allows the attacker to execute workflows, read data, and call any endpoint authorized for agents in the victim tenant, effectively breaching tenant isolation. The vulnerability was introduced due to missing company access checks in the key-management routes.
Attack Chain
- The attacker authenticates as a board user within Company A.
- The attacker discovers or obtains the UUID of an agent belonging to Company B.
- The attacker sends a POST request to
/agents/<VICTIM_COMPANY_B_AGENT_ID>/keyswith a name to create a new API key. - The server, lacking proper authorization checks, creates a new API key associated with the victim agent’s
companyIdand returns the cleartext token. - The attacker uses the newly minted agent token in the
Authorizationheader to authenticate subsequent requests. - The server’s authentication middleware incorrectly sets the
req.actorto an agent type associated with the victim’s company. - The attacker successfully accesses resources and executes actions within Company B’s tenant, bypassing company access checks.
- The attacker can enumerate and revoke existing keys using the
/agents/:id/keysand/agents/:id/keys/:keyIdendpoints, causing denial of service to legitimate users.
Impact
This vulnerability leads to a full cross-tenant compromise. An attacker can gain unauthorized access to any tenant within the Paperclip instance, provided they have a minimal valid account (board user in any company) and a victim agent UUID. This allows the attacker to execute workflows, read sensitive data, and call any authorized endpoint within the victim tenant, leading to complete confidentiality, integrity, and availability loss. Furthermore, the attacker can revoke legitimate agent keys, resulting in a denial of service. This represents a scope change, where a vulnerability in Company A’s scoping checks results in catastrophic impact within Company B’s tenant.
Recommendation
- Implement explicit company-access checks on the
/agents/:id/keys(GET, POST) and/agents/:id/keys/:keyId(DELETE) routes before interacting with the service layer. This directly addresses the core issue as described in the advisory’s “Recommended Fix” section. - Deploy the Sigma rule
Detect Paperclip Cross-Tenant API Key Creationto identify unauthorized API key creation attempts. - Deploy the Sigma rule
Detect Paperclip Cross-Tenant API Accessto detect unauthorized access using stolen agent tokens. - Upgrade to npm/@paperclipai/server version 2026.416.0 or later to patch the vulnerability as mentioned in the advisory’s “Affected Packages” section.
Detection coverage 3
Detect Paperclip Cross-Tenant API Key Creation
highDetects attempts to create agent API keys using the vulnerable Paperclip API endpoint without proper authorization, potentially indicating cross-tenant access attempts.
Detect Paperclip Cross-Tenant API Access
highDetects API requests using an agent token, potentially indicating unauthorized access due to the cross-tenant vulnerability.
Detect Paperclip Cross-Tenant API Key Enumeration
mediumDetects attempts to list agent API keys using the vulnerable Paperclip API endpoint without proper authorization, potentially revealing sensitive information about other tenants.
Detection queries are kept inside the platform. Get full rules →