Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
458. High-severity zod CVE pinned into solana-agent-sdk's nested dependency by the most recent commit on main
How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now, no gate, no owner action required.
Operating clause (binding)
- Read CLAUDE.md first. CLAUDE.md overrides everything, including this file.
- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan. A judgment call goes in one line of the final report; it never becomes a question that halts work.
- The only permitted stops are the CLAUDE.md stop-and-ask gates (spend/on-chain, push/deploy/publish, non-$THREE crypto commit content, destroying unrecoverable data). This order touches none of them: it edits
solana-agent-sdk/package.json, regenerates lockfiles, and runs local installs/tests. - The em-dash and en-dash characters are banned in everything you write.
- Concurrent agents share this worktree: stage explicit paths only (never
git add -Aorgit add .), re-checkgit statusandgit diff --stagedbefore each commit. - Before committing, run
npm run check:rules -- --paths <files you touched>. It must exit 0. - Do not confuse this with prompts/finish/454 (root
bigint-buffer/lodash.set/node-forge/@solana/paytriage, already filed, different packages entirely) or with 444/449/450 (vendored WORKER dependency CVEs underworkers/, out of scope here). This order is scoped to one package:zod, inside thesolana-agent-sdkworkspace's own nested resolution. Re-checkprompts/finish/for a number higher than 458 before you start, in case a concurrent agent already filed something that overlaps; if one exists, narrow or drop the overlapping task and say so in the report.
Why this matters (measured 2026-10-25)
- The advisory, from GitHub's own API (not a secondary paraphrase):
curl https://api.github.com/advisories/GHSA-mrhx-c7xc-m3w5returns severityhigh, CVSS 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H),vulnerable_version_range: "< 4.6.6",first_patched_version: "4.6.6". Full description: "Zod schema-validation library through 4.6.5 contains an uncontrolled resource consumption vulnerability that allows attackers to exhaust memory by submitting a large array to an application using an array schema without a length constraint. Attackers can exploit the handleArrayResult parse logic in$ZodArray, which accumulates every validation issue for each failing element with no cap or early termination, causing the process to allocate excessive issue objects and crash due to out-of-memory conditions." Note the advisory's own technical detail ($ZodArray,handleArrayResult) names zod v4's internal class/function, not v3's differently-structured parser; the npm range< 4.6.6is a mechanical semver cutoff that also happens to span all of v3.x. Task 1 below requires you to check whether v3.25.76's actual source has the same unbounded-issue-accumulation behavior before treating "unreachable in our schemas" as the only mitigating fact; don't rely on the range field alone to decide severity. - Where it lives in this repo: root
package.jsonpins"zod": "^4.6.7"(lines 58, 774; safe, already past the patched version). The nested workspace packagesolana-agent-sdk/package.jsondeclares"zod": "^3.0.0"twice, once as an optionalpeerDependency(lines 64-70) and once as adevDependency(line 79, used to run its own Jest suite).node -e "console.log(require('./package-lock.json').packages['solana-agent-sdk/node_modules/zod'].version)"resolves this to3.25.76, inside the vulnerable range, in a nestednode_modules/zodthat root's safe^4.6.7pin does not and cannot override (it's a separate resolution tree). - How it got there: the single most recent commit on
mainat measurement time,1ad300d5b("fix(deps): add the zod 3.25.76 lock entry that npm 11.9.0 in Cloud Build requires"), added this exact lockfile entry for an unrelated reason: Cloud Build'snpm ciunder npm 11.9.0 rejected the lockfile with "Missing: [email protected] from lock file" while npm 11.19.1 accepted it; the lockfile was regenerated under 11.9.0 to match. That commit did not introduce the vulnerable version choice (^3.0.0insolana-agent-sdk/package.jsonalready existed), it just made the lockfile internally consistent again under the older npm Cloud Build runs. Fixing this order's root cause (bumping the^3.0.0ranges) removes the need for that specific pin entirely, but you must re-verify the exact Cloud Build constraint that motivated1ad300d5bstill holds after your change (see Task 3). - Reachability from live production:
grep -rl "solana-agent-sdk\|@three-ws/solana-agent" api/ --include="*.js"finds real, deployed route handlers importing the SDK:api/agenc/[action].js,api/agora/act.js,api/agora/[action].js,api/_lib/agora-human.js,api/x402/vanity-verifiable.js,api/_lib/service-catalog/services/vanity-verifiable.js. These are live, request-handling endpoints, not build tooling. - Narrower schema-usage check, already run:
grep -n "z\.\w\+(" solana-agent-sdk/src/solana-agent-kit/actions.tsshows onlyz.object,z.string,z.number(with.describe(),.max(),.min(),.int(),.positive(),.optional()modifiers); noz.array,z.record,z.map, orz.setanywhere insolana-agent-sdk/src/.types.ts's only zod import isimport type { z }, a type-only reference with no runtime parsing. This means the specific "oversized array with no length cap" exploit path described in the advisory is not reachable through solana-agent-sdk's own schema definitions as they stand today, pending Task 1's deeper check of whether v3's own array parser has an equivalent flaw. - Why the fix is cheap regardless of the reachability answer: every zod builder actually used (
z.object,z.string,z.number,.max,.min,.int,.positive,.optional,.describe) is stable, unchanged API across the v3 to v4 major bump. There is no need to choose between "migrate" and "document as accepted risk": bumpingsolana-agent-sdk's zod ranges to match root's already-safe^4.6.7is the correct fix either way, and is a small, low-risk change given this usage surface.
Tasks
- Confirm or rule out v3's own exposure, for the record. Read the installed
solana-agent-sdk/node_modules/zod/dist/**(ornode_modules/zodat whichever path npm resolved 3.25.76 to) array-parsing source and check whether it also accumulates unbounded validation issues with no cap on a failing array of arbitrary size (the v3 equivalent of$ZodArray/handleArrayResult, likely in a file implementingZodArray's_parse). State the finding in one or two lines in the report: whether v3.25.76 has the same unbounded-allocation pattern or not. This does not change the fix (Task 2 proceeds regardless) but it is the honest answer to "does the GHSA's< 4.6.6range actually describe v3's code, or just an npm semver mechanical cutoff." - Bump the vulnerable ranges. In
solana-agent-sdk/package.json, change both"zod": "^3.0.0"occurrences (thepeerDependenciesentry around line 64 and thedevDependenciesentry around line 79) to"zod": "^4.6.7"(matching the root pin exactly, so there is one resolved version across the whole repo instead of two). LeavepeerDependenciesMeta.zod.optional: trueas is. - Regenerate lockfiles and re-verify the Cloud Build constraint that caused
1ad300d5b. Runnpm installat the repo root (this updates the rootpackage-lock.json'ssolana-agent-sdk/node_modules/zodentry, which should now resolve to4.6.7or later, ideally collapsing into the already-hoisted root zod so no nested copy is needed at all; confirm with the samenode -eresolution check used above). Also runnpm installinsidesolana-agent-sdk/if it has its ownpackage-lock.json(confirmed present atsolana-agent-sdk/package-lock.json). Then specifically re-check the Cloud Build failure mode: confirmnpm cisucceeds at the root under the npm version actually available in this environment, and grep the updated root lockfile for any remaining[email protected]or other pre-4.6.6 zod entries anywhere in the tree (node -ewalk overpackage-lock.json'spackagesobject checking every key containingnode_modules/zod) to confirm zero vulnerable resolutions remain repo-wide. - Fix any v3-to-v4 breakage. Run
solana-agent-sdk's own test suite (cd solana-agent-sdk && npm test, which runs its Jest suite coveringtests/agent.test.ts,tests/actions/*.test.ts,tests/wallet/*.test.ts) and its typecheck (npm run typecheckinsidesolana-agent-sdk/). Zod v4 is expected to be a no-op for the builders this SDK uses, but if typecheck or tests surface a real v3-to-v4 signature change (for example in error shape,.parsebehavior, or type inference), fix the call site insolana-agent-sdk/src/solana-agent-kit/actions.tsortypes.tsto match v4's API rather than downgrading the pin back. - Verify nothing else broke at the root. Run
npm run test:core(or at minimum the test files covering the reachable call sites: greptests/foragenc,agora,vanity-verifiablecoverage) andnpm audit --jsonagain to confirmGHSA-mrhx-c7xc-m3w5no longer appears for anyzodresolution in the tree.
Definition of done
-
solana-agent-sdk/package.json's twozodranges both read^4.6.7(or newer, if you deliberately chose a higher compatible version and said why). -
node -ewalk of the regenerated rootpackage-lock.jsonfinds zeronode_modules/zodentries below4.6.6anywhere in the tree (root or nested). -
npm audit --jsonat the root no longer listsGHSA-mrhx-c7xc-m3w5forzod. -
solana-agent-sdk's ownnpm testandnpm run typecheckboth pass against the new zod version. -
npm run test:corepasses (or the specific test files you verified, named explicitly in the report, with a one-line reason if the full suite was impractical to run given prompts/finish/401's known pre-existing failures, which are out of scope here). - The Cloud Build
npm ciconstraint from commit1ad300d5bis re-verified, not silently reintroduced: state explicitly in the report whether the updated lockfile resolves cleanly under the npm version that previously failed, or why that check could not be reproduced in this environment. -
npm run check:rules -- --paths <files you touched>exits 0. - Commit uses explicit paths (
solana-agent-sdk/package.json,package-lock.json,solana-agent-sdk/package-lock.json, and anysolana-agent-sdk/src/**file touched for v3-to-v4 fixes), one topical commit, subject naming the CVE and the package.
Never blocked
| Blocker | Resolution (act, do not ask) |
|---|---|
| v3.25.76's own array parser is confirmed to NOT have the unbounded-accumulation bug (Task 1 finds it genuinely unreachable) | Still complete the bump (Task 2 onward): a cheap, available fix that removes the advisory entirely is strictly better than documenting an accepted risk, even if the risk turns out to be theoretical for this repo's usage. Do not stop at "documented as unreachable." |
Zod v4 breaks something non-trivial in solana-agent-sdk's own Jest suite or typecheck |
Fix the call site to match v4's API (the usage surface here is narrow: z.object/z.string/z.number with simple modifiers). If a genuinely deep breaking change blocks the bump entirely, pin to the lowest 4.x version that both passes tests and clears 4.6.6, and say so with the specific error in the report; do not silently fall back to ^3.0.0. |
The regenerated lockfile reintroduces the exact npm ci/npm-11.9.0 "Missing: zod@X from lock file" failure that 1ad300d5b fixed |
Regenerate with whichever npm major version is available in this environment, note the version used, and state plainly in the report that Cloud Build's specific npm 11.9.0 behavior could not be directly reproduced locally if that's the case, rather than guessing it's fine. |
npm install at the root churns unrelated transitive versions across the whole lockfile |
Expected lockfile churn from a real version bump; commit the full lockfile diff, don't hand-edit it, confirm npm run test:core still passes despite the churn. |
solana-agent-sdk/package-lock.json (the nested workspace's own lockfile) drifts from the root's resolution after the bump |
Regenerate it too (cd solana-agent-sdk && npm install) so both lockfiles agree on a single post-4.6.6 zod version; commit both. |
Report format
Report, in this order: Task 1's v3-source finding (does 3.25.76 actually have the unbounded-issue-accumulation pattern or not, one or two lines); the version bump and lockfile re-verification result including the Cloud Build npm-version check; solana-agent-sdk test/typecheck results; root test:core and npm audit results; any v3-to-v4 call-site fix made; one-line judgment calls. No trailing questions.