Commit Graph

725 Commits

Author SHA1 Message Date
Baptiste Arnaud
a64e82b612
🐛 Fix unsafe upload URL generation (#2502)
- Replace direct browser presigned PUT uploads with signed Typebot
upload proxy URLs.
- Generate or validate upload object keys server-side while preserving
legacy v1/v2/v3 file-input upload contracts.
- Keep builder slot uploads stable for replaceable assets and use
generated names for runtime file uploads.
- Store active file-input MIME types as safe attachment downloads while
keeping safe image uploads inline.
- Update upload clients and docs to support both raw PUT proxy uploads
and form-data uploads.
2026-05-21 18:37:04 +02:00
Baptiste Arnaud
e296c870bc
🐛 Fix WhatsApp webhook verification (#2498)
- Verify Meta WhatsApp webhooks with optional app secrets while
preserving soft compatibility for existing credentials.
- Add optional 360Dialog webhook secret validation and update flows for
existing WhatsApp credentials.
- Validate Meta WABA and phone number access, then auto-subscribe the
Meta app to the WABA during setup.
- Clear and disable WhatsApp integration when the active credentials are
removed, including published bot state.
- Preserve raw webhook request bodies, document preview app secret
configuration, and add focused webhook verification tests.
- Update related tooling, Biome ignore rules, opensrc guidance, and
small formatting/type-safety cleanup.
2026-05-21 16:45:32 +02:00
Baptiste Arnaud
fdcc1784c9
🔧 Hash API tokens (#2492)
- Store newly created API tokens as SHA-256 hashes while returning the
raw token once.
- Authenticate bearer tokens against both hashed and legacy plaintext
records, then lazily hash legacy records on successful use.
- Seed Playwright API tokens as hashes.
- Add Conductor setup and run scripts for local workspaces.
2026-05-19 18:17:11 +02:00
Baptiste Arnaud
6f289f647f
🔒️ Upgrade vulnerable deps (ai v5, nodemailer v8, otel sdk-node 0.217) (#2491)
## Summary

Fixes 18 open Dependabot alerts and migrates affected code to the new
major versions:

- `@opentelemetry/sdk-node` → `^0.217.0` (Prometheus exporter DoS,
GHSA-q7rr-3cgh-j5r3)
- `nodemailer` → `^8.0.5` across all manifests + root override
(GHSA-vvjj-xcjg-gr5g, GHSA-c7w3-x93f-qmm8)
- `ai` → `^5.0.52` (GHSA-rwvc-j5jr-mgvh); legacy 3.x dep removed from
`packages/deprecated/legacy` and replaced with a small in-tree
`OpenAIStream` + `StreamingTextResponse` shim
- Provider SDKs aligned to v5 peer: `@ai-sdk/openai`, `anthropic`,
`groq`, `mistral`, `perplexity`, `deepseek`, `togetherai`, `openRouter`,
`dify-ai-provider`

### AI SDK v4 → v5 migration

- `parseTools`: `parameters` renamed to `inputSchema`
- `runChatCompletion` / `runChatCompletionStream`: `maxSteps` replaced
by `stopWhen(stepCountIs(maxSteps))`;
`usage.{prompt,completion,total}Tokens` replaced by
`totalUsage.{input,output,total}Tokens`
- New `toLegacyDataStream` helper that re-emits the v4 data-stream
protocol (`0:text`, `3:error`, `9:tool_call`, …) so existing consumers
in `embeds/js` and the OpenAI `askAssistant` / `askModel` handlers keep
working
- `compatibility: "strict"` removed from `createOpenAI` (option dropped
in v5)
- `formatDataStreamPart` / `processDataStream` imports moved to
`@ai-sdk/ui-utils` (legacy package pinned at 1.2.11)

### E2E test follow-up

Second commit fixes Playwright tests that broke once the env-resolved
URLs / new SDK surface kicked in:
- `fileUpload`: assert exported URL contains `parseS3PublicBaseUrl()`
(not `S3_ENDPOINT`) so it works with `S3_PUBLIC_CUSTOM_DOMAIN`; verify
post-deletion via cache-busted `request.get` instead of a CDN-cached new
tab.
- `ssrf`: assert on the actual "Security validation failed" log emitted
by the pre-flight check; fixture now maps `response.statusCode` into a
`Status` variable so `Status: …` assertions resolve.
- Root `dev` script includes `@typebot.io/partykit` so the webhook
listener e2e test can hit PartyKit on `:1999`.

Also fixes a pre-existing broken anchor link in `whatsapp-ai-agent.mdx`
that blocked the landing-page link checker.

## Test plan

- [ ] `bunx nx test` passes
- [ ] `bunx nx typecheck` passes
- [ ] `bunx nx affected -t
format-and-lint,lint-repo,check-broken-links,test --parallel=4` passes
(pre-commit)
- [ ] `bun run dev` boots builder, viewer, workflows **and** PartyKit
- [ ] Viewer Playwright suite: `fileUpload.spec.ts`, `ssrf.spec.ts`,
`webhookListener.spec.ts` all green
- [ ] Manual smoke: OpenAI `askAssistant` block streams correctly in the
embed (v4 data-stream protocol preserved)
- [ ] Manual smoke: Anthropic / Mistral / Groq blocks still execute
end-to-end
- [ ] Manual smoke: send a test email through a workspace SMTP block
(nodemailer v8)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:30:36 +02:00
Baptiste Arnaud
30682a258a
📝 Document status page and analytics completion criteria (#2480)
- Added a new "Is there a status page?" entry to the FAQ pointing to
status.typebot.io.
- Added a "Definitions" section to the analytics doc explaining Views,
Starts, Completions (no input remaining + at least one answer + no
pending client-side action expecting a dedicated reply) and the
per-block drop-off rate.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 11:10:10 +02:00
Baptiste Arnaud
b25c41b02b
🐛 Fix SSRF bypass via DNS rebinding in HTTP request and script fetch flows (#2461)
- Add `createSafeDispatcher` with a `validatingLookup` that checks
resolved IPs at TCP connection time, preventing DNS rebinding TOCTOU
attacks (GHSA-hgqq-whf5-mrrf)
- Pass the safe undici dispatcher in `safeFetchWithoutChunkedEncoding`
(`ky.ts`) and in the isolated VM fetch wrapper (`executeFunction.ts`)
- Export `parseIPAddress`, `validateIPAddress` and `ParsedIP` from
`validateHttpReqUrl.ts` for reuse in the dispatcher
- Add unit tests for `validatingLookup` and E2E test bot/spec for SSRF
scenarios
- Add `@types/bun` to `packages/lib` tsconfig

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 09:28:06 +00:00
Baptiste Arnaud
2c3fc7267a
🐛 Fix stored XSS via javascript: URI in bubble links (GHSA-hqmv-v56g-4m47) (#2435)
## Summary
- Fix stored XSS vulnerability where `javascript:` URIs in text bubble
links, image click links, and toast popup links could execute arbitrary
JS in visitors' browsers
- Add `sanitizeUrl` utility that allowlists only `http:`, `https:`,
`mailto:`, and `tel:` protocols
- Add explicit `typecheck` Nx targets for `builder` and `viewer`
(Next.js projects don't get one inferred by `@nx/js/typescript`)
- Bump `@typebot.io/js` and `@typebot.io/react` to `0.10.1`

## Test plan
- [ ] Create a bot with a text bubble link set to `javascript:alert(1)`
and verify it renders as `#`
- [ ] Same test with an image click link
- [ ] Verify normal `https://` links still work
- [ ] Run `bunx nx typecheck builder` and `bunx nx typecheck viewer`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 17:46:09 +02:00
Baptiste Arnaud
cb2430ba84
🔧 Move to typebot.com 2026-03-26 17:10:02 +01:00
Baptiste Arnaud
9d9f02b3ac
🐛 Really restore ORPCPlugin on viewer 2026-03-23 11:17:29 +01:00
Baptiste Arnaud
3736d337b2
🐛 Restore ORPCPlugin on viewer 2026-03-23 11:04:35 +01:00
Baptiste Arnaud
9cf506c5d1
🔧 Add feature-flags service 2026-03-20 17:58:25 +01:00
Baptiste Arnaud
a9b2af116d
🐛 Fix code scanning findings 2026-03-19 10:21:03 +01:00
Baptiste Arnaud
db2a3e2ffa
🐛 Fix nx-ignore command on CI 2026-03-19 09:37:55 +01:00
Baptiste Arnaud
c2b251c7e5
♻️ Migrate to NX (#2418) 2026-03-18 15:29:32 +00:00
Baptiste Arnaud
2f674b96d2
💚 Fix e2e tests 2026-03-17 14:50:16 +01:00
Baptiste Arnaud
90ec449168
🔧 Refine cookie handling UI and embeds visuals 2026-03-17 14:50:16 +01:00
Baptiste Arnaud
14ec3a2598
🔧 Enable PR2 Biome rules and mechanical autofixes 2026-03-13 11:46:28 +01:00
Baptiste Arnaud
516b33b8a1
🔧 Enable PR1 Biome rules and prefer implicit undefined returns 2026-03-13 11:27:15 +01:00
Baptiste Arnaud
603fd903fb
🔧 Centralize runtime telemetry and Sentry reporting
Move builder, viewer, and workflows onto shared telemetry helpers so request logging, OTLP config, and workflow failures are reported consistently across runtimes.
2026-03-12 17:32:46 +01:00
Baptiste Arnaud
0109a5cadd
🔧 Rename Typebot debug env var to avoid conflict 2026-03-03 10:03:30 +01:00
Baptiste Arnaud
75eaf4b016
👌 Move metadata to share page (#2398)
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
Deploy Workflows (Fly.io) / deploy (push) Has been cancelled
## Summary

- Moved site metadata controls (title, description, favicon, preview
image) from Settings into Share page.
- Added a new LinkPreviewMetadataForm component and wired it to update
typebot settings from Share.
- Updated default preview image from PNG to JPEG and replaced the asset
under apps/viewer/public.
- Adjusted share page layout to show links and metadata side-by-side and
improved some responsive width styles.

Verification: commit hooks ran format-and-lint, lint-repo,
check-broken-links, and repository tests automatically during commit.
2026-02-13 18:31:03 +01:00
Baptiste Arnaud
156e895349
🔧 Enforce SVG title accessibility and remove linter override (#2396) 2026-02-13 09:11:40 +00:00
Baptiste Arnaud
6e25c8c766
🔧 Remove noAccumulatingSpread off rule (#2390) 2026-02-12 14:27:28 +00:00
Baptiste Arnaud
5e0de89911
🔧 Add forward WA errors and campaign statuses option 2026-02-11 16:46:35 +01:00
Baptiste Arnaud
7e17ae3157
🐛 (lp) Fix templates page not loading 2026-01-22 16:10:13 +01:00
Baptiste Arnaud
80db9565cd
♻️ Upgrade to Zod v4 (#2355) 2026-01-19 10:51:20 +01:00
Baptiste Arnaud
a33289e4f1
🔧 Pin Node 22 for builder/viewer (#2354) 2026-01-19 10:01:34 +01:00
Baptiste Arnaud
8febf1a4bd
Introduce Effect-based workflow system (#2345) 2026-01-15 10:35:22 +01:00
Baptiste Arnaud
a15673f5a6
♻️ Migrate builder from tRPC to oRPC (#2342) 2026-01-13 15:10:07 +01:00
Baptiste Arnaud
06110a8084
🔧 Fix @opentelemetry/winston-transport log error 2026-01-09 16:03:40 +01:00
Baptiste Arnaud
e6d58e2ad4
🔧 Add webhook block e2e test 2026-01-09 15:16:14 +01:00
Baptiste Arnaud
5f59bb1dd6
🔖 Release v3.15.0 2026-01-06 08:55:55 +01:00
Baptiste Arnaud
a28f186d04
🐛 Fix zapier trigger endpoints format
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
Monthly job / clean (push) Has been cancelled
2025-12-23 19:48:48 +01:00
Baptiste Arnaud
62d3ba83f0
🚸 Allow s3 private URL access with PAT 2025-12-18 10:38:00 +01:00
Baptiste Arnaud
3d649886c2
♻️ Refacto viewer server handler to oRPC 2025-12-17 18:00:20 +01:00
Baptiste Arnaud
f3e984a483
🔥 Remove legacy ai stream API handlers 2025-12-15 11:28:30 +01:00
Baptiste Arnaud
ea2a87dd50
Add WhatsApp typing indicator 2025-12-15 10:11:26 +01:00
Baptiste Arnaud
0b14a21b37
⬆️ Upgrade Next.js and react 2025-12-12 10:28:27 +01:00
Baptiste Arnaud
7014069f5f
⬆️ Upgrade Next.js and react 2025-12-07 08:58:27 +01:00
Baptiste Arnaud
f144d74a7e
💚 Fix new healthz route syntax error
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-12-04 18:10:28 +01:00
Baptiste Arnaud
dfd6b15590
🗑️ Flag deprecated stream routes 2025-12-04 16:29:11 +01:00
Baptiste Arnaud
04efee8b9b
♻️ Fix handler cast specificity 2025-12-04 14:33:55 +01:00
Baptiste Arnaud
e214fcda60
♻️ Remove webpack aliases in next configs 2025-12-03 18:09:23 +01:00
Baptiste Arnaud
c8ee003e56
♻️ Export fetcher fetch in handlers array 2025-12-03 18:05:32 +01:00
Baptiste Arnaud
b9e64eca06
♻️ Move forged block handlers on a separate file 2025-12-03 17:11:17 +01:00
Baptiste Arnaud
6a02a5b919
⬆️ Upgrade to React 19
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-12-01 16:42:23 +01:00
Baptiste Arnaud
dd82c4d318
♻️ Migrate to Bun test 2025-11-27 12:08:31 +01:00
Baptiste Arnaud
c2d8920856
🔥 Remove legacy bot-engine 2025-11-26 15:32:26 +01:00
Baptiste Arnaud
7f58205f83
(openai) Add instructions field for gpt-4o-tts 2025-11-25 11:59:06 +01:00
Baptiste Arnaud
2b3a55f265
♻️ Migrate testHttpRequest to tRPC and strengthen security 2025-11-11 12:26:15 +01:00