0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
Commit graph

33 commits

Author SHA1 Message Date
Dane - AI (Mastra)
a1c11c5b11
chore(deps): update better-auth monorepo to v1.7.22 (#30464)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
|
[@better-auth/drizzle-adapter@<1.7.7](https://www.better-auth.com/docs/adapters/drizzle)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/drizzle-adapter))
| pnpm-workspace.overrides | patch | [`1.7.18` →
`1.7.22`](https://renovatebot.com/diffs/npm/@better-auth%2fdrizzle-adapter/1.7.18/1.7.22)
| `1.7.25` (+2) |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| pnpm-workspace.overrides | patch | [`^1.7.18` →
`^1.7.22`](https://renovatebot.com/diffs/npm/better-auth/1.7.18/1.7.22)
| `1.7.25` (+2) |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| dependencies | patch | [`^1.7.18` →
`^1.7.22`](https://renovatebot.com/diffs/npm/better-auth/1.7.18/1.7.22)
| `1.7.25` (+2) |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

---

### Release Notes

<details>
<summary>better-auth/better-auth
(@&#8203;better-auth/drizzle-adapter@<1.7.7)</summary>

###
[`v1.7.22`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1722)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.21...v1.7.22)

##### Patch Changes

-
[#&#8203;12333](https://redirect.github.com/better-auth/better-auth/pull/12333)
[`6536174`](6536174213)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`getSession` failing with "Failed to get session" when a
`user.additionalFields` entry references a table outside the Better Auth
schema, including with database joins enabled on Drizzle and Prisma.
Join resolution now matches `references.model` against schema keys only.

###
[`v1.7.21`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1721)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.20...v1.7.21)

###
[`v1.7.20`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1720)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.19...v1.7.20)

###
[`v1.7.19`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1719)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.18...v1.7.19)

</details>

<details>
<summary>better-auth/better-auth (better-auth)</summary>

###
[`v1.7.22`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1722)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.21...v1.7.22)

##### Patch Changes

-
[#&#8203;12324](https://redirect.github.com/better-auth/better-auth/pull/12324)
[`80c407b`](80c407b7ca)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`ReferenceError: window is not defined` when a client session
subscription is cleaned up after a test environment such as happy-dom
tears down its globals.

-
[#&#8203;12462](https://redirect.github.com/better-auth/better-auth/pull/12462)
[`d32a30a`](d32a30af37)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
session polling never firing when the runtime's `navigator` does not
report connectivity.

-
[#&#8203;12324](https://redirect.github.com/better-auth/better-auth/pull/12324)
[`80c407b`](80c407b7ca)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
client session refresh listeners piling up on the server during SSR.

-
[#&#8203;12321](https://redirect.github.com/better-auth/better-auth/pull/12321)
[`946177e`](946177e509)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
Revoking your current session with `revokeSession` or `revokeSessions`,
and deleting your account with `deleteUser({ token })`, now expire the
session cookies, so a cached session is no longer returned afterwards.

-
[#&#8203;12459](https://redirect.github.com/better-auth/better-auth/pull/12459)
[`d210421`](d210421a26)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
`getSession` no longer leaves an expired session in the request context
after returning `null`.

-
[#&#8203;12331](https://redirect.github.com/better-auth/better-auth/pull/12331)
[`485567e`](485567e2c9)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - OAuth
sign-up rejected by a `user.create.before` hook returning `false` no
longer logs a `TypeError`. It still fails with `unable_to_create_user`.

-
[#&#8203;12334](https://redirect.github.com/better-auth/better-auth/pull/12334)
[`ec3047d`](ec3047da81)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`deleteOrganization` clearing the session's active organization when a
`beforeDeleteOrganization` hook rejected the delete. The active
organization is now cleared only after the organization is actually
deleted.

-
[#&#8203;12330](https://redirect.github.com/better-auth/better-auth/pull/12330)
[`d521343`](d521343fc3)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`deferSessionRefresh` refresh requests failing with 415 in Next.js and
Nuxt, where the bodyless `POST /get-session` reached the handler as an
empty stream without a `Content-Type`.

-
[#&#8203;12451](https://redirect.github.com/better-auth/better-auth/pull/12451)
[`71052af`](71052af880)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - On
Cloudflare Workers, consuming a verification value no longer hangs when
an earlier request for the same identifier ended mid-query. A superseded
code can also no longer be consumed while a newer one is being verified
on a database without transactions.

-
[#&#8203;12448](https://redirect.github.com/better-auth/better-auth/pull/12448)
[`79219b4`](79219b4f8e)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Schema
validation now runs when the auth instance is first used instead of when
it is created, so a module-scope instance on Cloudflare Workers no
longer logs a validation error on every cold start. On every runtime, a
mismatch is no longer logged at startup and is reported by the requests
that fail.

- Updated dependencies
\[[`6536174`](6536174213),
[`262adc0`](262adc0e76),
[`e9d8e59`](e9d8e5977c),
[`79219b4`](79219b4f8e)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.22
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.22
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.22
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.22
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.22
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.22
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.22

###
[`v1.7.21`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1721)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.20...v1.7.21)

##### Patch Changes

-
[#&#8203;12126](https://redirect.github.com/better-auth/better-auth/pull/12126)
[`4739122`](4739122fa6)
Thanks
[@&#8203;hardikguptaofficialgit](https://redirect.github.com/hardikguptaofficialgit)!
- On Prisma with MongoDB, when your id columns use `@db.ObjectId`, magic
link and email OTP sign-in for users with an unverified email no longer
fail with a 500 (`Malformed ObjectID`). SAML sign-in, DPoP-bound OAuth
requests, and `private_key_jwt` client authentication are fixed the same
way, and Sign-In with Ethereum now keeps the email the user supplied
instead of a placeholder. Setups with plain `String` id columns and
other databases are unaffected.

-
[#&#8203;12392](https://redirect.github.com/better-auth/better-auth/pull/12392)
[`a277020`](a277020fa3)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Fixed the device approval page showing a valid code as invalid when
the same signed-in user looked it up twice at once, such as under React
Strict Mode in development.

-
[#&#8203;12052](https://redirect.github.com/better-auth/better-auth/pull/12052)
[`1c3410a`](1c3410a5c3)
Thanks
[@&#8203;lakshya-dhariwal](https://redirect.github.com/lakshya-dhariwal)!
- If you set `advanced.backgroundTasks.handler` and your database
adapter runs transactions (the built-in Kysely connection, MongoDB with
`client`, or Prisma or Drizzle with `transaction: true`), email sign-up
now keeps the database writes made while sending the verification email
or running `onExistingUserSignUp`. Before, those writes failed because
the sign-up had already been saved. With `emailOTP({
overrideDefaultEmailVerification: true })`, the code was never stored,
so new users could not verify their email.

Whatever adapter or background handler you use, a sign-up verification
email now goes out after the new user is saved, and
`onExistingUserSignUp`, when a duplicate sign-up triggers it, runs after
the request's database work completes. If `sendVerificationEmail`
throws, the sign-up succeeds and the error is logged; before, the
sign-up failed. To reject a sign-up, use a
`databaseHooks.user.create.before` hook. If `onExistingUserSignUp`
throws, the error is logged and the request still returns the generic
response.

-
[#&#8203;12179](https://redirect.github.com/better-auth/better-auth/pull/12179)
[`9105261`](91052614cb)
Thanks [@&#8203;ghazy2001](https://redirect.github.com/ghazy2001)! -
Generic OAuth providers configured with `discoveryHeaders` now send
those headers when fetching the provider's signing keys from a
`jwks_uri` on the same origin as `discoveryUrl`. Before, the keys
request went out without them. Providers whose key endpoint requires the
headers rejected it, so every ID token failed verification and sign-in
failed. A `jwks_uri` on another origin still gets no headers.

With `discoveryHeaders` set, the discovery request now follows redirects
only within the origin of `discoveryUrl`, so the headers no longer reach
another host. If your `discoveryUrl` redirects to another origin,
discovery now fails and Better Auth logs an error. Set `discoveryUrl` to
the final URL. Providers without `discoveryHeaders` are unaffected.

-
[#&#8203;12401](https://redirect.github.com/better-auth/better-auth/pull/12401)
[`c3a94c5`](c3a94c546a)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Generic OAuth providers configured with `authorizationHeaders` now
send those headers when refreshing an access token, not only when
exchanging the authorization code. Before, a provider whose token
endpoint requires one of those headers accepted the sign-in but rejected
every refresh. Providers without `authorizationHeaders` are unaffected.

`refreshAccessToken` and `refreshAccessTokenRequest` from
`@better-auth/core/oauth2` accept an optional `headers` input for
providers that need extra headers on refresh. Client authentication
headers still take precedence over it.

Extra headers whose names differ only in case from a client
authentication header, such as `Authorization` with `authentication:
"basic"`, no longer produce a combined, invalid header on the code
exchange or refresh. Client authentication replaces them, including
headers a custom `tokenEndpointAuth` hook sets in any casing.

-
[#&#8203;12404](https://redirect.github.com/better-auth/better-auth/pull/12404)
[`9b40ac6`](9b40ac62af)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Plugin
packages no longer import from the `better-auth` root, so bundlers that
split code stop emitting unused Kysely chunks when used with
`better-auth/minimal`.

-
[#&#8203;12395](https://redirect.github.com/better-auth/better-auth/pull/12395)
[`b0ced9d`](b0ced9d257)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- On Cloudflare Workers, sign-ins with a `genericOAuth` provider that
uses `discoveryUrl`, and OAuth provider requests that use a configured
resource (`resources`), no longer hang. An auth instance created at
module scope retries discovery and resource seeding on later requests.
Previously, if the request running that retry ended first, every later
request that needed it waited forever. Each request now retries on its
own until one succeeds.

On other runtimes, concurrent requests may send a few more discovery
requests or resource lookups while the identity provider or database is
unreachable.

-
[#&#8203;11912](https://redirect.github.com/better-auth/better-auth/pull/11912)
[`5c12074`](5c120747e4)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- If you use PostgreSQL and other schemas in the same database are
dropped while Better Auth reads the database, for example one schema per
tenant or parallel test runs, the startup schema check and `npx
auth@latest migrate` no longer fail intermittently with `schema "…" does
not exist` or `relation "…" does not exist`. The startup schema check
now reads only the schemas on the connection's `search_path`, plus any
schema set with `schemaName` or a schema plugin, and `migrate` reads
only the schema it migrates. Before, both read every schema in the
database. If no other schemas change while Better Auth reads the
database, nothing changes for you.

-
[#&#8203;12403](https://redirect.github.com/better-auth/better-auth/pull/12403)
[`e64f624`](e64f624273)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - SIWE
verification no longer includes the internal error message (for example
a database error) in its 401 response. The original error is now logged
on the server instead.

- Updated dependencies
\[[`4739122`](4739122fa6),
[`c3a94c5`](c3a94c546a),
[`4080630`](40806302bf),
[`5c12074`](5c120747e4),
[`b241ffc`](b241ffc940),
[`57fa843`](57fa8432d8),
[`1a79da5`](1a79da5067),
[`2d10ae7`](2d10ae733e),
[`ef4d4f7`](ef4d4f7dc4)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.21
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.21
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.21
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.21
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.21
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.21
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.21

###
[`v1.7.20`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1720)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.19...v1.7.20)

##### Patch Changes

- Updated dependencies
\[[`a3f50d0`](a3f50d064d),
[`e9b43d7`](e9b43d7149),
[`265629c`](265629cb95),
[`e9b43d7`](e9b43d7149)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.20
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.20
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.20
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.20
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.20
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.20
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.20

###
[`v1.7.19`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1719)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.18...v1.7.19)

##### Patch Changes

-
[#&#8203;12323](https://redirect.github.com/better-auth/better-auth/pull/12323)
[`a10121d`](a10121d33c)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
the `active-sessions` list in secondary storage being stored without an
expiry when the last remaining session had less than a second left.

-
[#&#8203;12335](https://redirect.github.com/better-auth/better-auth/pull/12335)
[`c41f8ff`](c41f8ff087)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`/admin/create-user` leaving a user without a credential account when
the password was rejected (for example by the Have I Been Pwned plugin),
which made retrying with the same email fail with
`USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL`.

-
[#&#8203;12338](https://redirect.github.com/better-auth/better-auth/pull/12338)
[`e786566`](e786566dc5)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`/admin/create-user` leaving a user without a credential account when
creating that account failed, which made retrying with the same email
fail with `USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL`.

-
[#&#8203;12336](https://redirect.github.com/better-auth/better-auth/pull/12336)
[`ac778b7`](ac778b70e9)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Client
actions now send the HTTP method passed in the second-argument fetch
options, the same as when it is nested under `fetchOptions`. Passing a
lowercase `get` or `HEAD` method no longer fails because a request body
was attached.

-
[#&#8203;12246](https://redirect.github.com/better-auth/better-auth/pull/12246)
[`5eb69d8`](5eb69d8371)
Thanks
[@&#8203;AryaKesharwani](https://redirect.github.com/AryaKesharwani)! -
`/device/token` now returns `invalid_client` instead of `invalid_grant`
when `validateClient` rejects the `client_id`, matching `/device/code`
and RFC 6749 section 5.2.

-
[#&#8203;12319](https://redirect.github.com/better-auth/better-auth/pull/12319)
[`4b0327b`](4b0327bfa3)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Plugin
schema overrides (`modelName` and field names) no longer leak into other
instances of the same plugin in one process.

-
[#&#8203;12320](https://redirect.github.com/better-auth/better-auth/pull/12320)
[`2d5ef64`](2d5ef64dae)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
OAuth sign-in failing with `state_mismatch` during the daylight saving
time fall-back hour on servers that do not run in UTC. The stored OAuth
state is no longer created already expired.

-
[#&#8203;12337](https://redirect.github.com/better-auth/better-auth/pull/12337)
[`5f0a0fc`](5f0a0fcef3)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - The
OpenAPI schema now documents query parameters for endpoints whose query
schema is wrapped in `z.optional()`, such as `/get-session` and Stripe's
`/subscription/list`.

-
[#&#8203;12332](https://redirect.github.com/better-auth/better-auth/pull/12332)
[`89e74b8`](89e74b81e5)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`organization.getInvitation` returning a missing, expired, or
non-pending invitation error without a `code`. It now returns
`INVITATION_NOT_FOUND` like the other invitation endpoints.

-
[#&#8203;12318](https://redirect.github.com/better-auth/better-auth/pull/12318)
[`525bd7a`](525bd7a7d8)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`listMembers` failing with a syntax error on PostgreSQL and MSSQL when
the filter or offset matches no members.

-
[#&#8203;12366](https://redirect.github.com/better-auth/better-auth/pull/12366)
[`23a60a3`](23a60a31f4)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
SIWE sign-in leaving a user behind when creating its wallet address or
account failed, which blocked that wallet from signing in again.

-
[#&#8203;12340](https://redirect.github.com/better-auth/better-auth/pull/12340)
[`29e45f8`](29e45f84d5)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
social sign-up hanging on single-connection databases when the username
plugin is enabled and the provider profile maps a username.

- Updated dependencies
\[[`8412a5f`](8412a5f43b),
[`34ee100`](34ee1008d8)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.19
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.19
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.19
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.19
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.19
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.19
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.19

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am every weekday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend Renovate
CLI](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMzkuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjIzOS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-15 17:48:36 -08:00
Dane - AI (Mastra)
93290db03e
chore(deps): update security updates [security] (#30258)
> [!NOTE]
> This PR body was truncated due to platform limits.

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@hono/node-server](https://redirect.github.com/honojs/node-server) |
devDependencies | patch | [`2.1.6` →
`2.1.7`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/2.1.6/2.1.7)
|
| [@hono/node-server](https://redirect.github.com/honojs/node-server) |
dependencies | patch | [`2.1.6` →
`2.1.7`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/2.1.6/2.1.7)
|
| [@hono/node-server@>=2.0.0
<2.1.3](https://redirect.github.com/honojs/node-server) |
pnpm-workspace.overrides | patch | [`2.1.3` →
`2.1.6`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/2.1.3/2.1.6)
|
|
[basic-ftp@<6.2.1](https://redirect.github.com/patrickjuchli/basic-ftp)
| pnpm-workspace.overrides | patch | [`6.2.1` →
`6.2.4`](https://renovatebot.com/diffs/npm/basic-ftp/6.2.1/6.2.4) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | devDependencies |
patch | [`4.13.16` →
`4.13.17`](https://renovatebot.com/diffs/npm/hono/4.13.16/4.13.17) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | dependencies |
patch | [`4.13.16` →
`4.13.17`](https://renovatebot.com/diffs/npm/hono/4.13.16/4.13.17) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | dependencies |
patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | devDependencies |
patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | dependencies |
patch | [`^4.13.11` →
`^4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono@<4.13.11](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) |
pnpm-workspace.overrides | patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono@<4.13.13](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) |
pnpm-workspace.overrides | patch | [`4.13.13` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.13/4.13.16) |
| [hono@<4.13.8](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) |
pnpm-workspace.overrides | patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

---

### @&#8203;hono/node-server: Backslash in the request path is parsed as
a path separator, bypassing path-based access control at a reverse proxy
[CVE-2026-126210](https://nvd.nist.gov/vuln/detail/CVE-2026-126210) /
[GHSA-jpvv-r467-5p4w](https://redirect.github.com/advisories/GHSA-jpvv-r467-5p4w)

<details>
<summary>More information</summary>

#### Details
##### Summary

`@hono/node-server` passes the raw request-target to the WHATWG URL
parser, which treats a backslash in the path as `/` and then resolves
`..` segments. A request for `/admin\secret` or
`/public\..\admin/secret` reaches the application as `/admin/secret`. A
reverse proxy that follows RFC 3986 forwards the backslash unchanged and
applies its path-based rules to the original path, so the request
reaches a route the proxy is meant to block.

##### Details

A raw backslash is not allowed in a request-target (RFC 3986, RFC 9112
Section 3.2.1), and RFC 9112 Section 3.2 says a recipient should reject
such a request rather than correct it. Proxies such as nginx on Linux,
HAProxy and Envoy keep the backslash as an ordinary character, so they
and the application see different paths.

The fix responds with `400 Bad Request` to a request whose path contains
a raw backslash, for HTTP/1.1, HTTP/2, absolute-form request-targets and
WebSocket upgrades. A percent-encoded backslash and a backslash in the
query string are still accepted.

##### Impact

An unauthenticated client can reach a route that a reverse proxy, load
balancer or WAF in front of the application blocks by path.

This affects applications served by `@hono/node-server` behind a front
component that makes path-based decisions and forwards a backslash
unchanged. Access control inside the Hono application, such as
middleware on `/admin/*`, runs on the rewritten path and is not
affected.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`

#### References
-
[https://github.com/honojs/node-server/security/advisories/GHSA-jpvv-r467-5p4w](https://redirect.github.com/honojs/node-server/security/advisories/GHSA-jpvv-r467-5p4w)
-
[3868998a80)
-
[fb97395ec3)
-
[https://github.com/honojs/node-server](https://redirect.github.com/honojs/node-server)
-
[https://github.com/honojs/node-server/releases/tag/v1.19.18](https://redirect.github.com/honojs/node-server/releases/tag/v1.19.18)
-
[https://github.com/honojs/node-server/releases/tag/v2.1.6](https://redirect.github.com/honojs/node-server/releases/tag/v2.1.6)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-jpvv-r467-5p4w) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### @&#8203;hono/node-server: Unhandled `ECONNRESET` on the socket
during an asynchronous WebSocket upgrade crashes the process
[CVE-2026-126343](https://nvd.nist.gov/vuln/detail/CVE-2026-126343) /
[GHSA-qv5m-9pm6-hqp3](https://redirect.github.com/advisories/GHSA-qv5m-9pm6-hqp3)

<details>
<summary>More information</summary>

#### Details
##### Summary

While `@hono/node-server` waits for the Hono application to handle a
WebSocket upgrade request, the socket has no error listener. If the
client resets the TCP connection during that time, the resulting
`ECONNRESET` is emitted as an unhandled `'error'` event and the process
terminates.

##### Details

The upgrade handler awaits the application before attaching any listener
to the socket. When middleware on the upgrade path does asynchronous
work, such as an authentication lookup, a connection reset in that
window has no handler. If a global `uncaughtException` handler swallows
the error, the pending upgrade is never released and its entry is
retained for the lifetime of the process.

The fix attaches error and close listeners to the socket before calling
the application, releases the pending upgrade when the socket closes,
and skips the handshake on a destroyed socket.

##### Impact

An unauthenticated client can terminate the server process with a single
connection by sending a WebSocket upgrade request and resetting the
connection before the application has responded. Where the crash is
suppressed, repeated requests grow the heap.

This affects applications that enable WebSocket support in
`@hono/node-server` and run asynchronous middleware or handlers on the
upgrade path.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

#### References
-
[https://github.com/honojs/node-server/security/advisories/GHSA-qv5m-9pm6-hqp3](https://redirect.github.com/honojs/node-server/security/advisories/GHSA-qv5m-9pm6-hqp3)
-
[61cc0267e6)
-
[https://github.com/honojs/node-server](https://redirect.github.com/honojs/node-server)
-
[https://github.com/honojs/node-server/releases/tag/v2.1.6](https://redirect.github.com/honojs/node-server/releases/tag/v2.1.6)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-qv5m-9pm6-hqp3) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught TypeError in MLSD directory-listing parser via
__proto__ fact name causes DoS in Client.list()
[CVE-2026-126345](https://nvd.nist.gov/vuln/detail/CVE-2026-126345) /
[GHSA-5pm8-86m8-9m6r](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)

<details>
<summary>More information</summary>

#### Details
##### Summary

basic-ftp's MLSD directory-listing parser (src/parseListMLSD.ts) looks
up fact-handler functions in a plain object literal keyed directly by
fact names taken from the FTP server's response, with no validation. A
directory-listing line containing the fact name "__proto__" resolves
this lookup to Object.prototype (inherited, non-own, non-function)
instead of undefined, so the "not a function" guard is bypassed and the
code throws `TypeError: factHandler is not a function`.

This TypeError is not an FTPError, so it is not caught by
Client.list()'s retry logic and propagates as a rejected promise out of
list() and every API built on top of it (list, downloadToDir,
uploadFromDir, clearWorkingDir, removeDir). Any FTP server the client
connects to — or any on-path attacker on a plaintext (non-TLS) FTP
session — can crash the calling application by returning one crafted
line in a directory listing. If the application does not wrap every one
of these calls in try/catch, the rejection is unhandled and crashes the
Node.js process (default behavior since Node 15).

##### Details

File: src/parseListMLSD.ts
```
const factHandlersByName: {[key: string]: FactHandler} = {
    "size": parseSize,
    "sizd": parseSize,
    "unique": (value, info) => { info.uniqueID = value },
    "modify": (value, info) => { ... },
    "type": (value, info) => { ... },
    "unix.mode": (value, info) => { ... },
    ...
}

export function parseLine(line: string): FileInfo | undefined {
    const [ packedFacts, name ] = splitStringOnce(line, " ")
    ...
    const facts = packedFacts.split(";")
    for (const fact of facts) {
        const [ factName, factValue ] = splitStringOnce(fact, "=")
        if (!factValue) { continue }
        const factHandler = factHandlersByName[factName.toLowerCase()]   // <-- unsafe lookup
        if (!factHandler) { continue }
        const result = factHandler(factValue, info)                     // <-- throws here
        ...
    }
    return info
}
```
factHandlersByName is a plain `{}` object literal, so it inherits from
Object.prototype. Property access does not distinguish own keys from
inherited ones. When factName.toLowerCase() === "__proto__", the bracket
lookup factHandlersByName["__proto__"] returns Object.prototype itself —
a truthy, non-undefined value — so the `if (!factHandler) continue`
guard does not fire. The code then tries to call Object.prototype as a
function: `factHandler(factValue, info)`, which throws `TypeError:
factHandler is not a function`.

This line runs inside parseList() (src/parseList.ts), called
synchronously from a `.map()` over every line of the listing, which in
turn is called from Client._requestListWithCommand() -> Client.list()
(src/Client.ts). list()'s only error handling is:
```
    catch (err) {
        const shouldTryNext = err instanceof FTPError
        if (!shouldTryNext) { throw err }
        lastError = err
    }
```
A plain TypeError is not an FTPError, so it is immediately rethrown
instead of being retried or suppressed, and the Promise returned by
list() rejects with it.

Affected call paths (all eventually call Client.list()):
- Client.list()
- Client.downloadToDir() / _downloadFromWorkingDir()
- Client.clearWorkingDir()
- Client.removeDir()

Only "__proto__" triggers the crash this way; other reserved
Object.prototype property names tested ("constructor", "toString",
"hasOwnProperty", "valueOf", "__defineGetter__") happen to resolve to
actual functions on Object.prototype, so they are called without
throwing (silently ineffective, not a crash). This confirms the root
cause is the use of an unguarded object literal as a dictionary keyed by
untrusted server input, rather than something specific to one property.

##### Proof of concept

Prerequisites: Node.js, a clone/checkout of basic-ftp, `npm install`
then `npm run buildOnly` (or `npx tsc`) to produce dist/.

Step 1 — Minimal reproduction of the parser bug alone:

    node -e '
    const { parseList } = require("./dist/parseList");
    parseList("__proto__=x;type=file;size=10; evil.txt");
    '

Expected result:
    Uncaught TypeError: factHandler is not a function
        at parseLine (.../dist/parseListMLSD.js:...)

Step 2 — End-to-end reproduction through the public Client API, proving
a real FTP server can trigger this over the wire with no client
modification:

    Save as poc.js in the repo root and run `node poc.js`:

    const net = require("net")
    const { Client } = require("./dist/index")

    const server = net.createServer(socket => {
        socket.write("220 fake ftp ready\r\n")
        socket.on("data", data => {
            const cmd = data.toString().trim()
            if (cmd.startsWith("USER")) socket.write("230 ok\r\n")
            else if (cmd.startsWith("OPTS") || cmd.startsWith("TYPE") ||
                     cmd.startsWith("STRU") || cmd.startsWith("PBSZ") ||
                     cmd.startsWith("PROT")) socket.write("200 ok\r\n")
else if (cmd.startsWith("FEAT")) socket.write("211-Features\r\n MLST
type;size;\r\n211 End\r\n")
            else if (cmd.startsWith("EPSV")) {
                const dataServer = net.createServer(dsock => {
                    // The malicious line: fact name "__proto__"
dsock.end("__proto__=pwn;type=file;size=4; evil.txt\r\n")
                })
                dataServer.listen(0, "127.0.0.1", () => {
                    const p = dataServer.address().port
socket.write(`229 Entering Extended Passive Mode (|||${p}|)\r\n`)
                })
            }
            else if (cmd.startsWith("MLSD") || cmd.startsWith("LIST")) {
                socket.write("150 Here comes the listing\r\n")
setTimeout(() => socket.write("226 Listing complete\r\n"), 50)
            }
            else socket.write("200 ok\r\n")
        })
    })

    server.listen(2121, "127.0.0.1", async () => {
        const client = new Client()
        try {
await client.access({ host: "127.0.0.1", port: 2121, user: "a",
password: "b" })
            const files = await client.list()
            console.log("list() returned normally (unexpected):", files)
        } catch (err) {
console.log("client.list() threw:", err.constructor.name, "-",
err.message)
        } finally {
            client.close()
            server.close()
            process.exit(0)
        }
    })

Expected output:

    client.list() threw: TypeError - factHandler is not a function

Configuration notes:
- No TLS, auth bypass, or special server config needed — this is a plain
FTP (PASV/EPSV
text) session using the server's FEAT response to turn on MLSD, which is
the common
  path for any modern FTP server.
- The same crash can be delivered via a LIST-fallback MLSD-shaped line
too, since
  parseList() auto-detects the format from the last listing line.
- In a real application without a try/catch around
list()/downloadToDir()/
clearWorkingDir()/removeDir(), this rejection is unhandled and
terminates the
Node.js process by default (Node >=15 unhandledRejection behavior is
"throw").

##### Impact

Type: Denial of Service (CWE-248: Uncaught Exception, enabled by
CWE-1321-style unguarded dictionary lookup on an object literal).

Who is impacted: Any application using basic-ftp's Client.list(),
downloadToDir(), uploadFromDir() (via ensureDir/clearWorkingDir paths),
clearWorkingDir(), or removeDir() against a server that is malicious,
compromised, or reachable by an on-path attacker on a non-TLS FTP
session. No authentication to the target server is required beyond
whatever credentials the application already uses, and no user
interaction is required — a single crafted directory-listing line is
sufficient.

Confidentiality: None. Integrity: None. Availability: High — unhandled
rejection crashes the Node.js process by default, taking down the whole
application/service, not just the FTP operation.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r)
-
[a22664a45d)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4)
-
[https://github.com/advisories/GHSA-5pm8-86m8-9m6r](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught exception crashes the Node.js process when a
password (or resumed-download path) contains CR/LF
[CVE-2026-126346](https://nvd.nist.gov/vuln/detail/CVE-2026-126346) /
[GHSA-r4jh-29pc-gfqr](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)

<details>
<summary>More information</summary>

#### Details
##### Summary

Client.login() calls FTPContext.send() from inside the control-socket
data event handler. send() throws on CR, LF or NUL, and nothing catches
the throw. A password containing \r\n therefore raises an uncaught
exception and terminates the whole Node.js process. It does not reject
the returned promise. Any application that passes untrusted input as the
FTP password can be crashed remotely with one request. The same pattern
exists in the REST/RETR path of downloadTo() when the remote path
contains control characters.

##### Details

The CRLF guard (FTPContext.send, src/FtpContext.ts ~L233) correctly
refuses to send commands containing \r, \n or \0:
```ts
send(command: string) {
    if (/[\r\n\0]/.test(command)) {
        throw new Error(`Invalid command: Contains control characters. (${command})`);
    }
```

That works when send() is called from handle(), because it runs inside a
Promise executor and the throw becomes a rejection. But in two places
send() runs inside a response handler, which is called synchronously
from the socket’s data event:

Client.login() (src/Client.ts ~L246-248): after the server answers 331
to USER, the handler calls this.ftp.send("PASS " + password). The USER
command was already sent and is valid, so the password is only checked
at this point. The call chain is socket.on("data") →
_onControlSocketData → _passToHandler → responseHandler → send() →
throw. No try/catch exists anywhere in that chain, so it becomes an
uncaughtException.
downloadTo() (src/transfer.ts ~L368-370): when startAt > 0, the initial
command is REST n, which contains no user-controlled text. When the
server answers 350, the handler calls config.ftp.send("RETR " +
config.remotePath). This remotePath was never checked before. A path
with a control character throws in the data handler in the same way.
(Found by code reading, not reproduced.)

Because the exception happens during data event dispatch, it can’t be
handled with try/catch or .catch() around client.access() or
downloadTo(). The application only survives if it has a global
process.on("uncaughtException") handler.

##### Proof of concept

Tested on Node.js v22.22.0 against basic-ftp 6.2.2 (built from source).
It uses a minimal mock FTP server on localhost:

```js
const net = require("net")
const ftp = require("basic-ftp")

const srv = net.createServer(s => {
  s.write("220 hi\r\n")
  s.on("data", d => {
    const c = d.toString()
    if (c.startsWith("USER")) s.write("331 pw\r\n")
    else if (c.startsWith("PASS")) s.write("230 ok\r\n")
    else s.write("200 ok\r\n")
  })
})

srv.listen(0, async () => {
  const c = new ftp.Client(2000)
  try {
    await c.access({
      host: "127.0.0.1",
      port: srv.address().port,
      user: "bob",
      password: "x\r\nDELE important"   // attacker-controlled value
    })
  } catch (e) {
    console.log("rejected:", e.message)  // never reached
  }
  console.log("handled gracefully")      // never reached
  process.exit(0)
})
```
Result: the process terminates with an uncaught exception and neither
catch nor the final console.log runs:
```
Error: Invalid command: Contains control characters. (PASS x
DELE important)
    at FTPContext.send (dist/FtpContext.js:189:19)
    at Object.responseHandler (dist/Client.js:186:26)
    at FTPContext._passToHandler (dist/FtpContext.js:322:24)
    at FTPContext._onControlSocketData (dist/FtpContext.js:312:18)
    at Socket.<anonymous> (dist/FtpContext.js:133:44)
```
The server in the PoC is benign. Any normal FTP server that replies 331
to USER triggers the same crash.

##### Impact

Denial of service (uncaught exception, process termination), CWE-248.

It affects applications that pass untrusted or user-influenced values as
the FTP password, or as the remote path of a resumed download. Examples
are web apps or services that let users enter their own FTP credentials,
or file-transfer or backup tools driven by user-supplied paths. One
request crashes the whole Node.js process and every other client it
serves. It needs no authentication to the FTP server and no special
server behaviour. The attacker only needs control over the string.
Confidentiality and integrity are not affected, and the CRLF guard still
blocks command injection.

Suggested fix:

In FTPContext._passToHandler(), wrap the handler call in a try/catch
that rejects the task and calls closeWithError(err).
Validate password in login(), and remotePath in _downloadToStream(),
before any I/O and reject early.

#### Severity
- CVSS Score: 5.9 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr)
-
[0495b906bd)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3)
-
[https://github.com/advisories/GHSA-r4jh-29pc-gfqr](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught exception crashes the Node.js process when a
password (or resumed-download path) contains CR/LF
[CVE-2026-126346](https://nvd.nist.gov/vuln/detail/CVE-2026-126346) /
[GHSA-r4jh-29pc-gfqr](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)

<details>
<summary>More information</summary>

#### Details
##### Summary

Client.login() calls FTPContext.send() from inside the control-socket
data event handler. send() throws on CR, LF or NUL, and nothing catches
the throw. A password containing \r\n therefore raises an uncaught
exception and terminates the whole Node.js process. It does not reject
the returned promise. Any application that passes untrusted input as the
FTP password can be crashed remotely with one request. The same pattern
exists in the REST/RETR path of downloadTo() when the remote path
contains control characters.

##### Details

The CRLF guard (FTPContext.send, src/FtpContext.ts ~L233) correctly
refuses to send commands containing \r, \n or \0:
```ts
send(command: string) {
    if (/[\r\n\0]/.test(command)) {
        throw new Error(`Invalid command: Contains control characters. (${command})`);
    }
```

That works when send() is called from handle(), because it runs inside a
Promise executor and the throw becomes a rejection. But in two places
send() runs inside a response handler, which is called synchronously
from the socket’s data event:

Client.login() (src/Client.ts ~L246-248): after the server answers 331
to USER, the handler calls this.ftp.send("PASS " + password). The USER
command was already sent and is valid, so the password is only checked
at this point. The call chain is socket.on("data") →
_onControlSocketData → _passToHandler → responseHandler → send() →
throw. No try/catch exists anywhere in that chain, so it becomes an
uncaughtException.
downloadTo() (src/transfer.ts ~L368-370): when startAt > 0, the initial
command is REST n, which contains no user-controlled text. When the
server answers 350, the handler calls config.ftp.send("RETR " +
config.remotePath). This remotePath was never checked before. A path
with a control character throws in the data handler in the same way.
(Found by code reading, not reproduced.)

Because the exception happens during data event dispatch, it can’t be
handled with try/catch or .catch() around client.access() or
downloadTo(). The application only survives if it has a global
process.on("uncaughtException") handler.

##### Proof of concept

Tested on Node.js v22.22.0 against basic-ftp 6.2.2 (built from source).
It uses a minimal mock FTP server on localhost:

```js
const net = require("net")
const ftp = require("basic-ftp")

const srv = net.createServer(s => {
  s.write("220 hi\r\n")
  s.on("data", d => {
    const c = d.toString()
    if (c.startsWith("USER")) s.write("331 pw\r\n")
    else if (c.startsWith("PASS")) s.write("230 ok\r\n")
    else s.write("200 ok\r\n")
  })
})

srv.listen(0, async () => {
  const c = new ftp.Client(2000)
  try {
    await c.access({
      host: "127.0.0.1",
      port: srv.address().port,
      user: "bob",
      password: "x\r\nDELE important"   // attacker-controlled value
    })
  } catch (e) {
    console.log("rejected:", e.message)  // never reached
  }
  console.log("handled gracefully")      // never reached
  process.exit(0)
})
```
Result: the process terminates with an uncaught exception and neither
catch nor the final console.log runs:
```
Error: Invalid command: Contains control characters. (PASS x
DELE important)
    at FTPContext.send (dist/FtpContext.js:189:19)
    at Object.responseHandler (dist/Client.js:186:26)
    at FTPContext._passToHandler (dist/FtpContext.js:322:24)
    at FTPContext._onControlSocketData (dist/FtpContext.js:312:18)
    at Socket.<anonymous> (dist/FtpContext.js:133:44)
```
The server in the PoC is benign. Any normal FTP server that replies 331
to USER triggers the same crash.

##### Impact

Denial of service (uncaught exception, process termination), CWE-248.

It affects applications that pass untrusted or user-influenced values as
the FTP password, or as the remote path of a resumed download. Examples
are web apps or services that let users enter their own FTP credentials,
or file-transfer or backup tools driven by user-supplied paths. One
request crashes the whole Node.js process and every other client it
serves. It needs no authentication to the FTP server and no special
server behaviour. The attacker only needs control over the string.
Confidentiality and integrity are not affected, and the CRLF guard still
blocks command injection.

Suggested fix:

In FTPContext._passToHandler(), wrap the handler call in a try/catch
that rejects the task and calls closeWithError(err).
Validate password in login(), and remotePath in _downloadToStream(),
before any I/O and reject early.

#### Severity
- CVSS Score: 5.9 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr)
-
[0495b906bd)
-
[https://github.com/patrickjuchli/basic-ftp](https://redirect.github.com/patrickjuchli/basic-ftp)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-r4jh-29pc-gfqr) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught TypeError in MLSD directory-listing parser via
__proto__ fact name causes DoS in Client.list()
[CVE-2026-126345](https://nvd.nist.gov/vuln/detail/CVE-2026-126345) /
[GHSA-5pm8-86m8-9m6r](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)

<details>
<summary>More information</summary>

#### Details
##### Summary

basic-ftp's MLSD directory-listing parser (src/parseListMLSD.ts) looks
up fact-handler functions in a plain object literal keyed directly by
fact names taken from the FTP server's response, with no validation. A
directory-listing line containing the fact name "__proto__" resolves
this lookup to Object.prototype (inherited, non-own, non-function)
instead of undefined, so the "not a function" guard is bypassed and the
code throws `TypeError: factHandler is not a function`.

This TypeError is not an FTPError, so it is not caught by
Client.list()'s retry logic and propagates as a rejected promise out of
list() and every API built on top of it (list, downloadToDir,
uploadFromDir, clearWorkingDir, removeDir). Any FTP server the client
connects to — or any on-path attacker on a plaintext (non-TLS) FTP
session — can crash the calling application by returning one crafted
line in a directory listing. If the application does not wrap every one
of these calls in try/catch, the rejection is unhandled and crashes the
Node.js process (default behavior since Node 15).

##### Details

File: src/parseListMLSD.ts
```
const factHandlersByName: {[key: string]: FactHandler} = {
    "size": parseSize,
    "sizd": parseSize,
    "unique": (value, info) => { info.uniqueID = value },
    "modify": (value, info) => { ... },
    "type": (value, info) => { ... },
    "unix.mode": (value, info) => { ... },
    ...
}

export function parseLine(line: string): FileInfo | undefined {
    const [ packedFacts, name ] = splitStringOnce(line, " ")
    ...
    const facts = packedFacts.split(";")
    for (const fact of facts) {
        const [ factName, factValue ] = splitStringOnce(fact, "=")
        if (!factValue) { continue }
        const factHandler = factHandlersByName[factName.toLowerCase()]   // <-- unsafe lookup
        if (!factHandler) { continue }
        const result = factHandler(factValue, info)                     // <-- throws here
        ...
    }
    return info
}
```
factHandlersByName is a plain `{}` object literal, so it inherits from
Object.prototype. Property access does not distinguish own keys from
inherited ones. When factName.toLowerCase() === "__proto__", the bracket
lookup factHandlersByName["__proto__"] returns Object.prototype itself —
a truthy, non-undefined value — so the `if (!factHandler) continue`
guard does not fire. The code then tries to call Object.prototype as a
function: `factHandler(factValue, info)`, which throws `TypeError:
factHandler is not a function`.

This line runs inside parseList() (src/parseList.ts), called
synchronously from a `.map()` over every line of the listing, which in
turn is called from Client._requestListWithCommand() -> Client.list()
(src/Client.ts). list()'s only error handling is:
```
    catch (err) {
        const shouldTryNext = err instanceof FTPError
        if (!shouldTryNext) { throw err }
        lastError = err
    }
```
A plain TypeError is not an FTPError, so it is immediately rethrown
instead of being retried or suppressed, and the Promise returned by
list() rejects with it.

Affected call paths (all eventually call Client.list()):
- Client.list()
- Client.downloadToDir() / _downloadFromWorkingDir()
- Client.clearWorkingDir()
- Client.removeDir()

Only "__proto__" triggers the crash this way; other reserved
Object.prototype property names tested ("constructor", "toString",
"hasOwnProperty", "valueOf", "__defineGetter__") happen to resolve to
actual functions on Object.prototype, so they are called without
throwing (silently ineffective, not a crash). This confirms the root
cause is the use of an unguarded object literal as a dictionary keyed by
untrusted server input, rather than something specific to one property.

##### Proof of concept

Prerequisites: Node.js, a clone/checkout of basic-ftp, `npm install`
then `npm run buildOnly` (or `npx tsc`) to produce dist/.

Step 1 — Minimal reproduction of the parser bug alone:

    node -e '
    const { parseList } = require("./dist/parseList");
    parseList("__proto__=x;type=file;size=10; evil.txt");
    '

Expected result:
    Uncaught TypeError: factHandler is not a function
        at parseLine (.../dist/parseListMLSD.js:...)

Step 2 — End-to-end reproduction through the public Client API, proving
a real FTP server can trigger this over the wire with no client
modification:

    Save as poc.js in the repo root and run `node poc.js`:

    const net = require("net")
    const { Client } = require("./dist/index")

    const server = net.createServer(socket => {
        socket.write("220 fake ftp ready\r\n")
        socket.on("data", data => {
            const cmd = data.toString().trim()
            if (cmd.startsWith("USER")) socket.write("230 ok\r\n")
            else if (cmd.startsWith("OPTS") || cmd.startsWith("TYPE") ||
                     cmd.startsWith("STRU") || cmd.startsWith("PBSZ") ||
                     cmd.startsWith("PROT")) socket.write("200 ok\r\n")
else if (cmd.startsWith("FEAT")) socket.write("211-Features\r\n MLST
type;size;\r\n211 End\r\n")
            else if (cmd.startsWith("EPSV")) {
                const dataServer = net.createServer(dsock => {
                    // The malicious line: fact name "__proto__"
dsock.end("__proto__=pwn;type=file;size=4; evil.txt\r\n")
                })
                dataServer.listen(0, "127.0.0.1", () => {
                    const p = dataServer.address().port
socket.write(`229 Entering Extended Passive Mode (|||${p}|)\r\n`)
                })
            }
            else if (cmd.startsWith("MLSD") || cmd.startsWith("LIST")) {
                socket.write("150 Here comes the listing\r\n")
setTimeout(() => socket.write("226 Listing complete\r\n"), 50)
            }
            else socket.write("200 ok\r\n")
        })
    })

    server.listen(2121, "127.0.0.1", async () => {
        const client = new Client()
        try {
await client.access({ host: "127.0.0.1", port: 2121, user: "a",
password: "b" })
            const files = await client.list()
            console.log("list() returned normally (unexpected):", files)
        } catch (err) {
console.log("client.list() threw:", err.constructor.name, "-",
err.message)
        } finally {
            client.close()
            server.close()
            process.exit(0)
        }
    })

Expected output:

    client.list() threw: TypeError - factHandler is not a function

Configuration notes:
- No TLS, auth bypass, or special server config needed — this is a plain
FTP (PASV/EPSV
text) session using the server's FEAT response to turn on MLSD, which is
the common
  path for any modern FTP server.
- The same crash can be delivered via a LIST-fallback MLSD-shaped line
too, since
  parseList() auto-detects the format from the last listing line.
- In a real application without a try/catch around
list()/downloadToDir()/
clearWorkingDir()/removeDir(), this rejection is unhandled and
terminates the
Node.js process by default (Node >=15 unhandledRejection behavior is
"throw").

##### Impact

Type: Denial of Service (CWE-248: Uncaught Exception, enabled by
CWE-1321-style unguarded dictionary lookup on an object literal).

Who is impacted: Any application using basic-ftp's Client.list(),
downloadToDir(), uploadFromDir() (via ensureDir/clearWorkingDir paths),
clearWorkingDir(), or removeDir() against a server that is malicious,
compromised, or reachable by an on-path attacker on a non-TLS FTP
session. No authentication to the target server is required beyond
whatever credentials the application already uses, and no user
interaction is required — a single crafted directory-listing line is
sufficient.

Confidentiality: None. Integrity: None. Availability: High — unhandled
rejection crashes the Node.js process by default, taking down the whole
application/service, not just the FTP operation.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r)
-
[a22664a45d)
-
[https://github.com/patrickjuchli/basic-ftp](https://redirect.github.com/patrickjuchli/basic-ftp)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-5pm8-86m8-9m6r) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `css` helper does not escape a closing tag split between the
template and an interpolated value, allowing HTML injection
[CVE-2026-126359](https://nvd.nist.gov/vuln/detail/CVE-2026-126359) /
[GHSA-3gg2-335m-rxc6](https://redirect.github.com/advisories/GHSA-3gg2-335m-rxc6)

<details>
<summary>More information</summary>

#### Details
##### Summary

The `css` helper in `hono/css` escapes a `/` that follows `<` inside an
interpolated value so that a value cannot close the `<style>` element.
The check only looks inside each value. When the text before a value
ends with `<`, whether that is the template itself or an earlier
interpolated value, and the next value starts with `/`, the `/` is not
escaped and the combined output contains an unescaped closing tag.

##### Details

Interpolated string values are escaped one at a time before they are
joined with the surrounding template text. The rule that neutralizes
`</` therefore cannot see a `<` that belongs to the template. A template
such as a `content` declaration that opens with a literal `<` and
interpolates a string right after it produces a raw `</style>` when that
string starts with `/style>`. During server-side rendering the `<Style
/>` element is closed early and the rest of the value is interpreted as
HTML.

This issue arises only when `<` is the last character before an
interpolation in a `css` template, either written in the template or
supplied by a preceding value, and the interpolated value is controlled
by a client.

##### Impact

A client that controls such a value can inject HTML, including script,
into the page rendered on the server.

This may lead to:

- Execution of attacker-controlled script in the browser of a user who
views the page
- Exposure of information available to that page

This issue affects applications that interpolate untrusted strings into
a `css` template immediately after a `<`, including two adjacent
interpolations such as `${prefix}${name}` where both are untrusted.
Other uses of the `css` helper are not affected.

##### Workarounds

Do not interpolate untrusted values into `css` templates, or make sure
the text before an interpolated value does not end with `<`.

#### Severity
- CVSS Score: 3.4 / 10 (Low)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:N/A:N`

#### References
-
[https://github.com/honojs/hono/security/advisories/GHSA-3gg2-335m-rxc6](https://redirect.github.com/honojs/hono/security/advisories/GHSA-3gg2-335m-rxc6)
-
[15bbd96ad1)
-
[https://github.com/honojs/hono](https://redirect.github.com/honojs/hono)
-
[https://github.com/honojs/hono/releases/tag/v4.13.16](https://redirect.github.com/honojs/hono/releases/tag/v4.13.16)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-3gg2-335m-rxc6) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `csrf()` does not check requests sent by hyperlink auditing
(`text/ping`)
[CVE-2026-126355](https://nvd.nist.gov/vuln/detail/CVE-2026-126355) /
[GHSA-46wx-v44x-9hh2](https://redirect.github.com/advisories/GHSA-46wx-v44x-9hh2)

<details>
<summary>More information</summary>

#### Details
##### Summary

`csrf()` validates a request only when its `Content-Type` is one of the
three types an HTML form can send. Chromium's hyperlink auditing (`<a
ping>`) sends a cross-origin POST with the user's cookies and the
content type `text/ping`, which is not in that list. The middleware does
not look at `Origin` or `Sec-Fetch-Site` for such a request, so it is
passed to the handler.

##### Details

The middleware skips the origin check when the content type is not one
that a form submission produces. The assumption was that any other
content type requires a CORS preflight and therefore cannot be sent
cross-origin with credentials. Hyperlink auditing is an exception:
Chrome and Edge send the ping as a credentialed POST without a
preflight, with a fixed body and `Content-Type: text/ping`.

A page on another origin can therefore trigger a POST to any URL of the
application. The `csrf()` options for `origin` and `secFetchSite` do not
change the outcome, because neither header is evaluated for the request.

The request body is fixed, so only actions whose effect does not depend
on the body can be triggered. Firefox does not send pings by default. As
with any CSRF, the user's cookie must be sent with the request, which
with the default `SameSite=Lax` means a same-site origin or a cookie set
with `SameSite=None`.

##### Impact

A user who visits a malicious page in Chrome or Edge while logged in to
an application protected by `csrf()` can be made to send a
state-changing request to that application, such as logging out,
deleting a resource, or toggling a setting that is selected by the path
or query string.

This issue affects applications that rely on `csrf()` as their CSRF
protection and expose state-changing endpoints whose effect does not
depend on the request body.

##### Workarounds

Reject requests with a `Content-Type` of `text/ping` in a middleware
registered before `csrf()`, or set session cookies with
`SameSite=Strict`.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N`

#### References
-
[https://github.com/honojs/hono/security/advisories/GHSA-46wx-v44x-9hh2](https://redirect.github.com/honojs/hono/security/advisories/GHSA-46wx-v44x-9hh2)
-
[bf16471913)
-
[https://github.com/honojs/hono](https://redirect.github.com/honojs/hono)
-
[https://github.com/honojs/hono/releases/tag/v4.13.16](https://redirect.github.com/honojs/hono/releases/tag/v4.13.16)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-46wx-v44x-9hh2) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `validator('form')` skips validation for `multipart/form-data`
requests with extra parameters
[CVE-2026-126356](https://nvd.nist.gov/vuln/detail/CVE-2026-126356) /
[GHSA-4h7h-rv7c-7m2v](https://redirect.github.com/advisories/GHSA-4h7h-rv7c-7m2v)

<details>
<summary>More information</summary>

#### Details
##### Summary

`validator('form')` only recognizes a `multipart/form-data`
`Content-Type` that carries nothing but a single `boundary` parameter. A
request with another legal parameter, such as `charset`, or with extra
whitespace after the `;` is not recognized as a form. The validation
callback then receives an empty object, while `c.req.parseBody()` still
parses the body as a form.

##### Details

The check that decides whether a request body is a form was written as a
strict pattern over the whole `Content-Type` value. Any parameter list
that does not look exactly like `; boundary=...` fails the check. When
it fails, the middleware does not read the body and passes an empty
object to the validation callback. If the callback accepts an empty
object, the request proceeds to the handler, which can still read all
submitted fields through `c.req.parseBody()` or `c.req.formData()`.

`application/x-www-form-urlencoded` is not affected. Only the
`multipart/form-data` branch has the strict pattern.

This issue arises when an application relies on `validator('form')` to
reject or restrict fields and the validation callback does not fail on
an empty object.

##### Impact

An unauthenticated client can send form fields that the `form` validator
never sees, by adding a legal parameter to the `Content-Type` header.

This may lead to:

- Allow-list or required-field checks in the validator being skipped
- Fields the application intended to reject reaching the handler

This issue affects applications that use `validator('form')` with
`multipart/form-data` requests and whose validation callback accepts an
empty object.

##### Workarounds

Reject an empty object in the `validator('form')` callback, or validate
the result of `await c.req.parseBody()` in the handler.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`

#### References
-
[https://github.com/honojs/hono/security/advisories/GHSA-4h7h-rv7c-7m2v](https://redirect.github.com/honojs/hono/security/advisories/GHSA-4h7h-rv7c-7m2v)
-
[d88fab3724)
-
[https://github.com/honojs/hono](https://redirect.github.com/honojs/hono)
-
[https://github.com/honojs/hono/releases/tag/v4.13.16](https://redirect.github.com/honojs/hono/releases/tag/v4.13.16)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-4h7h-rv7c-7m2v) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `mount()` and `app.mount()` can forward a path that bypasses
middleware scoped inside the mount prefix
[CVE-2026-126357](https://nvd.nist.gov/vuln/detail/CVE-2026-126357) /
[GHSA-4m76-xfj5-7975](https://redirect.github.com/advisories/GHSA-4m76-xfj5-7975)

<details>
<summary>More information</summary>

#### Details
##### Summary

`mount()` and `app.mount()` remove the mount prefix from the request
path and forward the rest to the mounted application. Two mistakes in
that step let a crafted request reach a route of the mounted application
that the outer application protects with path-scoped middleware, such as
an authentication check on `/app/admin/*`. The outer application routes
on the original path, so the middleware does not run.

##### Details

1. **Dynamic prefix** (all affected versions): for a mount such as
`/api/:tenant/*`, the prefix was removed by the length of the route
pattern, not of the matched prefix. A request with a longer or shorter
first segment is cut in the middle, so `/api/a/xxxxx/admin/secret`
reaches the mounted application as `/admin/secret`.
2. **Re-normalization** (since 4.12.21): the forwarded path was built
from the decoded request path and assigned to `url.pathname`, which
turns a decoded backslash into `/` and collapses `..`.
`/app/public%5C..%5Cadmin/secret` reaches the mounted application as
`/admin/secret`.

The fix removes the prefix segment by segment from the raw pathname,
using the matched parameter values for its length. Route patterns that
cannot be handled safely now throw: duplicate parameter names and a
wildcard inside the last segment such as `/assets*`. A trailing slash in
an `app.mount()` prefix no longer removes an extra segment.

##### Impact

An unauthenticated client can reach a route of a mounted application
that the outer application protects with path-scoped middleware.

This affects applications that use `mount()` or `app.mount()` and rely
on middleware registered on a sub-path inside the mount prefi

> [!IMPORTANT]
> ✂ PR body was truncated to here.
2026-11-13 06:57:14 -08:00
shreyas-mastra
8d4abc4f88
chore(deps): Vanta 2026-11-12 — raise undici to 8.12.4 / 7.30.2 (#30205) 2026-11-12 07:20:12 -08:00
Dane - AI (Mastra)
c22107fce3
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.45 (#29844) 2026-11-10 20:07:34 -08:00
Dane - AI (Mastra)
4bd4b7f48e
chore(deps): update better-auth monorepo to v1.7.18 (#29714)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-09 12:39:24 +01:00
Dane - AI (Mastra)
bfe3af4ae1
chore(deps): update better-auth monorepo to v1.7.15 (#29497) 2026-11-04 17:36:58 -08:00
Dane - AI (Mastra)
9ce7e350ea
chore(deps): lock file maintenance (#29341)
Co-authored-by: wardpeet <ward@coding-tech.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-04 15:03:55 +01:00
shreyas-mastra
655b19993f
chore(security): Vanta 2026-10-30 - zod ^4.6.7, @hono/node-server 2.1.5 (direct bumps) (#28983)
## Vanta 2026-10-30 security fixes (consolidated)

Direct dependency bumps and lockfile updates only. **No
overrides/resolutions added or raised.** The earlier override-based
edits on this branch were reverted; those findings are deferred below.

| Package | From → To | Advisory | Where |
|---|---|---|---|
| zod | ^3.25.76 → ^4.6.7 | zod <4.6.6 (High; no fixed 3.x) |
`client-sdks/react` (dev), `deployers/cloudflare` (dev),
`server-adapters/nestjs` (dev), `packages/editor` (dev),
`packages/playground-ui` (dep), `packages/playground`,
`workflows/_test-utils`, `examples/{durable-agents,inngest}`,
`explorations/longmemeval`,
`observability/_examples/otel-bridge/agent-hub`, e2e fixtures/templates
(`experiment-worker/fixtures/*`, `deployers/template/cloudflare`,
`no-bundling/template`, agent-builder `minimal-mastra-project`) + root
`pnpm-lock.yaml` |
| @hono/node-server | 1.19.x / 2.1.1 → 2.1.5 | CVE-2026-118663 /
GHSA-rmxm-3fg6-px4f (Medium) | direct deps: `examples/agent-builder`,
`otel-bridge/hono-multi/service-{one,two,mastra}`,
`templates/template-customer-refund-agent/client-demo-ui`,
`templates/template-kyc-customer-onboarding`,
`templates/template-security-incident-triage` |

Peer ranges (`^3.25.0 || ^4.0.0`) are unchanged, so consumers are
unaffected. Changeset: patch for `@mastra/playground-ui` (runtime zod
dep).

Supersedes the zod parts of #28075 (that PR also raises a pnpm override
and rewrites the `zod-v3` compat aliases to v4, so it is left as-is for
maintainers).

### Deferred (needs override, upstream release, or is intentional)
- zod v3 compat aliases (`zod-v3` in `packages/core`,
`packages/schema-compat`, `e2e-tests/type-check/template`;
`e2e-tests/client-js/zod-v3`): intentional zod 3 test coverage; no fixed
3.x release. Needs a decision to drop/dismiss.
- zod 3.25.76 transitive via `@arcadeai/arcadejs`, `@mcp-ui/client`,
firecrawl, `agent-browser`, `zod-to-json-schema`, MCP SDK paths:
upstream pins; override-only.
- @hono/node-server 1.19.x transitive via `@modelcontextprotocol/sdk`
(root, `examples/agent`, `packages/mcp/integration-tests`), and npm
lockfiles of `scripts/gh-issue-triage` (existing override, left alone)
and the two templates: override-only.
- graphql-scalars, raw-body, jose (templates/scripts): override-only.
- @azure/msal-node <7.1.0: 6.0.1 via `@azure/identity@4.14.0` (fixed in
4.14.1, blocked by the 1-day `minimumReleaseAge`; lockfile refresh
tomorrow), 5.6.0 via `@microsoft/teams.apps` (no fixed release).
- @opentelemetry/core <2.8.0: via `@google-cloud/pubsub@5` (fix needs
pubsub 6 major).
- @ai-sdk/provider-utils 2.2.8 / ai 4.x: pinned vendored AI SDK v4 line;
no fixed release in that major.
- extract-zip, deepmerge: no patched version.


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

## ELI5

This PR updates Zod and `@hono/node-server` versions in selected
packages, examples, and templates to address security advisories. It
also updates playground form code to work with Zod 4.

## Changes

- Updates selected `zod` dependencies to `^4.6.7`.
- Updates selected `@hono/node-server` dependencies to `2.1.5`.
- Updates the playground form’s IP address and record validators for Zod
4.
- Maps a specific Zod validation error to the message `Required`.
- Adds a patch changeset for `@mastra/playground-ui`.

## Validation

Test results are not provided in the supplied change summary.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: shreyas-mastra <327047572+shreyas-mastra@users.noreply.github.com>
2026-10-30 15:30:35 -04:00
Dane - AI (Mastra)
f6cd11f348
chore(deps): lock file maintenance (#28672)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am on wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend Renovate
CLI](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE5MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-29 10:02:15 +00:00
Dane - AI (Mastra)
07c1bf2362
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.42 (#28773) 2026-10-28 18:08:16 -07:00
Dane - AI (Mastra)
f2ad3844f3
chore(deps): update opentelemetry (#28581)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-28 16:48:54 -07:00
Dane - AI (Mastra)
29747ebd1d
chore(deps): update better-auth monorepo to v1.7.13 (#28538)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
|
[@better-auth/drizzle-adapter@<1.7.7](https://www.better-auth.com/docs/adapters/drizzle)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/drizzle-adapter))
| pnpm-workspace.overrides | patch | [`1.7.7` →
`1.7.13`](https://renovatebot.com/diffs/npm/@better-auth%2fdrizzle-adapter@<1.7.7/1.7.7/1.7.13)
| `1.7.14` |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| pnpm-workspace.overrides | patch | [`^1.7.7` →
`^1.7.13`](https://renovatebot.com/diffs/npm/better-auth/1.7.7/1.7.13) |
`1.7.14` |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| dependencies | patch | [`^1.7.12` →
`^1.7.13`](https://renovatebot.com/diffs/npm/better-auth/1.7.12/1.7.13)
| `1.7.14` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

---

### Release Notes

<details>
<summary>better-auth/better-auth
(@&#8203;better-auth/drizzle-adapter@<1.7.7)</summary>

###
[`v1.7.13`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1713)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.12...v1.7.13)

###
[`v1.7.12`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1712)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.11...v1.7.12)

###
[`v1.7.11`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1711)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.10...v1.7.11)

###
[`v1.7.10`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1710)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.9...v1.7.10)

###
[`v1.7.9`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#179)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.8...v1.7.9)

###
[`v1.7.8`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#178)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.7...v1.7.8)

##### Patch Changes

-
[#&#8203;11512](https://redirect.github.com/better-auth/better-auth/pull/11512)
[`4175b34`](4175b34a8f)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Align
the installed `@better-auth/utils` version with `better-call` while
accepting `^0.4.2 || ^0.5.0` across official package peers.

-
[#&#8203;11731](https://redirect.github.com/better-auth/better-auth/pull/11731)
[`0cfe07d`](0cfe07dccd)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Drizzle schemas that store dates in string columns now work:
`timestamp({ mode: "string" })`, MySQL `datetime({ mode: "string" })`,
and SQLite `text()`, including on Cloudflare D1. Before, the adapter
passed a JavaScript `Date` to those columns. Drivers such as
postgres-js, better-sqlite3 and D1 rejected it, so email sign-up, social
sign-in and session refresh failed. Filtering on those columns, for
example when listing sessions, failed the same way. Better Auth now
writes these dates as UTC text and reads a value without a time zone as
UTC.

If your server's time zone is not UTC and you use node-postgres or
mysql2 with a string column that has no time zone, existing rows were
written in the server's local time. They now read back shifted by the
server's UTC offset, so sessions and verification codes created before
the upgrade can expire early or late. Schemas generated by the CLI use
date columns and are unaffected.

</details>

<details>
<summary>better-auth/better-auth (better-auth)</summary>

###
[`v1.7.13`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1713)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.12...v1.7.13)

##### Patch Changes

-
[#&#8203;11985](https://redirect.github.com/better-auth/better-auth/pull/11985)
[`9cb95fe`](9cb95fe3d0)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Type
declarations no longer list type-only exports as values, so importing
one as a value now fails type checking instead of failing at runtime.

- Updated dependencies
\[[`2712441`](2712441e35),
[`1cf4b2c`](1cf4b2c8f5)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.13
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.13
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.13
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.13
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.13
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.13
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.13

###
[`v1.7.12`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1712)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.11...v1.7.12)

##### Patch Changes

-
[#&#8203;11925](https://redirect.github.com/better-auth/better-auth/pull/11925)
[`fb48619`](fb48619083)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - The JWT
plugin now verifies JWTs and session cookie-cache JWTs with the
algorithm of the stored key instead of the one named in the token
header, and logs a warning when it signs or verifies a JWT without an
issuer or audience.

-
[#&#8203;11924](https://redirect.github.com/better-auth/better-auth/pull/11924)
[`681aa5c`](681aa5c443)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
`auth.api.getSession()` now keeps the original database error as
`error.cause` when the session lookup fails, so server code can tell a
transient failure from a bug.

-
[#&#8203;11930](https://redirect.github.com/better-auth/better-auth/pull/11930)
[`b18e3b8`](b18e3b8fdf)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - OAuth
callbacks completed through the OAuth proxy now run the same checks as
the standard OAuth callback, including issuer and ID token nonce
validation.

- Updated dependencies
\[[`681aa5c`](681aa5c443),
[`4bc78ba`](4bc78baa83),
[`876608d`](876608da86),
[`083a743`](083a74329b),
[`492134a`](492134aeba)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.12
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.12
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.12
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.12
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.12
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.12
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.12

###
[`v1.7.11`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1711)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.10...v1.7.11)

##### Patch Changes

-
[#&#8203;10719](https://redirect.github.com/better-auth/better-auth/pull/10719)
[`bd65db0`](bd65db02c1)
Thanks [@&#8203;rendermani](https://redirect.github.com/rendermani)! -
Recognize PostgreSQL `int8` as a valid number type in migration diffs.
Kysely's introspector reports `pg_type.typname`, so Better Auth's own
`bigint` columns (such as the database-backed rate limiter's
`lastRequest`) came back as `int8` and were reported as a type mismatch
on every run.

-
[#&#8203;11521](https://redirect.github.com/better-auth/better-auth/pull/11521)
[`37a75c9`](37a75c95d1)
Thanks [@&#8203;aryan1306](https://redirect.github.com/aryan1306)! - Fix
database-backed rate limiting returning an excessively large
`X-Retry-After` header instead of the remaining seconds in the
rate-limit window.

- Updated dependencies
\[[`ce96569`](ce965696d1),
[`2f6ca3f`](2f6ca3f370),
[`dfd8dd2`](dfd8dd287a)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.11
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.11
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.11
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.11
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.11
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.11
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.11

###
[`v1.7.10`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1710)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.9...v1.7.10)

##### Patch Changes

-
[#&#8203;11393](https://redirect.github.com/better-auth/better-auth/pull/11393)
[`eebd47a`](eebd47a0e7)
Thanks [@&#8203;breken-ai](https://redirect.github.com/breken-ai)! - If
you use the `lastLoginMethod` plugin with `oneTap`, signing in through
Google One Tap now records `"google"`, the same value as signing in with
the Google button. Before, a One Tap sign-in recorded nothing: the
`better-auth.last_used_login_method` cookie kept its previous value or
stayed unset, and so did `user.lastLoginMethod` with `storeInDatabase`.

If your `customResolveMethod` includes a `/one-tap/callback` →
`"google"` workaround, remove that mapping; keep the resolver if it
handles other routes.

-
[#&#8203;11821](https://redirect.github.com/better-auth/better-auth/pull/11821)
[`09d07e6`](09d07e6fea)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- The Google One Tap prompt (`authClient.oneTap()` without `button`) no
longer calls `getSkippedReason()`, which Google's FedCM migration guide
says to remove. Before, it called it under any `promptOptions.fedCM`
setting.

A skipped prompt now ends the flow and calls `onPromptNotification`
right away instead of retrying. Google doesn't report why a prompt was
skipped, and a prompt the user closed stays hidden for Google's cooldown
period, so the retries could not bring it back. Dismissed prompts still
retry as before.

Google Identity Services still logs its FedCM migration warning, because
it does so whenever `prompt()` receives a listener. The plugin needs the
listener to track dismissals and skips, so the warning is expected and
safe to ignore.

-
[#&#8203;11819](https://redirect.github.com/better-auth/better-auth/pull/11819)
[`eaecb72`](eaecb7229e)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Google One Tap now applies your
`socialProviders.google.mapProfileToUser` and custom `getUserInfo`, the
same as the standard Google sign-in. Before, One Tap ignored both and
always stored the token's `name`, `email`, `email_verified`, and
`picture` claims.

If you configured either one, users created through One Tap now get the
fields it returns, including any extra fields such as a first name from
`given_name`. Returning users are updated from it on each One Tap
sign-in when `socialProviders.google.overrideUserInfoOnSignIn` is on,
and so are existing users that One Tap links when
`account.accountLinking.updateUserInfoOnLink` is on. Check that your
mapper suits One Tap users too.

If you set `socialProviders.google.overrideUserInfoOnSignIn`, One Tap
sign-ins now update returning users' name, image, and email from Google,
as the redirect sign-in already does.

Setups that configure none of these, including `oneTap({ clientId })`
with no Google provider, are unaffected.

-
[#&#8203;11820](https://redirect.github.com/better-auth/better-auth/pull/11820)
[`88c9a37`](88c9a37856)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- If you set `autoSelect` or `cancelOnTapOutside` on `oneTapClient()`,
the One Tap prompt and the Sign in with Google button now use them.
Before, only values passed to `authClient.oneTap()` took effect, so with
`autoSelect: true` on the plugin, returning users still had to pick an
account. Values passed to `oneTap()` still override the plugin's. Apps
that set these options only on `oneTap()`, or not at all, are
unaffected.

-
[#&#8203;11696](https://redirect.github.com/better-auth/better-auth/pull/11696)
[`0cf1f7c`](0cf1f7c6bc)
Thanks [@&#8203;drewsephski](https://redirect.github.com/drewsephski)! -
You can now import the One Tap plugin from
`better-auth/plugins/one-tap`, as you can for other plugins. Previously
this import failed with a "not exported" error. Imports from
`better-auth/plugins` and `better-auth/client/plugins` are unchanged.

-
[#&#8203;11822](https://redirect.github.com/better-auth/better-auth/pull/11822)
[`414e845`](414e845f12)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- You can now import the Captcha and OpenAPI plugins from
`better-auth/plugins/captcha` and `better-auth/plugins/open-api`, as you
can for other plugins. Previously these imports failed with a "not
exported" error. Imports from `better-auth/plugins` are unchanged.

If your TypeScript config uses `"moduleResolution": "node"` (or
`node10`), `better-auth/plugins/multi-session` and `better-auth/test`
now resolve their types. Previously TypeScript reported that it could
not find their declarations. Projects using `bundler`, `node16`, or
`nodenext` resolution are unaffected.

- Updated dependencies
\[[`fedd055`](fedd05586c),
[`bbd0a19`](bbd0a19c30),
[`99cdfe7`](99cdfe7c2e)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.10
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.10
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.10
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.10
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.10
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.10
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.10

###
[`v1.7.9`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#179)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.8...v1.7.9)

##### Patch Changes

-
[#&#8203;11766](https://redirect.github.com/better-auth/better-auth/pull/11766)
[`6edaa61`](6edaa61e62)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - An
`onAPIError.onError` handler that throws or rejects no longer fails the
request or causes an unhandled promise rejection. The error is logged
and the original error response is returned. Async handlers now finish
before the response is sent.

- Updated dependencies \[]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.9
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.9
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.9
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.9
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.9
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.9
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.9

###
[`v1.7.8`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#178)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.7...v1.7.8)

##### Patch Changes

-
[#&#8203;11512](https://redirect.github.com/better-auth/better-auth/pull/11512)
[`4175b34`](4175b34a8f)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Align
the installed `@better-auth/utils` version with `better-call` while
accepting `^0.4.2 || ^0.5.0` across official package peers.

-
[#&#8203;11565](https://redirect.github.com/better-auth/better-auth/pull/11565)
[`b1cfc1e`](b1cfc1ec1e)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Omit
non-returned custom fields from inferred output schema types.

-
[#&#8203;11540](https://redirect.github.com/better-auth/better-auth/pull/11540)
[`678c555`](678c555beb)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Align
cookie security attributes with RFC 6265bis.

-
[#&#8203;10591](https://redirect.github.com/better-auth/better-auth/pull/10591)
[`193efff`](193efff3d2)
Thanks [@&#8203;kdelay](https://redirect.github.com/kdelay)! - Expired
or revoked sessions now clear stale cookies when using `customSession`.

-
[#&#8203;11625](https://redirect.github.com/better-auth/better-auth/pull/11625)
[`369176e`](369176e7f6)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Fixed single-use checks for apps that set
`advanced.database.generateId: "uuid"`. Default id generation is
unaffected, and no migration is needed.

- On SQLite and MySQL, SAML sign-in, DPoP-bound requests checked against
the database replay store, `private_key_jwt` client authentication, and
magic link or email OTP sign-ins that adopt an unverified account failed
with a `NOT NULL` error on the `id` column. They now work. SIWE sign-in
ignored the `email` field and used the wallet-derived address; it now
uses the supplied email when no other account has it.
- On Postgres and MongoDB, a reused SAML assertion, DPoP proof, or
client assertion was accepted. Each one is now accepted only once.

With `generateId: "serial"`, behavior is unchanged: these checks need
string ids, and Better Auth now logs a warning the first time one of
these flows runs.

-
[#&#8203;11391](https://redirect.github.com/better-auth/better-auth/pull/11391)
[`352d04c`](352d04c8eb)
Thanks [@&#8203;breken-ai](https://redirect.github.com/breken-ai)! - Fix
`customSession` treating session lookup failures as signed-out users.
Server-side `getSession` now throws an API error, and HTTP clients
receive an error response.

-
[#&#8203;11750](https://redirect.github.com/better-auth/better-auth/pull/11750)
[`e9d9921`](e9d9921217)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Generic OAuth providers configured with `discoveryUrl` now recover
without a restart when discovery fails at startup. Since 1.7.3, a
provider whose discovery request failed at boot (for example, because
the identity provider was still starting) was skipped, and every sign-in
returned `PROVIDER_NOT_FOUND` until the app restarted. Better Auth now
retries discovery on the next sign-in, callback, or account-linking
request for that provider, and the provider works as soon as discovery
succeeds. While discovery keeps failing, sign-in and account linking
still return `PROVIDER_NOT_FOUND` and callbacks redirect with
`error=oauth_provider_not_found`, and each request may wait up to 10
seconds for the retry.

-
[#&#8203;11549](https://redirect.github.com/better-auth/better-auth/pull/11549)
[`1bd5c37`](1bd5c37884)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`lastLoginMethod` failing sign-in when `cookieName` or `maxAge` is
explicitly `undefined`.

-
[#&#8203;11174](https://redirect.github.com/better-auth/better-auth/pull/11174)
[`766cfb3`](766cfb3f42)
Thanks [@&#8203;Bekacru](https://redirect.github.com/Bekacru)! - Stop
double-decoding `callbackURL`, `newUserCallbackURL` and
`errorCallbackURL` on magic link verify so percent-encoded characters in
callback query params are preserved.

-
[#&#8203;11505](https://redirect.github.com/better-auth/better-auth/pull/11505)
[`c46992f`](c46992f6ce)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
Preserve the referenced model and field keys when generating Kysely
migrations, so custom table names that match another model key produce
the intended foreign keys.

-
[#&#8203;11718](https://redirect.github.com/better-auth/better-auth/pull/11718)
[`1d95ebf`](1d95ebf3fe)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
missing device sessions and failed automatic session switching after
cache eviction when `storeSessionInDatabase` is enabled and
`preserveSessionInDatabase` is disabled. Automatic switching now follows
the order of held sessions, and large lists or sessions whose users no
longer exist no longer cause valid sessions to disappear.

-
[#&#8203;10266](https://redirect.github.com/better-auth/better-auth/pull/10266)
[`c68b2cd`](c68b2cd8a5)
Thanks [@&#8203;shiminshen](https://redirect.github.com/shiminshen)! -
Projects that enable `exactOptionalPropertyTypes` can use the
`oauthProvider()` and `mcp()` plugins again. Since 1.7.0, adding either
plugin to `betterAuth()` failed to type-check with a TS2322 error.

-
[#&#8203;11637](https://redirect.github.com/better-auth/better-auth/pull/11637)
[`2627237`](2627237fae)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Projects using the organization plugin with `skipLibCheck: false` no
longer get `TS2536: Type '"role"' cannot be used to index type ...` from
`crud-members.d.mts`. The `role` returned by `getActiveMemberRole` is
now typed as the organization's role names directly. Projects with
`skipLibCheck: true` (the default in most templates) were unaffected.

-
[#&#8203;10866](https://redirect.github.com/better-auth/better-auth/pull/10866)
[`3d1f008`](3d1f008ae3)
Thanks [@&#8203;heliohm](https://redirect.github.com/heliohm)! - The
organization plugin no longer pulls every zod locale into server
bundles.

-
[#&#8203;11626](https://redirect.github.com/better-auth/better-auth/pull/11626)
[`67743ed`](67743ed6e8)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Password resets and password changes no longer keep the new password
when revoking the user's sessions fails. With
`revokeSessionsOnPasswordReset` or `revokeOtherSessions`, database
sessions are revoked and the password is saved in one transaction when
transactions are enabled for the adapter, so a failure leaves the old
password and sessions in place. Sessions in secondary storage are still
removed after commit, on a best-effort basis. This covers
`/reset-password`, the email OTP and phone number reset endpoints, and
`/change-password`. `onPasswordReset` now runs after sessions are
revoked, so a throwing callback no longer leaves them active, and a
callback that lists the user's sessions no longer sees the revoked ones.

-
[#&#8203;10698](https://redirect.github.com/better-auth/better-auth/pull/10698)
[`f0ce580`](f0ce580fbd)
Thanks
[@&#8203;jashkarangiya](https://redirect.github.com/jashkarangiya)! - If
you set the phone number plugin's `verifyOTP` option,
`/phone-number/reset-password` now checks the code with it, as
`/phone-number/verify` already does. Before, password reset always
compared the code with the one Better Auth generated, so apps that
verify codes through a provider such as Twilio Verify could not reset
passwords. If your `sendPasswordResetOTP` sends the code Better Auth
generates, make sure `verifyOTP` accepts that code. Apps that don't set
`verifyOTP` are unaffected.

-
[#&#8203;11646](https://redirect.github.com/better-auth/better-auth/pull/11646)
[`07a0938`](07a09389ef)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- A failed password reset no longer spends the reset link or OTP.
`/reset-password`, `/email-otp/reset-password` and
`/phone-number/reset-password` now check the token or code without
consuming it, validate and hash the new password, then consume it in the
same transaction as the session revocation and password write. A
rejected password, such as one refused by `haveIBeenPwned`, always
leaves the link or OTP usable. A later failure, such as a failed session
revocation or password write, also leaves it usable when the adapter's
transactions are enabled and verification values are stored in the
database (the default without secondary storage, or
`verification.storeInDatabase: true`). Wrong codes still count against
the OTP attempt limit.

-
[#&#8203;11643](https://redirect.github.com/better-auth/better-auth/pull/11643)
[`92dfcea`](92dfceaa14)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- A sign-up that fails after its session is created no longer leaves
that session in secondary storage. With `storeSessionInDatabase` enabled
and `preserveSessionInDatabase` off, the secondary-storage copy is
written only after the sign-up commits, and listing a user's sessions
now reads the database, so a session whose cached copy failed to write
is still listed and revoked. With other secondary-storage settings,
sign-up, passkey registration and SSO sign-in with `resolveUser` keep
the session write inside their transaction, so a storage failure rolls
back the new user, passkey or account instead of keeping them without a
session. A session revoked by a `session.create.after` database hook
also stays revoked.

-
[#&#8203;11488](https://redirect.github.com/better-auth/better-auth/pull/11488)
[`e15625f`](e15625ff38)
Thanks [@&#8203;Bekacru](https://redirect.github.com/Bekacru)! -
SvelteKit 3 projects can now install Better Auth without
`--legacy-peer-deps`. The `@sveltejs/kit` peer range now includes
`^3.0.0`; SvelteKit 2 projects are unaffected.

- Updated dependencies
\[[`4175b34`](4175b34a8f),
[`435645e`](435645e5eb),
[`369176e`](369176e7f6),
[`0cfe07d`](0cfe07dccd),
[`9904b29`](9904b29ece),
[`e78f15a`](e78f15aa31),
[`60525e0`](60525e08fd),
[`8133265`](813326536c),
[`ea85d13`](ea85d133d6),
[`916ef5c`](916ef5c530),
[`1d95ebf`](1d95ebf3fe),
[`6214610`](62146108c7),
[`67743ed`](67743ed6e8),
[`c46d2a6`](c46d2a6ac4),
[`92dfcea`](92dfceaa14),
[`a9f455d`](a9f455d586),
[`9725f1b`](9725f1b361)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.8
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.8
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.8
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.8
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.8
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.8
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.8

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am every weekday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend Renovate
CLI](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODYuNCIsInVwZGF0ZWRJblZlciI6IjQ0LjE5Mi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-28 19:24:36 +00:00
Dane - AI (Mastra)
4f60903242
chore(deps): lock file maintenance (#27013) 2026-10-21 09:25:38 +02:00
shreyas-mastra
f3cf77305f
security: Vanta remediation (2026-10-20) (#27828) 2026-10-20 08:39:07 -07:00
shreyas-mastra
fa409d430b
security: Vanta remediation pass 2026-10-14/15/19 (zod 4.6.7, @ai-sdk/provider-utils, @copilotkit template) (#27023) 2026-10-19 11:32:32 -07:00
shreyas-mastra
7aec8b0d95
security: Vanta remediation pass 2026-10-12 (better-auth, MCP SDK) (#26773)
## Summary
Vanta remediation for 2026-10-12. Target list is today's live export (77
findings, 44 unique IDs). Platform findings are handled in
mastra-ai/platform#3317.

### What changed
| Package | From → To | Findings | Where | How |
|---|---|---|---|---|
| better-auth | 1.7.5 → 1.7.7 | AIKIDO-2026-373183 (Critical) | root +
`examples/agent` | raise override `better-auth: ^1.7.7`; direct dep
`@mastra/auth-better-auth` ^1.7.7 |
| @better-auth/drizzle-adapter | 1.7.5 → 1.7.7 | AIKIDO-2026-261025
(Low) | root + `examples/agent` | floor
`'@better-auth/drizzle-adapter@<1.7.7': 1.7.7` (also pulled by
better-auth 1.7.7) |
| @modelcontextprotocol/sdk | 1.31.0 → 1.32.1 | AIKIDO-2026-365378
(High), -156139, -344432 | root, nested locks, `scripts/gh-issue-triage`
| raise floor to `<1.32.0 → 1.32.1`; bump direct pins/ranges |

Nested `pnpm-workspace.yaml` floors raised in e2e-tests/*, examples/*,
integration-tests, etc., and those lockfiles regenerated. Versions used
were published >24h ago (minimumReleaseAge). Patch changeset included
for published packages whose dependency ranges changed.

Aikido lens on this branch: better-auth and MCP SDK findings are gone.
OSV: handlebars already clear on main; remaining high are
braces/extract-zip (no patch).

### Left as-is (no patch, or major-only)
- extract-zip ≤2.0.1: no fix (overdue; removed by #25855 when that
lands). Needs Vanta risk acceptance.
- braces 3.0.3, sprintf-js 1.0.3/1.1.3: no patched release
- postcss-selector-parser 6.x: @tailwindcss/typography pins 6.0.10
- katex 0.16: mermaid declares ^0.16.47
- @ag-ui/client 0.0.59: fix only in 1.0.0 (major). Parent
`@copilotkit/channels-*` 0.11.0 pins 0.0.59 exactly
(template-genui-data-explorer)
- @hono/node-server 1.19 (fix 2.1.3), undici 6.29 (fix 7.23/8.10),
raw-body 3 in templates (fix 4), bundle-name 3 (fix 4.1.1), got 15 (fix
16), zod 3.25 (fix 4.x), @bufbuild/protobuf 1.10 (fix 2.x), openai 6.49
(fix 7.x), jose 5.10 via @segment/analytics-node in template (fix 6.x),
@ai-sdk/provider-utils 2.2.8 / 3.0.x Aikido ranges wanting 4.0.18+:
major-only or scanner range noise

Do not merge unless reviewed. No CI weakened.


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

## ELI5

This PR updates shared dependency versions so the project uses newer
releases of Better Auth and the MCP SDK. It also updates workspace rules
to keep older versions from being selected.

## Changes

- Updated Better Auth requirements and workspace overrides to `^1.7.7`.
- Updated `@modelcontextprotocol/sdk` requirements and overrides to
`1.32.1` across affected packages and workspaces.
- Added overrides for older `@better-auth/drizzle-adapter` versions to
use `1.7.7`.
- Added a patch changeset for `@mastra/auth-better-auth`,
`@mastra/mcp-registry-registry`, and `@mastra/playground-ui`.

Test results and review findings were not provided.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-13 07:41:26 -07:00
shreyas-mastra
ea7ca755a4
security: Vanta remediation pass 2026-10-07 (MCP SDK, sharp, hono) (#26260) 2026-10-07 09:29:07 -07:00
shreyas-mastra
4358322b7b
chore(deps): override upstream-blocked vulnerable transitive deps (#25853) 2026-10-02 18:03:50 -07:00
shreyas-mastra
7b777d38d9
security: Vanta zero pass 2026-09-23 (grpc/compression/provider-utils floors) (#24848) 2026-09-23 13:58:39 -07:00
shreyas-mastra
a2c9876f0d
security: Vanta direct-dependency bumps (no overrides) (#24308) 2026-09-17 12:24:05 -07:00
Abhi Aiyer
af2a951469
fix: secure remaining example and Fastify dependencies (#22587)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-08-31 14:23:21 +02:00
Dane - AI (Mastra)
1aad6198fd
chore(deps): lock file maintenance (#19903) 2026-07-22 17:05:00 +02:00
Dane - AI (Mastra)
2592c7226a
chore(deps): lock file maintenance (#19457)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am on wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjMuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->
2026-07-17 20:28:50 +02:00
Lennart
3356bf3dd0
chore(docs): AX improvements (#19631) 2026-07-17 14:29:48 +02:00
Dane - AI (Mastra)
2e858270c6
chore(deps): lock file maintenance (#19080)
Co-authored-by: wardpeet <ward@coding-tech.com>
2026-07-13 23:54:17 +02:00
Abhi Aiyer
401e29d34b
fix(ci): unbreak renovate PRs — cap cookie override and fix standalone package installs (#19249)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
Co-authored-by: wardpeet <ward@coding-tech.com>
2026-07-13 14:05:42 +02:00
Roamin
fb8aea3842
fix: multi-tenant Composio tool auth for Agent Builder (#19144)
Co-authored-by: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai>
2026-07-10 21:51:53 +02:00
Marvin Frachet
e8eee50879
feat: Signals, live Entity-Learning data with entity filter, layout polish, and entity-aware navigation (#18699)
https://github.com/user-attachments/assets/dee31cb1-68ba-4a89-bd56-41fe9c6515f8



## Summary

Makes the Studio **Signals** page a live feature backed by the platform
Entity-Learning API instead of hardcoded mock data. You can pick any
entity reported by the platform (agents, tools, workflows, and more) and
inspect that entity's signals, their clusters, traces, and the cluster
scatter plot — all fetched live.

## What changed

**Live data + entity filter**
- Added an entity-type / entity filter bar at the top of the Signals
page, mirroring the traces filter, so you can choose any supported
entity on the server.
- The overview loads each available signal's real clusters (topics) by
entity id and organization id; the details page renders live topics,
topic examples, and points directly with no mock/mapping layer.
- The cluster scatter plot and sidebar swatches derive their colors from
the same per-cluster source, so the chart and list stay in sync.

**Gating change**
- The Signals UI is now gated on the platform observability endpoint
being configured, replacing the removed `MASTRA_SIGNALS_UI` flag.
Studio's served HTML now exposes `MASTRA_ORGANIZATION_ID`,
`MASTRA_PLATFORM_PROJECT_ID`, and
`MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT` to the browser. Set
`MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT` to enable Signals; leave it
unset to hide it.

**Layout & navigation polish**
- Pinned the entity filter as a top bar with centered
empty/loading/error states using the shared `EmptyState` component.
- Added a 4-cell skeleton grid while a signal's clusters load, reserving
badge height to avoid layout shift.
- Clicking a cluster card opens its topic by default via a `topicId`
query param threaded through the route adapters.
- The Signals breadcrumb preserves the selected `entityType` /
`entityId` query params when navigating back to the overview.

## Test plan

- `pnpm --filter ./packages/playground-ui typecheck` — clean
- `pnpm --filter ./packages/playground typecheck` — clean
- `pnpm --filter ./packages/playground-ui test` — 546 tests pass
(Signals overview, details, hooks, and entity-learning service suites
included)
- `pnpm --filter ./packages/playground test` — 1429 pass / 2 skipped,
including the Signals route-adapter suite (7 tests) covering
entity-aware navigation, topicId passthrough, and breadcrumb query-param
preservation
- Tests use the package-standard approach: real `@mastra/client-js` +
React Query driven through MSW handlers and typed fixtures, no `vi.mock`
of local hooks/services.

Draft for review.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
The Signals page used to show pretend data. Now it pulls real
“entity-learning” signals from your platform (plus charts and examples),
and it only turns on when the platform observability endpoint is
configured.

## Summary
- Reworked the Signals UI to load live Entity-Learning data (entities,
topics/clusters, topic examples, points, and scatter plot) instead of
hardcoded mock data.
- Added an agent (entity) filter and updated the overview to render
topic-based cluster cards with loading/empty/error states.
- Refactored the details view to be topic-driven: live topic
examples/trace list, point-based chart/scatter rendering, shared
cluster-color logic, a 4-cell cluster loading skeleton, and default
opening via `topicId`.
- Updated navigation and breadcrumbs so `entityType`/`entityId` and
`topicId` query parameters are preserved when moving between overview,
details, and back links.
- Changed UI gating by removing the `MASTRA_SIGNALS_UI` flag and
enabling the Signals route when `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT`
is configured; the browser now receives `MASTRA_ORGANIZATION_ID`,
`MASTRA_PLATFORM_PROJECT_ID`, and
`MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT`.
- Added the Entity-Learning integration layer (typed service), React
Query hooks, and expanded test coverage for the new live flows and
routing behaviors.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai>
2026-07-02 11:15:31 +02:00
Ward Peeters
213feb87bf
fix(core,schema-compat): resolve TS2589 type instantiation depth errors in workflows (#18608)
Co-authored-by: Mastra Code (alibaba-token-plan/glm-5.2)
Co-authored-by: Mastra Code (alibaba-token-plan/glm-5.2) <noreply@mastra.ai>
2026-06-29 13:07:27 +02:00
YujohnNattrass
3515d9eba2
feat(playground): tool provider integrations UI (connections + picker + auto-pin) (#17223)
Draft for review. Stacked on top of `yj/v1-tool-provider-backend` (the
v1 ToolProvider backend extraction, which IS off `main`).

## Stack

```
origin/main
└── yj/v1-tool-provider-backend   (1 commit — backend extraction, #TBD)
    └── yj/playground-tool-provider-integrations-v2   (this PR, 5 commits)
```

## Commits (this PR)

1. `c0392cb92b` — feat(playground): MVP tool provider connections page +
builder integration
2. `08e6084965` — feat(tool-providers): PATCH endpoint to rename
connection labels
3. `823ffd32cb` — feat(playground): inline connection picker for
integration tools
4. `791d3a8e9a` — chore(tool-provider): document Composio SDK pin and
add debug logs
5. `e1f68596d6` — feat(playground): auto-pin freshly authorized
connection after OAuth

## What's in here

- `/integrations` page — list/create/disconnect tool provider
connections.
- Agent Builder tools picker — integration tool cards with inline
Connect button + `IntegrationConnectionPicker` beneath checked cards.
- Inline label editing via new `PATCH
/tool-providers/:providerId/connections/:connectionId`.
- Admin-only `authorId` display on connections (gated by
`tool-providers:admin`).
- Auto-pin: a freshly authorized connection gets pinned to the form
(from picker "Connect new", or from card "Connect" when the tool is
already checked).
- Composio SDK pinned to `^0.6.5` with a notes doc explaining why
(`.notes/composio-sdk-pinned-0.6.5.md`).

## Verification

- `pnpm --filter ./packages/playground typecheck` — 14 pre-existing
`DataList.RowWrapper` errors unrelated to this diff
(datasets/experiments/workspace pages); 0 errors in touched files.
- `pnpm --filter ./packages/playground build` — clean
- Focused tests: `tools.test.tsx` 13/18 pass (5 pre-existing
PointerEvent JSDOM flakes in filter-checkbox tests unrelated to this
PR), `integration-connection-picker.test.tsx` 11/11 pass.

## Notes for reviewer

- Base is `yj/v1-tool-provider-backend` so the review diff is just the 5
frontend commits. The backend branch is the v1 ToolProvider extraction
(#16934 carved out).
- Not for merge yet. Once approved, both branches land via separate PRs
into `main` (backend first).


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

This PR adds a simple UI so people building AI agents can connect
external services (like Gmail) from the Agent Builder and a new
Integrations page; when you authorize a connection in a popup it becomes
available and—if relevant—gets automatically pinned into the agent’s
settings.

## Overview

Frontend-only MVP wiring for tool-provider integrations: a new
/integrations page, integration tools shown in the Agent Builder picker
with inline connect/rename/disconnect flows, OAuth popup + polling, and
auto-pin behavior for newly authorized connections. Admins can view
grouped connections by author; non-admins see only their own connections
in the picker. The v1 ToolProvider backend branch must land first—this
PR is draft and not for merge yet.

## Key Features

- Integrations page (/integrations): select provider/toolkit, connect
via OAuth (optional label), list and disconnect connections; admin view
groups connections by author.
- Agent Builder picker: integration tool cards, toolkit filter pane with
per-toolkit connection controls, connection-name badges on cards, inline
rename (PATCH), manage dialog for multi-connection drill-down and
disconnect.
- Auto-pin: newly authorized connections are automatically pinned into
the agent form when relevant tools/toolkits are selected; connecting
from a checked tool pins the connection and may auto-check the tool.
- Picker scoping & admin UX: picker scoped to caller authorId so editors
see only their own connections; users with tool-providers:admin
permission see grouped/owned/shared views.
- Form/schema & persistence: toolProviders added to form schema with
cross-field validation; save flow includes toolProviders when present;
mappers support form↔stored round-trips.

## Technical Summary

- New pages/components: IntegrationsPage and supporting components
(ProviderToolkitSelector, ExistingConnectionsPanel,
ManageConnectionDialog/List/Form, ManageConnectionForm,
ManageConnectionList, TwoPanePickerSkeleton, ToolkitFilterPane,
ToolkitConnectionControl, ToolGrid, ToolCard, FilterableList, etc.).
- Hooks & client flows: useAllProviderTools, useAllConnections,
useExistingConnections, useAuthorize (OAuth popup + polling),
useDisconnectConnection, useUpdateConnection, useIsToolProviderAdmin,
useProviderToolkitGroups, useToolkitSelection, useToolSelection,
useDebouncedConnectionRename, and related re-exports.
- Schemas & mappers: toolProvidersFormSchema, validateToolProviders,
buildToolProvidersForSave, extractFormToolProviders;
AgentBuilderEditFormSchema extended with optional toolProviders and
superRefine validation; routeToolInputToFormKeys and
useSetAgentToolsTool updated to carry toolProvidersFragment.
- Types & SDK: AgentTool gains 'integration' type and integration fields
(providerId, toolkit, hasConnection, connectionLabels); client route
type PostToolProvidersProviderIdAuthorize_Body.connectionId made
optional; Composio SDK pinned to ^0.6.5; debug logs added for provider
resolution.
- UI/UX adjustments: AgentSelectableCard footer slot; picker/tabs/layout
tweaks and new two-pane picker skeleton for consistent loading UX.
- Tests & fixtures: many new/updated Vitest + RTL tests and MSW
fixtures/handlers for providers/toolkits/tools/connections; jsdom
PointerEvent→MouseEvent shims in tests; some hook tests skipped pending
harness adjustments; focused typecheck/build clean for touched files.

## Verification & Notes

- Focused typecheck/build for modified files is clean; tests
added/updated to exercise integration flows (not all existing tests
fully unskipped; some pre-existing JSDOM flakes noted).
- Base backend branch yj/v1-tool-provider-backend must land before
merging.
- This PR is draft and not-for-merge yet.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: YJ <yj@example.com>
Co-authored-by: Mastra Code (anthropic/claude-opus-4-7) <noreply@mastra.ai>
Co-authored-by: mfrachet <marvin@mastra.ai>
2026-06-10 14:03:31 +02:00
Tyler Barnes
b3e9781a93
fix(client-js): keep client tools for signal continuations (#17593)
This fixes subscribed client-tool continuations when an agent calls
browser client tools across multiple rounds.

Before, the first signal run stored client tools under the initial run
id. When the server started a continuation with a new run id, the
browser could lose access to those client tools and stop at `finish:
tool-calls`.

```ts
run-initial -> client tool result -> run-continuation -> finish: tool-calls // browser has no clientTools
```

Now the client keeps the thread-scoped runtime options available before
sending the continuation result, so follow-up continuation runs can keep
executing client tools.

```ts
run-initial -> client tool result -> run-continuation -> client tool result -> ...
```

I also added a regression test for multiple subscribed client-tool
continuation rounds and documented that Agent Builder local testing
needs `pnpm build:cli` before restarting with `pnpm mastra dev`.


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

When a browser-based AI agent continued a conversation, it could lose
access to its special toolbox and stop working. This PR keeps the
toolbox available across continuation rounds so the agent can keep using
the tools in subsequent runs.

## Changes Overview

### Core Fix: Preserve Client Tools Across Continuations
- client-sdks/client-js/src/resources/agent.ts
- When a subscribed thread finishes with `tool-calls`, build a single
`continuationStreamOptions` from the active runtime options (including
processed `clientTools`, `requestContext`, and `memory` when `threadId`
exists).
- Persist that `continuationStreamOptions` into signal-runtime state via
`agent.setSignalRuntimeOptions` before sending approvals, and reuse the
same object when calling `agent.sendToolApproval`.
- On `sendToolApproval` failure, delete only the matching latest
thread-scoped runtime options (reference-aware cleanup) while still
removing run-scoped options in `finally`. This prevents losing client
tools across continuation run IDs.

### Test Coverage
- client-sdks/client-js/src/resources/agent.test.ts
- Added a Vitest regression test that simulates two subscribed
continuation cycles across separate run IDs and asserts:
- client tool `execute` is called for each continuation with the correct
per-run args,
    - `sendToolApproval` is invoked for each continuation,
    - emitted `tool-result` stream contains both tool-call IDs.

### Documentation
- examples/agent-builder/AGENTS.md
- Added local dev instructions: rebuild the CLI with `pnpm build:cli`
from the repo root before restarting the example with `pnpm mastra dev`
so local changes to the CLI are picked up.

### Release Notes
- .changeset/tiny-pianos-wave.md
- Bumps `@mastra/client-js` patch and documents the fix keeping client
tools available across subscribed continuation runs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-04 16:00:01 -07:00
Marvin Frachet
bea9a679f8
feat(playground,editor): Agent Builder shortcut, sidebar polish, and request-context defaults (#17109)
## What this PR ships

This branch makes the Agent Builder reachable, well-integrated with
Studio, and aware of the current user — so a fresh builder agent can
immediately participate in request-context features without setup.

It bundles several related improvements:

1. **Agent Builder shortcut in the Studio sidebar** so users can jump to
the builder from anywhere in Studio.
2. **Agent Builder sidebar logo links back to `/agents`**, matching
Studio's navigation expectations.
3. **`@mastra/editor` lets consumers override the `createBuilderAgent`
constructor args** so embedders can customize how the builder agent is
constructed.
4. **Agent Builder sidebar chrome aligned with Studio** (visual + layout
parity).
5. **Changeset added** for the editor override capability.
6. **Builder chat passes the current user in its stream request
context** so agent runs receive the authenticated user.
7. **Builder-created agents are born with a default
`requestContextSchema`** describing a single `user` variable matching
the `CurrentUser` shape, so downstream features (instruction
interpolation, request-context presets, autocomplete) can read `user`
from any builder agent without any UI step at creation time.

Together, this means: a user can reach the builder from Studio, create
an agent in one click, and immediately use `user` in the agent's
instructions / request-context flows — no manual schema authoring
required.

## Test plan

- `pnpm --filter ./packages/playground typecheck` passes
- New and existing vitest suites for the agent-builder starter and
constants pass (8 tests across 2 files)
- Manual: open Studio, click the new Agent Builder sidebar entry, create
a new agent from the starter, then fetch the stored agent and confirm
`requestContextSchema` contains a `user` object with the expected fields

## Notes

- The default `requestContextSchema` only affects newly created builder
agents. Existing agents and subsequent builder saves are not modified.
- No new UI surface is introduced for the request-context default — it's
a fixed schema applied at create time.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR makes the Agent Builder tool easier to find in Mastra Studio by
adding a shortcut in the sidebar, and ensures agents created there
automatically know who's using them so they can work with personalized
features right away.

---

## Overview

This PR enhances the Agent Builder's integration with Mastra Studio by
making it discoverable via a sidebar shortcut, improving navigation
consistency, enabling constructor-level customization, and ensuring
builder-created agents come pre-configured with user-context awareness.

## Key Changes

### UI & Navigation Integration
- Added an "Agent Builder" sidebar shortcut that conditionally appears
based on user authentication and builder access permissions via new
`useAgentBuilderSidebarVisibility` hook
- Agent Builder sidebar logo now links to `/agents` to match Studio
navigation patterns
- Aligned Agent Builder sidebar layout and chrome (header/trigger UI)
with Studio design conventions
- Removed header controls from agents page that are now redundant with
the sidebar navigation

### Agent Builder Constructor Enhancements
- `createBuilderAgent()` in `@mastra/editor` now accepts an optional
partial constructor argument, allowing embedders to override agent
defaults (e.g., `model`, `instructions`) while preserving canonical
`id`, `name`, and `description`
- Agent constructor now explicitly includes the `workspace` binding
- Published changeset documenting the new override capability

### Request Context & User Awareness
- `StreamChatProvider` now reads the current authenticated user via
`useCurrentUser()` and injects it into the request context before
sending messages to agents, enabling agents to access caller identity
- Newly created builder agents automatically receive a
`DEFAULT_BUILDER_REQUEST_CONTEXT_SCHEMA` that defines a top-level `user`
object matching the `CurrentUser` shape (`id`, `email`, `name`,
`avatarUrl`, `roles`, `permissions`), with `id` as the only required
field
- Schema application is automatic at creation time with no new UI
required; existing agents and subsequent saves remain unaffected

### Build & Workspace Integration
- Updated `tsup.config.ts` to bundle the `src/ee/workspace` directory
into `dist/ee/workspace` on successful build
- Added comprehensive skill authoring documentation defining playbooks
and quality standards for eight agent archetypes: generic-assistant,
coding-agent, content-writer-agent, customer-support-agent,
ops-automation-agent, research-agent, spreadsheet-agent, and a universal
agent-prompt-quality-bar skill

### Auth & Permissions
- Tightened example auth role mapping: member role in WorkOS RBAC now
maps to empty permissions array instead of full access (`'*'`)

### Testing
- Added comprehensive sidebar visibility tests via `AppSidebar` Vitest
suite covering auth states, RBAC conditions, and permission checks
- Added `DEFAULT_BUILDER_REQUEST_CONTEXT_SCHEMA` validation tests
- Updated `StreamChatProvider` tests to properly seed React Query cache
for `useCurrentUser` hook and register MSW handlers for auth endpoints
- Updated agent-builder-starter tests to verify `requestContextSchema`
is included in agent creation payload
- Removed `AgentChatPanel` test file and simplified the component export
to eliminate wrapper re-export

## Technical Details

**Accessibility Control**: The Agent Builder sidebar link visibility is
gated by auth capabilities and fine-grained permissions
(`stored-agents:*` or `stored-agents:read`), mirroring root-layout
access checks.

**Schema Design**: The `DEFAULT_BUILDER_REQUEST_CONTEXT_SCHEMA` uses a
JSON Schema-like structure ensuring newly created agents have a
consistent, documented interface for accessing authenticated user
information at runtime.

**Build Configuration**: Workspace skills are now bundled with the
editor package, making them available for builder runtime operations
like skill discovery, reading, and quality validation.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/17109?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Mastra Code (anthropic/claude-opus-4-7) <noreply@mastra.ai>
2026-05-27 11:33:48 +02:00
Marvin Frachet
271d8917e4
feat(client-js,playground): port magnificent-marquess frontend stack (#17105)
## What

Ports the scoped frontend stack from `yj/magnificent-marquess` onto
`rain-purpose` as one reviewable PR, while preserving the newer
client-tools-on-signals (#16540) and Agent Builder view/edit pages
(#17104) work that already landed on `rain-purpose`. Also brings over
`examples/agent-builder/` for end-to-end smoke testing.

## Scope

**`@mastra/client-js`**
- New `ToolProvider` resource + unit tests
- `getModelPolicy` accessor on the root client
- Regenerated route types

**`@internal/playground`**
- **Auth**: `route-permissions` module, `RoutePermissionGuard`, login
layout, `ImpersonationBanner`, `RoleImpersonationProvider`, expanded
user-menu
- **Agent Builder routing**: agents / skills / infrastructure / favorite
/ library + create/edit/view all wired in `App.tsx`,
`AgentBuilderRootLayout`, `RoutePermissionGuard` around the app outlet,
`RoleImpersonationProvider` wrapping `PostHogProvider`,
`StudioIndexRedirect` replacing the `/agents` home redirect
- **Agents**: composer/model-switcher updates, browser-thumbnail/panel
`hideSidebar` plumbing, channels/CMS sidebar tweaks, new
`useUpdateSkill` MSW test
- **LLM**: models/providers/provider-logo updates
- **Misc**: `useRestoreFocus` hook, `studio-index-redirect`, nav-items
entries, tsconfig path tweak, e2e auth login-flow + kitchen-sink fixture
updates

**`examples/agent-builder`**
- New example app for smoke testing the Agent Builder routes locally

## Preserved from rain-purpose (explicitly NOT overwritten)

- `client-sdks/client-js/src/resources/agent.{ts,test.ts}`
- `client-sdks/react/src/agent/hooks.ts`, `package.json`,
`vitest.config.ts`, `hooks.test.ts`
- `packages/playground/src/services/mastra-runtime-provider.tsx`
-
`packages/playground/src/pages/agent-builder/agents/__tests__/{view,edit}.test.tsx`
- `packages/playground/src/domains/builder.ts` (yj #17072 deletion
skipped)

## Test plan

- `pnpm --filter ./client-sdks/client-js test`: **491/491 passing**
- New playground MSW + login-page tests: **13/13 passing**
- `pnpm --filter ./packages/playground exec tsc -p tsconfig.app.json
--noEmit`: same 46 pre-existing errors as `rain-purpose` HEAD; **zero
new errors introduced**
- Smoke test locally with `examples/agent-builder` to validate the new
routes, route-permission guard, and role-impersonation banner


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

This PR brings a sophisticated frontend system from another branch into
the main codebase, adding support for role-based access controls,
authentication, and an improved Agent Builder interface. It's like
moving a fully furnished house into a new location while keeping all the
original furniture that was already there.

---

## Overview

Ports the `yj/magnificent-marquess` frontend stack onto `rain-purpose`,
integrating route-based permission controls, role impersonation,
enhanced authentication flows, and Agent Builder routing while
preserving existing `client-tools-on-signals` and Agent Builder
view/edit functionality. Includes a new `examples/agent-builder` app for
local smoke testing.

## `@mastra/client-js`

- **ToolProvider resource**: New resource type with unit tests
- **getModelPolicy accessor**: Added to root client for admin model
policy access
- **Route types**: Regenerated for new endpoints

## `@internal/playground`

### Authentication & Permissions
- **route-permissions module**: Centralized registry mapping Studio
routes to required permissions with utilities for permission resolution
and access determination
- **RoutePermissionGuard**: New component gating route access based on
user permissions, with deterministic redirects to `/agents` for viewers
without `tools:read`
- **Role impersonation**: `RoleImpersonationProvider`,
`useRoleImpersonation` hook, and `ImpersonationBanner` component
enabling admins to preview the app as different roles
- **LoginLayout component**: Shared visual shell for auth pages
- **Login flow tests**: E2E tests for unauthenticated redirects with
credential submission and auth-disabled routes; parity tests for
login/signup UI across auth capability modes

### Agent Builder Routing
- **Route wiring**: Integrated
agents/skills/infrastructure/favorite/library routes with
create/edit/view flows in `App.tsx` and `AgentBuilderRootLayout`
- **Layout guards**: Wrapped app outlet with `RoutePermissionGuard` and
`PostHogProvider` with `RoleImpersonationProvider`
- **Home redirect**: Replaced `/agents` redirect with
`StudioIndexRedirect` for permission-aware home routing

### Agent Builder & Agents UI
- **Model policy integration**: Composer and model-switcher components
now respect admin model policies, showing "locked by admin" chips and
stale-model warnings
- **Browser sidebar control**: Added `hideSidebar` prop plumbing through
`AgentChatPanelChat` → `BrowserThumbnailSlot` → `BrowserThumbnail`
- **Skill editing**: `SkillEditDialog` refactored to support
view/edit/create modes with optional chat-driven field population,
file-tree editing for admins, and update mutations
- **CMS sidebar feature-gating**: Sections now filtered by builder
feature toggles
- **Browser view refactoring**: `BrowserViewPanel` simplified to use
`useRestoreFocus` hook and modal-only behavior
- **Workspace selector**: Now conditionally rendered only when workspace
options are available

### LLM & Providers
- **Model/provider filtering**: Updated to incorporate builder admin
policies via `useBuilderFilteredModels`/`useBuilderFilteredProviders`
- **Provider logo styling**: Added optional `style` prop for custom CSS
properties

### Hooks & Utilities
- **useRestoreFocus**: New hook capturing and restoring focus when modal
opens/closes
- **useCanCreateAgent**: Moved to `agent-builder` domain for Agent
Builder context
- **useUpdateSkill**: MSW tests added for sparse PATCH request
validation
- **useStoredAgents**: Added model-policy error handling and cache
invalidation for builder-settings

### Navigation & Layout
- **Nav items refactoring**: Removed per-item permission fields;
permission checks now centralized via `route-permissions`
- **User menu expansion**: Added role-preview section with
role-switching controls and visual active states
- **ImpersonationBanner**: Displayed in both AppSidebar and
AgentBuilderSidebar when impersonation is active
- **useDefaultVisibility hook**: New utility for visibility state
management
- **Auth capabilities**: Added `availableRoles` field to
`AuthenticatedCapabilities` for admin role-switching

### Configuration & Dev
- **Dev script update**: `dev` script now runs Vite with
`MASTRA_AUTO_DETECT_URL=true`
- **Playwright auth tests**: Updated viewer-role E2E test to wait for
deterministic redirects
- **TypeScript**: Added kitchen-sink `MastraEditor` builder
configuration with tools and avatar-upload features
- **CSS**: Added `@keyframes shimmer-text` animation for text shimmer
effects

## examples/agent-builder

New example app for local Agent Builder smoke testing with:
- **Mastra setup**: Configured with LibSQL storage, WorkOS
authentication, RBAC provider with role-to-permissions mapping, Slack
provider, and Stagehand browser support
- **Agents**: `weatherAgent` with OpenAI `gpt-4o-mini` model
- **Tools**: `weatherInfo`, `weatherTool`, `diceRoll`, `coinFlip`,
`randomQuote` with Zod schemas
- **Workflows**: `greetWorkflow` demonstrating step composition and Zod
validation
- **Workspace**: E2B sandbox with Git environment variable support
- **Configuration**: Role-based builder with feature toggles, browser
workspace via Stagehand, Composio tool provider, Swagger API docs, and
observability with cloud exporters
- **Dev setup**: pnpm-based with local workspace links to `@mastra/*`
packages, MSW mocking, and `mastra:dev`/`mastra:build` commands

## Testing

- **client-js tests**: 491/491 passing
- **Playground tests**: 13/13 passing (new MSW + login-page tests)
- **TypeScript**: 46 pre-existing errors, zero new errors
- **Manual testing**: Examples/agent-builder smoke tests for routes,
guards, and impersonation banner

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/17105?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Mastra Code (anthropic/claude-opus-4-7) <noreply@mastra.ai>
2026-05-27 02:24:04 +02:00