/

CVE-2026-48768

Severity:

CRITICAL RISK

(9.3)

Path Injection (CWE-22) in TypeBot File Upload API

CVE-2026-48768

Deferred

Vulnerability type

Category:

Path Traversal / Path Injection

CWE:

CWE-22, CWE-79

Impact:

Stored Cross-Site Scripting and Arbitrary Content Hosting

Severity:

CRITICAL RISK

(9.3)

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 file upload API accepts attacker-controlled file names and uses them directly in S3 object keys without authentication or proper path validation.

An anonymous visitor to a bot with a file input block can host arbitrary HTML, SVG, or JavaScript under public storage paths, including locations used by other tenants, which can lead to arbitrary content hosting and stored cross-origin XSS.

Affected context

The vulnerability occurs in TypeBot instances where:

  • The /api/blocks/file-input/v3/generate-upload-url endpoint is reachable over the internet
  • Chatbots expose a file input block that triggers upload URL generation
  • Uploaded files are stored in a shared S3/MinIO bucket under a public/ prefix and later served as static content
  • Object keys are derived from user-supplied fileName without sufficient normalization or scoping

In such deployments, any visitor interacting with a published bot can influence where and what content is stored under publicly accessible storage paths.

Exploit preconditions

  • Attack surface: HTTP POST endpoint /api/blocks/file-input/v3/generate-upload-url exposed by the TypeBot backend.
  • Required access: No authentication; the attacker only needs to access a published bot that uses the file input block.
  • Trigger point: Submission of crafted fileName values to the upload URL generator, followed by uploading attacker-controlled content using the returned presigned PUT URL.
  • Why exploitation is possible:
  • The API trusts fileName and uses it directly to construct S3 object keys under a shared public/ prefix.
  • There is no tenant isolation or strict key prefixing enforced at the API level.
  • Presigned URLs do not bind or restrict Content-Type, allowing HTML, SVG, and JS uploads.
  • Forward-slash characters in fileName are honored as path separators, enabling injection into arbitrary subpaths even though ../ traversal is effectively blocked by S3/MinIO canonicalization.

Why this happens

At its core, this issue is a path injection vulnerability where untrusted input is used to build storage paths without proper normalization, scoping, or validation.

The backend constructs S3 object keys by concatenating public/ with a user-controlled fileName, implicitly assuming that the client will only provide benign filenames.

This behavior maps to CWE-22: Path Traversal, because the application allows user input to influence resource paths beyond the intended directory structure, even without classic ../ traversal.

The ability to upload active content (HTML, SVG, JS) into public paths that are later served directly to browsers leads to a secondary stored XSS (CWE-79) condition, as injected content can execute in the origin context of the storage or frontend domain.

Potential impact

  • Attacker-controlled HTML or JavaScript can be hosted under the trusted storage origin, enabling stored cross-origin XSS when victims visit those URLs.
  • Content spoofing or phishing pages can be deployed under paths that appear to belong to legitimate tenants.
  • Overwriting or shadowing existing public result files of other tenants (where naming collisions are possible), causing data integrity issues or UI manipulation.
  • Abuse of the storage bucket as a free arbitrary static file hosting service for malicious content.
  • Potential pivot to session theft, token exfiltration, or drive-by attacks when injected pages interact with other application resources under the same origin.

General mitigation guidance

Effective mitigation focuses on strict key scoping, input normalization, and active content control:

  • Derive storage object keys server-side from stable, trusted identifiers (e.g., tenant ID, bot ID, random UUID) instead of using raw user-supplied fileName as part of the path.
  • Normalize and validate any remaining filename component against an allowlist of characters and disallow embedded path separators such as /.
  • Enforce strong tenant isolation in storage layout (e.g., per-tenant key prefixes that cannot be influenced by the client).
  • Bind presigned URLs to expected Content-Type values and restrict them to non-executable formats where possible.
  • Configure storage and CDN layers with content-type, caching, and security headers (e.g., Content-Security-Policy, X-Content-Type-Options) to reduce the risk of executable uploads becoming active XSS payloads.
  • Apply least-privilege policies for the service that generates presigned URLs so it can only issue keys within the intended tenant-specific prefixes.

How teams detect issues like this

Detection can rely on both code-centric and behavior-centric techniques:

  • Static analysis and code review:
  • Flag concatenation of user input into storage keys, filesystem paths, or URL paths without normalization or prefix enforcement.
  • Look for presigned URL generation that accepts arbitrary fileName or path fragments, especially where authentication checks are absent or weak.
  • Identify code paths where uploads are accepted without validating Content-Type or file extensions against an allowlist.
  • Runtime and operational monitoring:
  • Log and analyze upload keys and MIME types to detect unusual patterns, such as HTML/JS content stored in result or asset paths.
  • Set alerts for spikes in uploads to shared public prefixes or for keys containing unexpected nested subpaths.
  • Policy and CI integration:
  • Incorporate security checks into CI/CD that scan for unsafe storage key construction patterns.
  • Use automated review tools or linters configured with custom rules for path injection and unsafe upload endpoints.

Sources

SourceLink
github.comgithub.com/baptisteArno/typebot.io/releases/tag/v3.17.0
github.comgithub.com/baptisteArno/typebot.io/security/advisories/GHSA-fp7x-6pqh-vhvf

Frequently asked

questions

Yes. Any remote user who can interact with a published TypeBot that contains a file input block can exploit the issue, as the affected endpoint is unauthenticated and exposed via the bot workflow.

No explicit authentication is required. The key prerequisite is access to a deployed bot with a file upload block; from there, the attacker can obtain presigned URLs and control both paths and content types.

Move all path and key generation logic to the server side, derive keys solely from trusted identifiers and random values, enforce tenant-specific prefixes, and strictly validate both filenames and content types before issuing any upload capability.

Treat all user-supplied path fragments and filenames as untrusted, avoid embedding them directly into storage or filesystem paths, enforce strong tenant isolation in storage layouts, and apply defense-in-depth on uploaded content through validation, content-type restrictions, and secure response headers.

Find out what's already
exploitable in your codebase.