/

CVE-2026-39968

Severity:

HIGH RISK

(7.1)

Authorization Bypass / Improper Access Control

CVE-2026-39968

Deferred

Vulnerability type

Category:

Authorization Bypass / Improper Access Control

CWE:

CWE-284, CWE-522, CWE-639

Impact:

Credential Theft and Cross-Workspace Data Exposure

Severity:

HIGH RISK

(7.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

TypeBot's bot-engine runtime contains an authorization flaw that allows authenticated users to access credentials belonging to other workspaces via the preview chat endpoint.

Because workspace ownership checks can be bypassed with a crafted workspaceId value, attackers may exfiltrate stored credentials and abuse connected external services under certain conditions.

Affected context

The vulnerability arises in the TypeBot bot-engine runtime when handling preview chat requests that need to retrieve stored credentials.

In affected versions, the getCredentials() utility function relies on a truthy/falsy check of the workspaceId field, and the associated schema permits empty strings.

When deployments:

  • Rely on workspace-scoped credentials for external integrations, and
  • Allow authenticated users to interact with the preview chat endpoint,

the bot engine may fail to properly enforce workspace ownership, exposing credentials across workspace boundaries.

Exploit preconditions

  • Attack surface: TypeBot bot-engine preview chat endpoint.
  • Required access: Any authenticated user account capable of invoking the preview chat functionality.
  • Trigger point: A request to the preview chat endpoint that causes the runtime to call getCredentials() with a client-supplied workspaceId field.
  • Why exploitation is possible: The workspace ownership validation uses a conditional check of the form if (workspaceId && ...).

Since the Zod schema for the preview endpoint accepts empty strings, an attacker can pass workspaceId: "", causing the ownership check to be skipped while still allowing credential retrieval logic to proceed.

Why this happens

The root cause is an improper access control implementation tied to weak input validation and over-trust in client-supplied identifiers.

Instead of enforcing workspace ownership server-side using authoritative context (e.g., session-bound workspace IDs), the bot engine:

  • Accepts a workspaceId parameter directly from the client for credential lookup, and
  • Uses a falsy check (if (workspaceId && ...)) as the gate for ownership checks.

When combined with a schema that permits empty strings, this pattern allows bypassing authorization logic by providing a value that satisfies type constraints but fails the truthy check.

This maps primarily to CWE-284: Improper Access Control, with elements of CWE-639: Authorization Bypass Through User-Controlled Key, where a client-controlled identifier is used for access decisions, and CWE-522: Insufficiently Protected Credentials, since secrets are retrievable beyond their intended scope.

Potential impact

  • Unauthorized access to stored credentials from other workspaces.
  • Abuse of external services (e.g., payment processors, messaging APIs, third-party integrations) using stolen credentials.
  • Financial loss due to unintended API usage, quotas being exhausted, or fraudulent activity.
  • Cross-workspace data exposure and potential data breach if credentials grant access to sensitive systems.
  • Erosion of tenant isolation guarantees in multi-tenant deployments.

General mitigation guidance

Effective mitigation focuses on tightening authorization checks and reducing reliance on client-controlled identifiers:

  • Perform workspace ownership validation using server-side context (e.g., user-session associations, database lookups) rather than trusting workspaceId values supplied by the client.
  • Treat workspace IDs and similar scoping identifiers as sensitive authorization parameters, enforcing strict, non-bypassable validation for every credential lookup.
  • Avoid using truthiness checks to guard access control logic; prefer explicit validation of allowed value sets and consistent handling of empty, null, or missing fields.
  • Centralize access control decisions in a shared authorization layer that is reused by both builder and runtime components, minimizing the risk of partial or inconsistent fixes.
  • Restrict exposure of stored credentials by returning only what is strictly necessary for the runtime, and consider token-scoping or proxying external API calls rather than handing raw secrets to clients.
  • Apply least-privilege principles to all stored credentials so that any unauthorized access has limited blast radius.

How teams detect issues like this

Organizations can identify this class of issue through layered detection approaches:

  • Static analysis and code scanning:
  • Search for handlers that accept client-controlled IDs (workspaceId, projectId, tenantId) and immediately use them in database queries or access decisions.
  • Flag conditional patterns where access control depends on generic truthy/falsy checks or where security-critical checks are gated by loosely validated inputs.
  • Targeted code review:
  • Review all endpoints that return or use credentials, secrets, or tokens, ensuring that authorization logic is consistent and independent of client-manipulable identifiers.
  • Verify that both builder and runtime paths share the same authorization guarantees, especially after partial fixes for prior advisories.
  • Runtime monitoring and logging:
  • Log credential access events with the requesting user ID, workspace context, and credential owner workspace, then alert on cross-workspace access patterns.
  • Use anomaly detection to identify unusual credential access volumes or patterns for low-privilege accounts.
  • Security testing:
  • Include multi-tenant access control tests in QA and security assessments, intentionally varying workspaceId or similar fields to confirm that unauthorized access is denied.

Sources

SourceLink
github.comgithub.com/baptisteArno/typebot.io/commit/d96f572e6099c5f622c05ba7b8634e6477dcf052
github.comgithub.com/baptisteArno/typebot.io/releases/tag/v3.16.0
github.comgithub.com/baptisteArno/typebot.io/security/advisories/GHSA-cq66-9cwr-x8jr

Frequently asked

questions

Yes, in environments where the TypeBot preview chat endpoint is accessible over the network and users can authenticate, this issue can be exploited remotely by sending crafted requests that manipulate the workspaceId field.

The attacker needs valid authentication to the application, but does not need to be a member of the target workspace. Any authenticated user who can reach the preview chat functionality may attempt to exploit the issue.

The most robust fix is to decouple authorization from client-controlled identifiers by deriving workspace context from trusted server-side data (such as the authenticated user's memberships) and enforcing strict checks for every credential access. Additionally, ensure that all credential-returning paths share a centralized authorization mechanism that cannot be bypassed by omitting or altering optional parameters.

Prevention strategies include standardizing authorization patterns across services, treating tenant and workspace IDs as internal-only references, and using explicit validation instead of truthiness checks for security-critical conditions. Incorporating multi-tenant access control tests into CI pipelines, along with automated scanning for user-controlled IDs in access decisions, helps catch similar flaws before release.

Find out what's already
exploitable in your codebase.