> [!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.
---
### @​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>
---
### @​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.
## 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>
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>
## 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 -->
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-->
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>
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>
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 -->
## 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 -->
[](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>
## 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 -->
[](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>