Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/zod-ghsa-mrhx-override.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@truefoundry/trueforge': patch
'@truefoundry/trueforge-ui': patch
---

Security: drop transitive zod 3.25.76 (GHSA-mrhx-c7xc-m3w5, High) from the dependency tree.
11 changes: 4 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ overrides:
resolve: '1.22.11'
# Rollup 4.63.0 OOMs the frontend Vite build (Monaco + compression plugin); stay on 4.62.x.
rollup: '4.62.2'
# GHSA-mrhx-c7xc-m3w5 (zod 3.x memory exhaustion, no fixed 3.x): force zod 4 for transitive deps
# that still pin zod@3 (@ag-ui/core via @openuidev/react-headless; @anthropic-ai/sandbox-runtime).
'@ag-ui/core>zod': '^4.6.7'
'@anthropic-ai/sandbox-runtime>zod': '^4.6.7'
Comment on lines +29 to +32

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nothing guarantees ag-ui or srt will work with zod v4, we should not override like this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed — the override isn't something upstream supports. I looked for a safer fix and couldn't find a clean one, so I haven't changed any code yet. What I found:

Advisory: GHSA-mrhx-c7xc-m3w5 (High) affects zod < 4.6.6, and the only patched version is 4.6.6. The newest 3.x release is 3.25.76, which is what we have, so there's no fixed 3.x to override to.

@ag-ui/core (via @openuidev/react-headless)

  • Every 0.0.x release (up to 0.0.59) depends on zod ^3.22.4 and imports the root zod (v3 API).
  • @ag-ui/core@1.0.x (latest 1.0.4) supports zod v4 properly: peer range ^3.25.18 || ^4.0.0, imports zod/v4.
  • But every @openuidev/react-headless release up to the latest 0.18.8 pins @ag-ui/core ^0.0.53. So we can't get there with a normal version bump.
  • Mitigating detail: at runtime, react-headless only imports EventType (a plain enum) from @ag-ui/core. Everything else it uses is type-only. Building the schemas when the module loads, and a quick EventSchemas.safeParse check (RUN_STARTED / TEXT_MESSAGE_CONTENT / ACTIVITY_SNAPSHOT), both work on zod 4.6.7.

@anthropic-ai/sandbox-runtime (we pin 0.0.77)

  • 0.0.77 depends on zod ^3.24.1 and imports the root zod.
  • 0.0.78 through the latest 0.0.83 depend on zod ^3.25.0 but import zod/v3. zod 4.x still ships that path with the same v3 API.
  • With the override, bumping srt to ≥0.0.78 would mean it runs exactly the v3 API it was written for, instead of the v4 "classic" API under the root import. I didn't bump it, because 0.0.78+ also changes seccomp, proxy and config code and we pin srt exactly.
  • On 0.0.77 with zod 4.6.7, SandboxRuntimeConfigSchema accepts a valid config and rejects an invalid domain with the custom message. That's only a light check, not a guarantee.

Options

  1. Drop the override and accept/document the risk until upstream moves: react-headless → @ag-ui/core@1.x, srt → zod v4. This advisory is about memory use when validating oversized arrays. We only use these schemas for srt config (which we control) and ag-ui event parsing, which react-headless doesn't call.
  2. Keep the srt override and bump srt to 0.0.83 (or 0.0.78), so it goes through zod/v3. Then run tests/sandbox/local/smoke.test.ts and the local sandbox hostRun path on Linux and macOS before merging. For ag-ui, either accept the risk or keep its override, since only EventType is used at runtime.
  3. Keep the current overrides and add targeted smoke tests: the srt config parse plus SandboxManager.initialize/wrapWithSandboxArgv, and the react-headless chat stream.

My preference is (2) for srt and accept/document for ag-ui. Let me know which you'd like and I'll update the PR (it also needs a merge from main).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing changeset for shipped packages

Low Severity

This change alters runtime dependencies of published packages and the frontend bundle that ships in the server tarball, but adds no .changeset/*.md. Repo changeset rules require pnpm changeset with a patch bump for @truefoundry/trueforge and @truefoundry/trueforge-ui.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: TrueForge review rules

Reviewed by Cursor Bugbot for commit 90c71b5. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid. The repo's AGENTS.md requires a changeset when a PR changes the deps of published packages. I pushed 8fad3f4, which adds .changeset/zod-ghsa-mrhx-override.md with patch bumps for @truefoundry/trueforge and @truefoundry/trueforge-ui. It's patch only, as the repo rule requires. Nothing else changed.

Scheduled vuln run (2026-11-16): today's devtest grype scan still shows 0 Critical / 1 High (zod 3.25.76, GHSA-mrhx-c7xc-m3w5) on trueforge, so this PR is still needed.

@chiragjn's concern about the zod v4 override is still open and needs an owner decision. There is no fixed 3.x zod release. The alternatives are to accept the override (with the runtime checks described above) or to wait for upstream @openuidev/react-headless and @anthropic-ai/sandbox-runtime releases that support zod v4.

Loading