Skip to content

fix(deps): upgrade dependencies - #107

Merged
grandizzy merged 1 commit into
mainfrom
pyramid/c227908a-f71a-449d-be5a-20b83a1855ec
Nov 2, 2026
Merged

grandizzy merged 1 commit into
mainfrom
pyramid/c227908a-f71a-449d-be5a-20b83a1855ec

Conversation

@horsefacts

Copy link
Copy Markdown
Contributor

Fixes all 24 open Dependabot alerts on tip.bot (8 High, 14 Medium, 2 Low), plus the two Medium pnpm audit findings (glob, minimatch) that would otherwise fail CI's pnpm audit step.

Advisories fixed

Package Version change How Advisories
zod 4.4.3 / 4.6.5 → 4.6.6 package.json + zod: 4.6.6 override (mppx, MCP SDK, viem pulled 4.6.5) GHSA-mrhx-c7xc-m3w5 (High)
image-size 2.0.2 (locally patched) → 2.0.3 override; drops config/patches/image-size@2.0.2.patch, its patchedDependencies entry and the two auditConfig.ignoreGhsas exceptions GHSA-5p2g-fcmc-qvqq, GHSA-w3rx-r6r6-pgpr (High)
undici 7.29.1 → 7.30.1 override + packageExtensions GHSA-4w7w-5xrc-9h26, GHSA-2m5v-pch6-74hx, GHSA-qrxm-fqhp-jwvm, GHSA-xjj6-f33q-929c (High); GHSA-9fm3-97px-rjf6 (Medium)
toml 4.2.0 → 5.0.1 remark-mdx-frontmatter>toml override GHSA-4qx8-w7c3-pj3p, GHSA-9j65-hcg3-gc64, GHSA-9qmh-m7c6-f92p (High)
body-parser 2.3.0 → 2.4.0 override GHSA-27r3-jxmh-p828 (High)
follow-redirects 1.16.1 → 1.16.2 override GHSA-mrwp-f3q8-3g9p (High)
seroval 1.6.9 → 1.6.12 override GHSA-f86p-h4j2-7qgj, GHSA-9wx9-5pv9-3349 (Medium)
@hono/node-server 2.0.10 → 2.1.3 @hono/node-server@<2.1.3 override GHSA-rmxm-3fg6-px4f (Medium)
qs 6.16.0 → 6.16.2 override GHSA-6pq8-jhm2-2vcw (Medium)
fast-uri 3.1.8 → 3.1.9 override GHSA-w74x-v6f9-j3xg, GHSA-wjr9-j795-jxcr (Medium); GHSA-xhq7-xmqj-769h, GHSA-333x-w4r6-6crp (Low)
ip-address 10.7.1 → 10.7.4 override GHSA-rxp7-6hxx-x8q5 (Medium)
minimatch 5.1.9 / 9.0.9 → 11.0.3 readdir-glob>minimatch override GHSA-g3hv-75wg-m249 (Medium)
glob 10.5.0 → 14.0.2 archiver-utils>glob override GHSA-3g3m-2fjr-6pw4 (Medium, not a Dependabot alert yet; pnpm audit flags it)

All new versions are older than the repo's 1-day minimumReleaseAge, so no new minimumReleaseAgeExclude entries are needed. The stale excludes for the replaced versions (fast-uri@3.1.8, ip-address@10.7.1, undici@7.29.1) were removed. Comments in pnpm-workspace.yaml are kept.

glob and minimatch are major bumps, but they only affect dev and test code: testcontainers → archiver. archiver only calls glob.sync and new Minimatch(...), which glob 14 and minimatch 11 still export. I smoke-tested archiver('tar') with .glob() and .directory() on glob 14.0.2 and it worked.

src/lib/dependencyPatches.test.ts now loads image-size 2.0.3's dist/cjs and dist/esm builds (2.0.2 shipped .cjs/.mjs). It also has a regression check: a zero-length ICNS entry now throws, where 2.0.2 hung (checked against unpatched 2.0.2 with timeout 5).

Checks

  • pnpm install --frozen-lockfile (pnpm 11.0.7): pass
  • pnpm audit (the CI step): no vulnerabilities (before this PR it exited 1)
  • pnpm check: pass
  • pnpm check:types: pass
  • pnpm test: 15 files, 359 tests passed
  • pnpm build: pass
  • osv-scanner scan source -r .: no issues found
  • pnpm test:e2e: not run locally (needs Playwright browsers); left to CI

Exposure

  • zod (GHSA-mrhx-c7xc-m3w5): The OOM happens when a large array fails validation against an z.array schema. tip.bot uses array schemas only on Slack and X webhook bodies, and both are checked by HMAC signature before parsing: Slack at src/api.ts:1065, with its arrays at src/api.ts:1094 and src/lib/slack.ts:139 (used at src/chat.ts:285); X at src/api.ts:1041, which comes before Twitter.handleWebhook at src/api.ts:1047 and tweet_create_events: z.array at src/lib/twitter.ts:833. The public JSON validators in src/api.ts (hono.validator) have no array schemas. So an outside attacker cannot reach this path. Only Slack or X themselves, or someone holding the signing secrets, could send such a payload.
  • image-size (GHSA-5p2g-fcmc-qvqq, GHSA-w3rx-r6r6-pgpr): Not reachable in the live bot. It is a dependency of vocs, which tapimo uses for its docs app. tip.bot imports only tapimo/client (src/lib/tapimo.ts:2), and the pnpm build output does not contain image-size. The local patch already covered it, and this PR swaps the patch for the upstream fix.
  • toml, seroval, @hono/node-server, body-parser, qs, ip-address, fast-uri, follow-redirects, undici, glob, minimatch: These are pulled in by build or docs tooling (vocs, TanStack), test infrastructure (miniflare, testcontainers, prool, @slack/web-api dev tooling), or by Express/MCP-SDK paths in mppx and tapimo that the Worker does not serve. None of them handles attacker input on the bot's request path. seroval is in the TanStack Router SSR bundle, but it only serializes server-produced data.

Dependency scan (centaur-tempo dependency-scan)

  • osv-scanner on pnpm-lock.yaml: before this PR, 3 Medium (glob, 2× minimatch); after, none.
  • zizmor: no findings (17 ignored, 50 suppressed by the repo's config).
  • pinact: every action is pinned to a SHA. It suggests major upgrades (actions/checkout v7, cache v6, upload-artifact v7, setup-node v7). These are left out of this PR as a separate change.
  • No .github/dependabot.yml: alerts and security updates come from repo settings. Version updates and cooldown are not configured.
  • pnpm hardening: minimumReleaseAge: 1440, minimumReleaseAgeStrict, blockExoticSubdeps, strictDepBuilds and allowBuilds are set. trustPolicy: no-downgrade is not set.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedzod@​4.4.3 ⏵ 4.6.6100100 +1610095100

View full report

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this PR and didn't find any bugs. A human should still take a look, because it changes runtime dependencies: zod moves from 4.4.3 to 4.6.6 and a global override puts viem, mppx and the MCP SDK on that same version. It also forces major-version bumps through overrides (toml 5, glob 14, minimatch 11).

What was reviewed:

  • pnpm-workspace.yaml: each new or bumped override has a matching lockfile entry. The image-size patch, its patchedDependencies entry and both ignoreGhsas exceptions are removed together, so no audit exception is left without its patch.
  • Lockfile: zod 4.4.3 and 4.6.5 collapse to 4.6.6 everywhere. glob 10's helper packages (jackspeak, foreground-child, path-scurry 1, minimatch 9) are dropped cleanly.
  • src/lib/dependencyPatches.test.ts: the image-size path now uses the dist/cjs and dist/esm folders, and a new check covers the zero-length ICNS hang (GHSA-w3rx-r6r6-pgpr).
Extended reasoning...

The change bumps dependency versions in package.json, pnpm-workspace.yaml and pnpm-lock.yaml, removes the local image-size patch in favor of upstream 2.0.3, and adjusts one regression test. It does not touch the bot's own code paths. However, zod is the runtime validator for webhook and API payloads, and the new global zod override also affects viem, mppx and the MCP SDK. Combined with three forced major-version bumps (toml under remark-mdx-frontmatter, glob and minimatch under archiver), that is enough to want a maintainer's look at compatibility. The bug hunt found nothing, and the overrides are documented in comments.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest Tipbot preview deployment for 5689943

Name Status Preview Updated (UTC)
pr107 Shut Down Shut Down pr107.tip.bot Nov 2, 2026, 4:02 PM

@grandizzy
grandizzy merged commit 017d200 into main Nov 2, 2026
9 checks passed
@grandizzy
grandizzy deleted the pyramid/c227908a-f71a-449d-be5a-20b83a1855ec branch November 2, 2026 16:01
sds added a commit that referenced this pull request Nov 21, 2026
… CLOUDFLARE_API_TOKEN (#111)

**Merge after** tempoxyz/cloudflare-deploy-policies#293 has merged and
its **Publish policies** run has succeeded. See "Merge after" below.

**Draft on purpose.** A ready pull request gets a preview: `preview.yml`
on `main` runs this branch's code with the `preview` environment's
token. `main`'s `preview_deploy.yml` does not yet replace this branch's
new `tipbot-preview-name` placeholder, so that preview would create a D1
database, Queues and a Slack app and then fail at **Run migrations**.
Mark it ready just before merging. Previews of pull requests opened
after it merges work.

## Summary

A push to `main` now deploys the `tipbot` Worker (https://tip.bot)
through the [Cloudflare Deploy
Broker](https://github.com/tempoxyz/cloudflare-deploy-broker). No job of
`production.yml` holds a Cloudflare credential any more, so the
`production` environment's `CLOUDFLARE_API_TOKEN` and
`CLOUDFLARE_ACCOUNT_ID` become unused. The Worker keeps its name, D1
database, Durable Objects, Queue, AI binding, cron, custom domain and
secrets. Previews are unchanged and still use the `preview`
environment's token; see "Previews" below.

## Why production.yml has been failing

Every Production run since 2026-11-04 (#95's merge) fails at **Run
migrations**, so nothing after #107 has deployed. `tipbot` still serves
version `54437c81`, which run 41477298036 deployed on 2026-11-02 with
this workflow (author `tom@tempo.xyz`, the owner of the API token).

- The step is `wrangler d1 migrations apply tipbot --env production
--remote`. Wrangler reads the ledger and lists
`0026_tempo_workspace_ousd.sql`, #95's one `UPDATE`, as pending. Then D1
refuses to run it: `You do not have permission to perform this
operation. [code: 7500]` (runs 41924847485 and 42512225697).
- So the token can read the database but not write it. 0026 is the first
migration since 0025 on 2026-06-05, and the 11-02 run had none to apply,
so this is the first D1 write the token has attempted in five months.
- Someone replaced `CLOUDFLARE_API_TOKEN` in both environments on
2026-11-17 22:23 UTC and re-ran 42512225697 a minute later. It failed
the same way, so the new token cannot write D1 either. It is probably a
user token whose owner's tempo-prd role lacks D1 write, or a token
without D1 Edit. I could not check which, because I can't read either.

The broker applies 0026 with its own credential, so this PR also fixes
the failure, provided the database accepts the statement.

## Before / after

| Area | Before | After |
| --- | --- | --- |
| D1 migrations | `wrangler d1 migrations apply` with the static token |
The broker applies pending migrations from the attested `db/migrations`
before it uploads, and stops before promotion if one fails |
| Build | `pnpm build` in the deploy job, with the token in the job |
The trusted `cloudflare-deploy-broker-build.yml` (gh-actions `1a535d66`)
runs `pnpm build:broker` and attests the Worker, its 48 chunks,
`dist/server/wrangler.json`, `dist/client` and the migrations. No
credential |
| Deploy | Vendored wrangler-action, `deploy --env production`, plus
`wrangler secret bulk` of 15 secrets | `cloudflare-deploy-broker` with
deployment ID `tipbot`, then a check that `https://tip.bot/api/health`
(which queries D1) returns 200 |
| Secrets | Re-uploaded from the `production` environment on every
deploy | Kept on the Worker. Change them in the broker dashboard
(https://cf.tehq.net/, Workers tab) |
| Slack app ID | `vars.SLACK_APP_ID` in the deploy job | A `Settings`
job in the `production` environment reads it and passes it to the build.
It is public: tip.bot serves it in a meta tag |
| Concurrency | None | One Production run at a time, never cancelled |
| Slack app update | After deploy | Unchanged |

## Changes needed for the broker build

- **Wrangler 4.91.0 → 4.151.0.** The builder rejects Durable Object
`migrations` and needs `exports`, which Wrangler 4.91 does not
understand. 4.151.0 is already in the lockfile through
`@cloudflare/vitest-plugin`, so the lockfile only switches the importer;
no new package is added. `@cloudflare/vite-plugin` 1.37.0 accepts it
(`^4.91.0`).
- **`src/worker-configuration.d.ts`** is regenerated by `pnpm
gen:types`. Wrangler now declares `Env` and `Cloudflare.Env` as
extensions of a generated `__BaseEnv_Env`, so `src/env.d.ts` adds its
stronger types to both.
- **The preview Worker name placeholder** is `tipbot-preview-name`
instead of `__PREVIEW_NAME__`, because Wrangler 4.151's `wrangler types`
rejects a Worker name with capitals or underscores. `preview_deploy.yml`
replaces both, so branches from before this PR still preview.
- **`scripts/broker-build.ts`** (`pnpm build:broker`) runs `pnpm build`
for production, then adjusts the generated `dist/server/wrangler.json`:
- It declares the live Durable Object classes as exports, derived from
`wrangler.jsonc`'s migrations: `TipbotChatStateDO` as SQLite (created as
`ChatStateDO`, renamed in `tipbot_chat_state_v2`) and `NonceStorage` as
`legacy-kv`. The broker never replays migrations. `wrangler.jsonc` keeps
them for previews and local development.
- It makes `migrations_dir` relative to the generated file, adds the
`ASSETS` binding the broker requires (nothing reads it), and deletes the
Vite plugin's `.assetsignore`, which the broker rejects and which lists
only files the client build does not write.
- **`wrangler.jsonc`** sets `account_id` (tempo-prd) in
`env.production`, which the builder requires.
- **`db/migrations/0020_telegram_provider.sql`** is a no-op placeholder.
Production run 26782816327 applied an earlier file of that name
(327ef06) before 954bf9b reverted it, so the production ledger still
records it. Wrangler ignores applied names it has no file for; the
broker requires every recorded name to be one of the attested manifest's
first ones, and otherwise fails with `d1_migration_history_mismatch`. On
a fresh database (local, tests, previews) the placeholder runs one
`UPDATE … WHERE 0`. It sorts before `0020_tip_ask.sql`, after 0019.

## Also: `pnpm audit`

c34b6d2 is separate from the migration. `main`'s Verify job now fails
`pnpm audit` on seven advisories published since #109: hono below
4.13.16 (GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq and five others) and
`@hono/node-server` below 2.1.6 (GHSA-qv5m-9pm6-hqp3,
GHSA-jpvv-r467-5p4w). This PR fails the same way without a fix, so it
pins hono 4.13.19 and overrides `@hono/node-server` to 2.1.9 (both older
than the one-day release-age policy). These are patch releases.

## Secrets

The broker keeps the live Worker's secrets. `wrangler secret list --name
tipbot` (names only) shows all 14 that `wrangler.jsonc` requires
(`FEE_PAYER_PRIVATE_KEY_MAINNET`, `FEE_PAYER_PRIVATE_KEY_TESTNET`,
`SECRET_KEY`, `SLACK_CLIENT_ID`, `SLACK_CLIENT_SECRET`,
`SLACK_SIGNING_SECRET`, `TEMPO_API_KEY`, and the seven `TWITTER_*`),
plus `RPC_CREDENTIALS`, which `src/lib/tempo.ts` reads, and
`TELEGRAM_BOT_TOKEN` and `TELEGRAM_WEBHOOK_SECRET_TOKEN`, which nothing
reads since the Telegram revert.

> [!IMPORTANT]
> The `production` environment's `RPC_CREDENTIALS` was updated on
2026-11-12, after the last successful deploy (11-02). Every deploy since
has failed, so the Worker still has the earlier value, and this workflow
no longer uploads secrets. If the new value should be live, set
`RPC_CREDENTIALS` in the broker dashboard. No other production secret
changed after 11-02.

## Behavior to review

- **Source maps.** `upload_source_maps` stays in `wrangler.jsonc`, but
the broker never uploads source maps, so production stack traces will
not be source-mapped.
- **New binding.** The first broker deploy adds `ASSETS`. Assets are
still served directly, before the Worker, as now.
- **The first deploy applies 0026** (sets OUSD as the default token for
Tempo's own Slack workspace), which has been pending since 11-04.
- **Changing bindings needs a policy change.** After the first deploy,
the broker's remembered grant authorizes code, vars, assets and new D1
migrations. A new binding, Durable Object class or resource ID needs a
policy entry in tempoxyz/cloudflare-deploy-policies first.
- **The `Settings` job records a deployment** to the `production`
environment before the build, because it reads that environment's
`SLACK_APP_ID`.
- **This PR's CI does not run the broker build**, which runs only on
push to `main`. I replayed it (see Validation).

## Previews

PR code runs while the `preview` environment's token is in the job.
`preview.yml` loads from `main`, but `preview_deploy.yml`'s deploy job
checks out the pull request's commit and then runs its code in the same
job as the token: its `setup-pnpm` composite action and lockfile,
`src/lib/*.ts`, `scripts/slack.ts`, its `wrangler` for `queues create`,
`d1 migrations apply` and `deploy`, `vite.config.ts` during the build,
and `scripts/preview-seed.ts` with `CLOUDFLARE_API_TOKEN` in its
environment. The token can edit every Worker and every D1 database in
tempo-prd. `preview-seed.ts` also reads the production `tipbot`
database. Both environments' tokens were replaced in the same second on
11-17, so they are probably the same token.

The broker's isolated previews cannot do this: each preview creates its
own Worker, D1 database and Queues, attaches `pr<n>.tip.bot`, and binds
secrets. Moving previews to STS safely means splitting
`preview_deploy.yml` so the pull request's code only builds, without
credentials, and code from `main` does every privileged step. That is a
larger change of the Slack and seeding steps too, and it cannot run
before it merges, so this PR leaves previews as they are. It is listed
as a decision for the owner.

## Validation

- `pnpm audit` reports no known vulnerabilities, and `pnpm check`, `pnpm
check:types` and `pnpm test --project unit` pass locally. `pnpm
db:migrate` and `pnpm db:codegen` on a fresh local database apply all 30
migrations and leave `db/types.gen.ts` and `db/schemas.gen.ts`
unchanged.
- actionlint passes. zizmor 1.30.1 (offline) reports no findings, as on
`main`.
- I replayed the pinned builder on this branch: its install, its `pnpm
build:broker` build command and every packaging step, on macOS and in a
`node:24.22.1` Linux container. Every builder check passes. It attests
`index.js` plus 48 `esm` modules (6.9 MB), 32 assets (6.3 MB, all with
known media types) and 30 migrations.
- tempoxyz/cloudflare-deploy-policies#293's policy accepts that
configuration and module manifest at the publisher's `BROKER_REF` and at
broker `main`, and rejects drifted ones (preview URLs on, another D1
database, another Worker, an extra route, a KV namespace, `NonceStorage`
as SQLite).

## Merge after

1. tempoxyz/cloudflare-deploy-policies#293 merges and **Publish
policies** succeeds. Before that, the broker refuses the existing Worker
name ("an explicit policy is required") and the current version keeps
serving.
2. Before merging, optionally confirm the ledger row: `wrangler d1
execute tipbot --remote --env production --command "SELECT name FROM
d1_migrations ORDER BY id"` should list `0020_telegram_provider.sql`. If
it does not, delete `db/migrations/0020_telegram_provider.sql` from this
PR.

## After merge

1. Confirm the merge push's **Production** run succeeds (the bootstrap
deploy), the deploy step reports a promoted version, and
https://tip.bot/api/health returns 200. The broker dashboard
(https://cf.tehq.net/) should show `tipbot` promoted.
2. Remove the bootstrap entry `policies/tempoxyz/tip.bot.yaml` from
tempoxyz/cloudflare-deploy-policies. Later deploys use the remembered
grant.
3. Set `RPC_CREDENTIALS` in the broker dashboard if the 11-12 value
should be live (see Secrets).
4. Delete the `production` environment's `CLOUDFLARE_API_TOKEN` and
`CLOUDFLARE_ACCOUNT_ID`. Nothing reads them after this PR. The
environment's Worker secrets (`FEE_PAYER_*`, `RPC_CREDENTIALS`,
`SECRET_KEY`, `SLACK_CLIENT_*`, `SLACK_SIGNING_SECRET`, `TEMPO_API_KEY`,
`TWITTER_*`, `TELEGRAM_*`) are unread too; delete them only if no one
needs them as the copy of record. Keep `vars.SLACK_APP_ID`.
5. Do not revoke the Cloudflare token yet. The `preview` environment's
`CLOUDFLARE_API_TOKEN` is probably the same token, and previews still
use it.

If the bootstrap deploy fails before promotion, the current version
keeps serving. Reverting this PR restores the Wrangler workflow, which
still fails at the D1 migration.

This branch was previously deployed

1 inactive deployment
preview — 56899439 Deployed Nov 2, 2026 by grandizzy via Destroy #79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants