Repository navigation
fix(deps): Bump zod to 4.6.7 for GHSA-mrhx-c7xc-m3w5 - #562
Merged
Merged
Conversation
Bump the direct zod dependency to ^4.6.7 in every workspace package and override transitive zod 4.x below 4.6.6 (pulled in by the Vercel CLI) to 4.6.7. zod < 4.6.6 parses every element of a collection before applying upper size bounds, which allows memory exhaustion on oversized input. Regenerate specs/jsonl-schema.json for the new zod JSON Schema output. Co-Authored-By: Jeffrey Hung <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # pnpm-lock.yaml
Jeffreyhung
approved these changes
Nov 4, 2026
Jeffreyhung
added a commit
that referenced
this pull request
Nov 4, 2026
The `evals` job fails before running anything on PRs that touch `packages/evals/` (e.g. #562): `WARDEN_ANTHROPIC_API_KEY is required to run evals in CI`. The workflow only wires the Anthropic secret. Warden's own review workflow dropped that key in #434 and runs on `WARDEN_OPENROUTER_API_KEY`, which resolves fine on the same PRs. The evals harness was also hardcoded to Anthropic: suites skipped without `ANTHROPIC_API_KEY`, and the judge called the Anthropic SDK directly. ## Changes **Provider selection (`packages/evals/src/provider.ts`)** - `WARDEN_EVAL_MODEL`: a Pi `provider/model` selector. When set, it replaces every scenario's model, forces the Pi runtime, and enables the suites without an Anthropic key. - `WARDEN_EVAL_JUDGE_MODEL`: optional judge model. Defaults to `WARDEN_EVAL_MODEL`, then `anthropic/claude-sonnet-4-6`. - Credentials use the existing `WARDEN_<PROVIDER>_API_KEY` convention, which eval setup already bridges to the SDK's env name. - With neither variable set, behavior is unchanged: YAML models, Anthropic key required. **Judge** - `runJudge` now goes through `getRuntime('pi').runAuxiliary` with the configured model instead of `new Anthropic()`. Same prompt, same verdict-count validation, same fail-closed fallback. - Adds an `eval_judge` auxiliary task name so judge calls are labeled in telemetry. - `@anthropic-ai/sdk` is no longer a dependency of `warden-evals`. **Workflow** - `WARDEN_EVAL_MODEL` defaults to `openrouter/anthropic/claude-sonnet-4.6`. That's the same model the suites already pin, so scores stay comparable, on the OpenRouter key the repo already has. The `WARDEN_EVAL_MODEL` / `WARDEN_EVAL_JUDGE_MODEL` repo variables override it. - Passes `WARDEN_OPENROUTER_API_KEY`, `WARDEN_ANTHROPIC_API_KEY`, and `WARDEN_OPENAI_API_KEY`. Unset secrets are empty and harmless. - "Verify eval credentials" checks the `WARDEN_<PROVIDER>_API_KEY` for each selected model and names the missing one. - "Create eval status check" only runs when verification passed. It used to throw a second, misleading `Eval results file not found` on top of the real error. This PR touches `evals.yml`, so its own `evals` run exercises the OpenRouter path end to end. ## Verification - New `provider.test.ts` and `judge.test.ts`. `harness.test.ts` was updated for the new judge options. The evals unit suite passes: 69 tests. - `pnpm lint`, `pnpm build`, and typecheck all pass. The Warden `src/sdk` tests pass. - With no keys, `pnpm evals` skips all 62 evals, same as before. - With `WARDEN_EVAL_MODEL=openrouter/anthropic/claude-sonnet-4.6` and a fake key, the run reaches OpenRouter on Pi and fails with `Authentication required.`. Without a key it fails locally with `No API key found for openrouter`. - I ran the verify step script locally for: valid key, missing key, a judge on a different provider with a missing key, and a selector without a provider. ## Notes - Providers whose SDK env name doesn't follow `<PROVIDER>_API_KEY` (e.g. `vercel-ai-gateway` → `AI_GATEWAY_API_KEY`) still work locally via the SDK's own env name. In CI the verify step expects the `WARDEN_`-prefixed form, so adding one means adding that secret to the workflow env. <!-- junior-request-attribution:start --> via **Jeffrey Hung**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0AH1TP6CHJ%3A1793816729.438159 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0AH1TP6CHJ%3A1793816729.438159) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0AH1TP6CHJ%3A1793816729.438159/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Jeffrey Hung <[email protected]> Co-authored-by: Claude <[email protected]>
3 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zod < 4.6.6 parses every element of an array/set/map schema and records an issue per invalid element before any upper size bound runs, so oversized input can exhaust memory (GHSA-mrhx-c7xc-m3w5). Semgrep flagged it on #561.
Changes
zoddependency^4.4.3→^4.6.7inpackages/warden,packages/warden-service,packages/warden-service-api,packages/evals, andapps/warden-service.pnpm.overridesentry"zod@>=4.0.0 <4.6.6": "4.6.7"for the transitive[email protected]pulled in by the Vercel CLI (vercel,@vercel/cli-auth,@vercel/cli-config).specs/jsonl-schema.jsonregenerated. zod 4.6 emits slightly different JSON Schema: a primitive union collapses totype: [...], and thedatetimepattern now requires seconds.Behavior change to know about
z.string().datetime()in 4.6 rejects minute-precision timestamps (2026-01-01T00:00Z). 4.4.3 accepted them. Every timestamp Warden and the service client produce comes fromDate#toISOString(), which always includes seconds, so nothing in-repo should be affected. External callers sendingfrom/toto the history API without seconds would now get a 400.Not covered
[email protected]stays, via@vercel/backends,@vercel/express,@vercel/hono, and@vercel/python-analysis. The advisory has no patched 3.x release, and forcing those packages onto zod 4 is a major-version jump inside Vercel's build tooling. That is a deploy-time dependency and doesn't handle untrusted input at runtime..max()bounds to collection schemas that parse untrusted input. That needs per-schema limits and is left for a follow-up.Verification
pnpm install --frozen-lockfilesucceeds. Every workspace package resolveszod 4.6.7.pnpm lint,pnpm build, and typecheck pass.pnpm testpasses exceptsrc/skills/remote.test.ts, which needs network git and fails the same way onmainin my environment.via Jeffrey Hung.
--
View Session [Sentry]