Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-47702

CVE-2026-47702: TypeBot Information Disclosure Flaw

CVE-2026-47702 is an information disclosure vulnerability in TypeBot chatbot builder that exposes cleartext API tokens in the database, allowing attackers to impersonate users. This article covers technical details, impact, and fixes.

Published:

CVE-2026-47702 Overview

CVE-2026-47702 is a cleartext storage vulnerability [CWE-312] affecting Typebot, an open-source chatbot builder tool. In version 3.16.1, API tokens used as bearer credentials for the builder API are stored in the database as unhashed cleartext strings. An attacker who obtains read access to the database can extract every token and impersonate any user without needing a password or multi-factor authentication (MFA). Database read access can be achieved through SQL injection, exposed backups, or insider access. The maintainers addressed the issue in version 3.17.0 by hashing tokens before storage.

Critical Impact

Any read-only database exposure results in full account takeover of every Typebot user, bypassing password authentication and MFA controls.

Affected Products

  • Typebot version 3.16.1 and prior versions storing API tokens in cleartext
  • Typebot builder API authentication component (handleCreateApiToken.ts)
  • Typebot viewer authentication component (authenticateUser.ts)

Discovery Timeline

Technical Details for CVE-2026-47702

Vulnerability Analysis

Typebot issues API tokens as long-lived bearer credentials that authenticate requests against the builder API. In version 3.16.1, the application persists these tokens in the database exactly as they are returned to the user. No hashing, encryption, or key derivation is applied prior to storage.

Because the stored value equals the value the client presents in the Authorization header, any actor who reads the token column can replay it directly. The credential grants the same scope as the user who created it, sidestepping password prompts, session controls, and MFA enrollment. The vulnerability is tracked as a Cleartext Storage of Sensitive Information weakness [CWE-312].

Root Cause

The token creation flow in apps/builder/src/features/user/server/handleCreateApiToken.ts generated a random identifier and wrote it into the ApiToken table verbatim. The viewer authentication path in apps/viewer/src/helpers/authenticateUser.ts then compared the incoming bearer value against the stored plaintext. The fix introduces generateApiToken and hashApiToken helpers, storing only the hash and matching authentication attempts against the hashed representation.

Attack Vector

Exploitation requires read access to the Typebot database. Common paths include SQL injection against the application, exposed database backups, snapshot leaks in cloud storage, or insider access through database administration tools. After extracting tokens, the attacker issues authenticated API requests with Authorization: Bearer <token> and operates as the token owner until the credential is revoked.

typescript
// Patch: apps/builder/src/features/user/server/handleCreateApiToken.ts
-import { generateId } from "@typebot.io/lib/utils";
+import { generateApiToken, hashApiToken } from "@typebot.io/lib/apiToken";
 import prisma from "@typebot.io/prisma";
 import type { User } from "@typebot.io/user/schemas";
 import { z } from "zod";

// Patch: apps/viewer/src/helpers/authenticateUser.ts
+import { hashApiToken, isHashedApiToken } from "@typebot.io/lib/apiToken";
 import prisma from "@typebot.io/prisma";
 import type { Prisma } from "@typebot.io/prisma/types";
 import type { NextApiRequest } from "next";

Source: GitHub commit fdcc1784c9318904c180703e1ef4f1e06e6dd50e

Detection Methods for CVE-2026-47702

Indicators of Compromise

  • Rows in the ApiToken table whose token column contains values that are not hashed (short random strings rather than fixed-length hash digests) on Typebot 3.16.1 or earlier.
  • Authenticated API requests originating from IP addresses or user agents that differ from the token owner's historical baseline.
  • Unexpected database export, backup download, or pg_dump-style activity against the Typebot database host.

Detection Strategies

  • Audit application logs for bearer-token authentication events and correlate token IDs to source IPs and geolocations to surface reuse from unrelated actors.
  • Review web server logs for SQL injection patterns targeting Typebot endpoints, since database read access is the primary path to token disclosure.
  • Inspect object storage buckets and backup repositories for unauthorized access to database dumps that may contain the ApiToken table.

Monitoring Recommendations

  • Alert on new API tokens created immediately followed by activity from a previously unseen network location.
  • Monitor for privileged database queries that select from the ApiToken table outside of documented maintenance windows.
  • Track failed-to-successful authentication ratios per user to flag credential replay following a database compromise.

How to Mitigate CVE-2026-47702

Immediate Actions Required

  • Upgrade Typebot to version 3.17.0 or later, which stores API tokens as hashes.
  • Revoke and reissue every existing API token after the upgrade, since pre-upgrade tokens remain valid in cleartext form until rotated.
  • Rotate database credentials and audit historical access to the ApiToken table if a compromise is suspected.
  • Restrict database network exposure and enforce least-privilege access for application service accounts.

Patch Information

The fix is delivered in Typebot v3.17.0 through Pull Request #2492. The patch introduces hashApiToken and isHashedApiToken helpers in @typebot.io/lib/apiToken, updates the token creation handler to store only the hash, and updates the viewer authentication path to compare the hash of incoming bearer values against stored records. See the GitHub Security Advisory GHSA-9c96-gcg3-2662 for advisory details.

Workarounds

  • If immediate upgrade is not feasible, restrict database access strictly to the application service account and block direct network access from other hosts.
  • Encrypt database backups at rest and enforce access controls on backup storage buckets to reduce exposure of the ApiToken table.
  • Rotate API tokens on a short, mandatory schedule to limit the useful lifetime of any leaked credential.
bash
# Upgrade Typebot to the patched release
git fetch --tags
git checkout v3.17.0

# Rebuild and redeploy (example for a self-hosted Docker deployment)
docker compose pull
docker compose up -d --build

# After upgrade, revoke and reissue all API tokens from the Typebot UI
# or via direct database operation (example, PostgreSQL):
# psql -c "DELETE FROM \"ApiToken\";"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.