Skip to content

fix(security)!: harden storage, media, tenant lifecycle and webhooks - #1290

Merged
leifermendez merged 6 commits into
builderbotfrom
fix/high-priority-audit-hardening
Nov 17, 2026
Merged

leifermendez merged 6 commits into
builderbotfrom
fix/high-priority-audit-hardening

Conversation

@leifermendez

@leifermendez leifermendez commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Que tipo de Pull Request es?

  • Mejoras
  • Bug
  • Docs / tests

Descripción

Harden six audited boundaries with one coherent commit per correction, keeping regression tests and documentation alongside each behavior change.

Linked issues

Refs #1284, #1285, #1286, #1287, #1288, #1289.

All six tracking issues have maintainer-authorized status:approved. These references intentionally do not automatically close issues.

Changes

Scope Change Commit
MySQL history Bind sender as a query parameter and stop callback execution after rejecting a driver error e454a37d
Twilio media Attach credentials only to supported HTTPS api.twilio.com URLs, without URL credentials or custom ports 8fdf9214
Email attachments Normalize path separators and reduce remote filenames to a basename before writing c9feb0ad
Tenant lifecycle Retain/stop the core runtime before removal and detach only its provider listeners, preserving disconnect cleanup fb8069a7
Dynamic keywords Reject invalid runtime regex patterns at the API and registry boundaries before mutation b3ff8dc2
Chatwoot webhooks Require a matching secret and exact-byte HMAC verification before sends or blacklist mutations 56927bf8

Breaking security migration

Inbound Chatwoot webhooks now require webhookSecret, the original request bytes, and valid signing headers. Unsigned/invalid automatic requests receive HTTP 401. Manual handleWebhook callers must pass the verification argument. Outbound-only mirroring can still omit inbound webhook options.

Create or reuse the actual webhook in Chatwoot, copy that webhook's signing secret (not the API token), and configure the bot before restarting. Automatic webhook registration does not provision/retrieve its signing secret. See packages/plugins/chatwoot/README.md.

Verification observed during implementation

Behavior-first regressions were observed failing before their fixes, then passing. Commands used installed UVU/Jest binaries without installing dependencies.

Affected package Full package result
database-mysql 32 passed
provider-twilio 45 passed
provider-email 83 passed
manager 267 passed, including HTTP validation and a rebuilt-bot seam check
bot 209 passed; one pre-existing skip
plugins/chatwoot 41 passed
  • Six affected packages built successfully using installed Rollup.
  • ESLint and Prettier checks passed on all 19 changed TypeScript files; git diff --check passed.
  • Independent verifier: S1–S7 met, no change-caused blocker found; focused checks rerun successfully.
  • Native review consent was declined for this exact committed candidate. No native lineage, verdict or approval is claimed.
  • Full pre-push hook: passed. In the corrected isolated worktree outside .git, Lerna/Nx successfully ran tests for all 29 projects and their two dependency tasks. The initial .git worktree attempt failed Jest discovery; one corrected attempt was explicitly authorized. No hook bypass or dependency installation was used.
  • GitHub CI run 44167861269, exact head 56927bf8, attempt 2: Templates in sync passed and Tests passed. Attempt 1 (Templates in sync) was cancelled at its 15-minute limit because the pnpm cache was cold; the install takes about 10 minutes from scratch. Re-running only the failed job restored the cache saved by the Tests job, and every step including Check generated templates then passed. No workflow change or hook bypass was used.
  • Real-service Twilio/Chatwoot integration tests: not run. Download/write boundaries use mocks; the keyword API regression uses real loopback HTTP.
  • ShellCheck, UI/browser checks and skill-load tests: not applicable; no shell scripts, UI or skills changed.

Review scope and risk

This maintainer-selected single PR contains 765 authored additions/deletions across six work units. It is intentionally not a PR chain. Review security boundaries and the Chatwoot migration first; the per-correction commits preserve rollback boundaries.

Risk: security/credential changes and tenant lifecycle/concurrency. Existing Twilio redirect handling is unchanged. Timestamp freshness limits stale replay, but deliveries within the five-minute window are not deduplicated.

Out of scope: other open PRs, other providers' webhook authentication, the previous audit reports/ODD tracker, real deployment configuration, and unrelated audit advisories. No existing PR is closed or merged by this change.

Contributor checklist

  • Six approved issues linked using nonclosing Refs
  • Conventional commits with tests/docs by correction; no co-author trailers
  • Regression tests, preserved supported behavior and rejection side effects checked
  • Chatwoot migration documented
  • Exactly one PR type label applied (type:breaking-change)
  • Required GitHub CI at this PR head passed — both Templates in sync and Tests are green on the reviewed head

@leifermendez leifermendez added the type:breaking-change Intentional compatibility change requiring migration label Nov 17, 2026
@leifermendez
leifermendez merged commit 24390d5 into builderbot Nov 17, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:breaking-change Intentional compatibility change requiring migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant