Commit Graph

72 Commits

Author SHA1 Message Date
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
Kleber Rocha
5b5f82d6c0
🔒️ Add SSRF_ALLOWED_HOSTS env for self-hosted internal APIs (#2474)
## Summary

Self-hosted deployments often have legitimate internal corporate APIs on
RFC1918 ranges (10/8, 172.16/12, 192.168/16) — e.g., a backend chat API
exposed only on the internal cluster network. Since v3.14, the SSRF
mitigation introduced for [CVE-2025-64709 /
GHSA-8gq9-rw7v-3jpr](https://github.com/baptisteArno/typebot.io/security/advisories/GHSA-8gq9-rw7v-3jpr)
blocks every private range unconditionally, which prevents HTTP Request
blocks (and Function blocks via fetch) from reaching those APIs without
exposing them to the public internet.

The advisory itself listed hostname allowlisting as one of the
recommended mitigations (item #5: "Implement an SSRF-safe proxy or apply
hostname allowlists for outgoing requests"), and this PR implements it
as an opt-in env var.

## What changes

- New env var `SSRF_ALLOWED_HOSTS` (comma-separated hostnames) parsed in
`packages/env`
- `validateHttpReqUrl` now accepts an `allowedHosts` parameter
(symmetric with the existing `lookupHost` injection point); the env var
is the default
- When the URL's hostname matches an entry, `validateIPAddress` is
called with `{ allowPrivateRanges: true }`, which **only** skips the
RFC1918 range checks (10/8, 172.16/12, 192.168/16)

## What the allowlist does NOT relax

Every other protection remains active even for allowlisted hosts:

-  Link-local 169.254.0.0/16 — **the actual CVE vector** (AWS/GCP/Azure
metadata)
-  Loopback 127.0.0.0/8 and IPv6 ::1
-  0.0.0.0/8
-  IPv6 link-local fe80::/10 and unique local fc00::/7
-  Cloud metadata hostnames (\`metadata.google.internal\`,
\`metadata.goog\`, \`metadata\`)
-  \`localhost\` in production
-  Decimal/hex/octal IP encoding bypasses
-  IMDS bypass headers (\`X-aws-ec2-metadata-token*\`,
\`Metadata-Flavor\`)

This is the deliberate design: **even if an attacker controls DNS for an
allowlisted hostname and points it to 169.254.169.254, the link-local
check still fires.** The allowlist intentionally narrows what's relaxed
— corp LAN access, not metadata-service access.

## Test plan

- [x] All existing 53 SSRF tests still pass unchanged (default behavior
preserved when env unset)
- [x] New \`describe\` block covering 14 cases:
- RFC1918 hostnames pass when listed (10/8, 172.16/12, 192.168/16,
direct IP literal)
- Link-local **still blocks** for allowlisted host (DNS hijack defense)
  - Loopback **still blocks** for allowlisted host
- Direct \`169.254.169.254\` IP literal **still blocks** even when
listed
  - \`metadata.google.internal\` **still blocks** even when listed
  - Decimal-encoded metadata IP **still blocks** even when listed
- Default behavior preserved when \`allowedHosts\` is undefined or empty
  - Hostname not in allowlist still blocks
  - Case-insensitive matching (URL parser normalizes hostname)
  - No subdomain wildcarding (exact match only)
- [x] \`bun test\` green: 63/63 in \`validateHttpReqUrl.test.ts\`
- [x] \`tsc --noEmit\` green for \`packages/lib\` and \`packages/env\`
- [x] Full \`nx affected\` test suite green (whatsapp, feature-flags,
spaces, rich-text, root, emails, bot-engine, results, builder, lib — all
passed)

## Use case

Currently, self-hosters facing this hit dead-ends: their internal corp
DNS resolves to 10.x, the validator rejects it, and the only escape
valves are (a) expose the API publicly (security regression — adds
attack surface), (b) downgrade to ≤ v3.13.x (re-introduces the
vulnerable code path), or (c) maintain a fork with the validator patched
(fragile, breaks on every upgrade). An opt-in env var resolves this
without weakening the core mitigation.

I'm opening a companion issue (#2475) explaining the use case in more
detail and to gather feedback if a different design is preferred — happy
to iterate.
2026-05-15 11:30:29 +02:00
Baptiste Arnaud
67c7c86b1a
Revert Google Sheets picker fixes (#2486, #2487) (#2488)
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
- Revert #2487 (trigger_onepick OAuth param) and #2486 (setAppId +
NEXT_PUBLIC_GOOGLE_SHEETS_APP_ID env var) which broke the Google Sheets
picker in production.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-12 17:12:31 +02:00
Baptiste Arnaud
8e67415766
🐛 Fix Google Sheets picker 401 by setting Cloud Project AppId (#2486)
- Call `PickerBuilder.setAppId()` with the Cloud Project number when
building the Google Sheets picker (required by Google when the OAuth
flow uses the `drive.file` scope, otherwise the picker iframe returns
401).
- Add new optional client env var `NEXT_PUBLIC_GOOGLE_SHEETS_APP_ID` in
`packages/env`.
- Document the new variable and setup step in
`apps/docs/self-hosting/configuration.mdx`.

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

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:30:43 +02:00
Baptiste Arnaud
acd2f2971b
🔧 Remove "baseUrl": "." from tsconfigs 2026-03-25 16:40:12 +01:00
Baptiste Arnaud
c2b251c7e5
♻️ Migrate to NX (#2418) 2026-03-18 15:29:32 +00: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
5e0de89911
🔧 Add forward WA errors and campaign statuses option 2026-02-11 16:46:35 +01:00
Baptiste Arnaud
406ef51b07
Add onboarding email workflow and unsubscribe flow (#2370)
Adds onboarding email workflow with delayed send and suppression checks.
Introduces unsubscribe/resubscribe UI and API endpoints. Wires workflows
RPC config changes for user onboarding.
2026-01-26 14:09:08 +01:00
Baptiste Arnaud
81b5970a1c
🔧 Add Resend webhook bounce handler (#2366) 2026-01-23 16:51:04 +01:00
Baptiste Arnaud
80db9565cd
♻️ Upgrade to Zod v4 (#2355) 2026-01-19 10:51:20 +01:00
Baptiste Arnaud
8febf1a4bd
Introduce Effect-based workflow system (#2345) 2026-01-15 10:35:22 +01:00
Baptiste Arnaud
dd82c4d318
♻️ Migrate to Bun test 2025-11-27 12:08:31 +01:00
Baptiste Arnaud
27c9bf12e8
🧱 (results) Process results export in the background for big exports 2025-11-18 18:15:08 +01:00
Baptiste Arnaud
8da6dde890
🔥 Remove e2e tests from builder 2025-10-21 18:39:32 +02:00
Baptiste Arnaud
9688a297ad
🔧 Revert to carret version pinning 2025-10-03 10:51:27 +02:00
Baptiste Arnaud
50fe05f563
🔒️ Add potential trademark infrigement detection 2025-08-19 11:20:35 +02:00
Baptiste Arnaud
7d1b73bd4b
🚸 Add terms consent in onboarding bot
Closes #1964
2025-06-04 16:15:48 +02:00
Baptiste Arnaud
e2ccc7c26b
📈 Add landing page view tracking 2025-06-04 09:05:17 +02:00
Baptiste Arnaud
28c149c0c7
🧑‍💻 Make react package ssr compatible and deprecate nextjs package
Closes #1936
2025-05-22 12:05:40 +02:00
Baptiste Arnaud
af634875f7
🐛 Fix custom OAuth not working after Auth.js upgrade to v5
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
Closes #2161
2025-05-09 10:00:21 +02:00
Baptiste Arnaud
87252d0dc7
🔥 Remove deprecated edgeIdToTriggerWhenDone prop in typebotsQueue 2025-04-01 12:48:24 +02:00
Baptiste Arnaud
8ad53debef
🧑‍💻 Add configurable ToS URLs 2025-02-24 17:24:35 +01:00
Baptiste Arnaud
ce3c3aeae6
♻️ Upgrade next-auth and clean up config 2025-02-18 08:29:09 +01:00
Baptiste Arnaud
2f2064cb68
🧑‍💻 Option to disable email rejection on registration
Closes #1984
2025-02-08 15:37:54 +01:00
Baptiste Arnaud
06e6faa9d5
feat: integrate new brand (#1935) 2025-01-23 13:25:47 +01:00
abab-dev
ec7b2215f9
🧑‍💻 Add ignoreTLS option to SMTP configuration (#1943)
Fixes #1340
2025-01-06 10:27:38 +01:00
Baptiste Arnaud
7d1c9e664b
🔊 Improve whatsapp runtime logging
And update Sentry
2024-10-09 14:26:12 +02:00
Baptiste Arnaud
698eda7079
🔧 Add version filed in package json files 2024-10-09 08:31:03 +02:00
Baptiste Arnaud
59c0ea03cf
Add Webhook block (#1815)
Closes #1531
2024-10-07 11:44:28 +02:00
Baptiste Arnaud
a94f0f7ce7
🐛 Rename Google API keys for better clarity and granularity across auth, Sheets, and Fonts integrations.
Closes #1895
2024-09-26 09:58:30 +02:00
Baptiste Arnaud
10750f54d1
♻️ Use bun, biome, better ts config, new license and remove all barrel files (#1801)
Closes [#1754](https://github.com/baptisteArno/typebot.io/issues/1754)
2024-09-25 14:50:13 +02:00
Abhirup Basu
09277c264c
Implement Pexels videos option to media popover (#1636)
Closes #1575 

Note: Need to create a new environment variable named
`NEXT_PUBLIC_PEXELS_API_KEY` to store the API Key obtained from Pexels!


https://github.com/user-attachments/assets/4250f799-0bd7-48e9-b9a8-4bc188ad7704

---------

Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
Co-authored-by: younesbenallal <younes.benallal.06@gmail.com>
2024-07-22 19:41:01 +02:00
Baptiste Arnaud
6db0464fd7
Add attachments option to text input (#1608)
Closes #854
2024-06-26 10:13:38 +02:00
Baptiste Arnaud
bec9cb68ca
⬆️ Upgrade chakra version 2024-06-17 14:12:14 +02:00
Jeanluca
bb4bbd8f0e
🧑‍💻 Add keycloak auth provider (#1533)
#1529
2024-05-23 15:36:30 +02:00
Baptiste Arnaud
6fe4e28bc3
📝 Add new blog structure 2024-04-19 13:20:58 +02:00
Baptiste Arnaud
2fcf83c529
Introduce a new high-performing standalone chat API (#1200)
Closes #1154

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
	- Added authentication functionality for user sessions in chat API.
- Introduced chat-related API endpoints for starting, previewing, and
continuing chat sessions, and streaming messages.
- Implemented WhatsApp API webhook handling for receiving and processing
messages.
- Added environment variable `NEXT_PUBLIC_CHAT_API_URL` for chat API URL
configuration.

- **Bug Fixes**
	- Adjusted file upload logic to correctly determine the API host.
	- Fixed message streaming URL in chat integration with OpenAI.

- **Documentation**
- Updated guides for creating blocks, local installation, self-hosting,
and deployment to use `bun` instead of `pnpm`.

- **Refactor**
	- Refactored chat API functionalities to use modular architecture.
- Simplified client log saving and session update functionalities by
using external functions.
	- Transitioned package management and workflow commands to use `bun`.

- **Chores**
- Switched to `bun` for package management in Dockerfiles and GitHub
workflows.
	- Added new Dockerfile for chat API service setup with Bun framework.
	- Updated `.prettierignore` and documentation with new commands.

- **Style**
	- No visible changes to end-users.

- **Tests**
	- No visible changes to end-users.

- **Revert**
	- No reverts in this release.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-21 10:23:23 +01:00
thercd
df209a8e9d
🧑‍💻 (whatsapp) Option to modify the default interactive split message number (#1296)
When using the whatsapp oficial api or another that use the same schema,
with env we can modify the number of groups that the interactive group
will be split.

---------

Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
Co-authored-by: Baptiste Arnaud <contact@baptiste-arnaud.fr>
2024-03-07 08:05:08 +00:00
Baptiste Arnaud
5226b06fe1 🧑‍💻 Allow for custom 404 system messages 2024-02-12 09:18:54 +01:00
Baptiste Arnaud
26be94de37 🧑‍💻 (whatsapp) Set default template language to en_US 2024-02-08 10:00:14 +01:00
Baptiste Arnaud
9f0c6b3cc4 👷 Add posthog keys to github secrets 2024-02-03 11:35:04 +01:00
Baptiste Arnaud
92a1d672fd ♻️ Re-organize telemetry package 2024-02-01 14:19:24 +01:00
Clairton Rodrigo Heinzen
47af9a9a59 📝 Add env WHATSAPP_CLOUD_API_URL to possible change https://gr… (#1170)
refs #1117 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Dynamically construct API URLs for WhatsApp features using environment
variables for improved reliability and configurability.
- Updated `sendWhatsAppMessage` function to use
`env.WHATSAPP_CLOUD_API_URL` for URL construction, allowing for more
dynamic configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
2024-01-29 09:37:19 +01:00
Baptiste Arnaud
0b00fa7533 (radar) Add radar cumulative keyword alternatives check 2024-01-15 10:13:55 +01:00
Baptiste Arnaud
56e0342e86 🛂 (radar) Enable multiple RADAR_CUMULATIVE_KEYWORDS sets 2024-01-08 14:34:35 +01:00
Baptiste Arnaud
00f8bbc29b 🔒 (radar) Add cumulative keywords auto ban 2023-12-19 16:13:21 +01:00
Baptiste Arnaud
4fdc1bfe5c Introducing Radar, fraud detection 2023-12-08 18:16:07 +00:00