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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
chore(prompts): file order 444, fast-xml-parser's zod-advisory-shaped override gap under @bnb-chain/greenfield-js-sdk
nirholas9113c031b516
diff --git a/prompts/finish/444-auto-dependency-cve-fast-xml-parser-greenfield.md b/prompts/finish/444-auto-dependency-cve-fast-xml-parser-greenfield.mdnew file mode 100644index 000000000..6a56c34b5--- /dev/null+++ b/prompts/finish/444-auto-dependency-cve-fast-xml-parser-greenfield.md@@ -0,0 +1,76 @@+# 444. The zod-advisory fix pattern (prompt 429) repeats on fast-xml-parser: a scoped override misses a nested copy under @bnb-chain/greenfield-js-sdk++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.+- This is a bug fix: follow the test-first rule (CLAUDE.md, "Bug fixes are test-first"). Write the failing test first, confirm it fails for the stated reason, then fix the code, then confirm it passes. Commit the test with the fix.+- The only permitted stops are the CLAUDE.md stop-and-ask gates (spend/on-chain writes, push/deploy, posting externally, committing content referencing a crypto project other than `$THREE`, destroying unrecoverable data). This order touches none of them.+- Concurrent agents share this worktree: stage explicit paths only (never `git add -A` or `git add .`), re-check `git status` and `git diff --staged` before committing.+- The em-dash and en-dash characters are banned in everything you write.++## Why this matters (measured 2026-10-25)++Commit `de2e362ec` (landed earlier today, 2026-10-25) fixed prompt 429's zod advisory and added `tests/dependency-pin-advisories.test.js` specifically because the previous fix used a *key-scoped* `package.json` override (`"zod@^4": "^4.6.7"`) that silently failed to touch the root's own unscoped `zod@^3.23.8` dependency, leaving the vulnerable version resolved anyway. That commit's own message calls this out as a repeatable failure class: "close the zod memory-exhaustion advisory the scoped override missed."++The identical failure class exists right now for a different package. `package.json:54` already carries `"fast-xml-parser@^4": "^5.11.2"`, and the root `node_modules/fast-xml-parser` does resolve to the patched `5.11.2`. But `npm audit --omit=dev --json` (run just now) still reports:++ fast-xml-parser moderate range: <5.7.0 fixAvailable: {name: '@bnb-chain/greenfield-js-sdk', version: '0.2.3', isSemVerMajor: true}+ via: "fast-xml-parser XMLBuilder: XML Comment and CDATA Injection via Unescaped Delimiters"+ https://github.com/advisories/GHSA-gh4j-gqv2-49f6++Direct filesystem check confirms why: `@bnb-chain/greenfield-js-sdk` ships its own nested copy that the top-level override never reaches:++ node_modules/@bnb-chain/greenfield-js-sdk/node_modules/fast-xml-parser/package.json -> version 4.5.7 (vulnerable, matches GHSA-gh4j-gqv2-49f6's "<5.7.0" range)+ node_modules/fast-xml-parser/package.json -> version 5.11.2 (patched, root copy, override works here)++This is reachable from production, not dead weight: `@bnb-chain/greenfield-js-sdk` is imported at runtime by `api/_lib/bnb/greenfield-write.js:56` (`const { Client, Long, VisibilityType, RedundancyType, bytesFromBase64 } = require('@bnb-chain/greenfield-js-sdk');`), which is the vault-upload write path documented in that same file's header comment. `fast-xml-parser`'s `XMLBuilder` is used internally by Greenfield's Tendermint/Cosmos SDK transaction-signing stack to serialize XML for Cosmos's Amino/REST paths; an unescaped comment/CDATA injection there is a real (if narrow) risk to any XML this SDK builds from account- or request-derived strings during a vault write.++No open order in `prompts/finish/` currently mentions `fast-xml-parser`, `greenfield-js-sdk`, or `GHSA-gh4j-gqv2-49f6` (confirmed via `grep -ril` across the directory immediately before filing this order), and `tests/dependency-pin-advisories.test.js` (added this morning for the zod/toml case) does not yet assert anything about this package, so this exact regression class is currently unguarded.++Two other HIGH-severity findings from the same `npm audit` run were investigated and are explicitly **out of scope** for this order because no upstream fix exists to apply (confirmed via the advisory's own `range` field, not assumed):++- `node-forge` (GHSA-86w9-cpqp-85rv, RSA PKCS#1 v1.5 signature bypass): advisory range is `<=1.4.0`, and `1.4.0` is both the currently-installed version (`node_modules/node-forge`) and the latest version npm has ever published. There is no patched release to pin to. `npm audit`'s own `fixAvailable` suggestion (bump `agent0-sdk` to `1.5.3`) is stale: `agent0-sdk` is already installed at `1.7.1` (newer than 1.5.3) and still resolves the same vulnerable `node-forge`, because the fix doesn't exist upstream at any version of either package.+- `bigint-buffer` (GHSA-3gc7-fjrx-p6mg, buffer overflow in `toBigIntLE()`): advisory range is `*` (every published version, including the installed and latest `1.1.5`, is vulnerable). No patched release exists. It is reached only via `@solana/spl-token` -> `@solana/buffer-layout-utils` -> `bigint-buffer`, decoding fixed-width (8-byte) u64 fields from already-length-validated SPL token account layouts fetched over RPC; there is no code path in this repo that calls `toBigIntLE` with an attacker-controlled length argument.+- `lodash.set` (GHSA-p6mc-m468-83gw, prototype pollution): the registry has never published a version past `4.3.2` (the one installed), so there is no patch to pin to either; `npm audit`'s suggested fix is a semver-major bump of `@bnb-chain/greenfield-js-sdk` to `0.2.3`, which is a much larger, riskier change (that SDK is at `2.2.2` here; `0.2.3` is not even forward of the installed major) than this order's scope should carry.++Filing a fix for these three as "done" would be dishonest; they are upstream-blocked, not actionable by this repo today, and are recorded here (with dates and advisory IDs) so a future audit doesn't re-spend time rediscovering the same dead end.++## Task++1. Reproduce before touching anything: `npm audit --omit=dev --json > /tmp/audit-444-before.json`, then confirm the `fast-xml-parser` entry shows `range: "<5.7.0"` with the nested `@bnb-chain/greenfield-js-sdk` node listed, and confirm the nested copy's version directly: `node -p "require('./node_modules/@bnb-chain/greenfield-js-sdk/node_modules/fast-xml-parser/package.json').version"` should print `4.5.7` (or another version `< 5.7.0`).+2. Write the failing test first. Extend `tests/dependency-pin-advisories.test.js` (it already reads `package-lock.json` directly and has a `gte()` semver-tuple comparator you can reuse) with a new case in a `describe('dependency-pin advisories (prompt 444)', ...)` block: assert that every `fast-xml-parser` entry in `package-lock.json`'s `packages` map (there may be more than one path key, e.g. both `node_modules/fast-xml-parser` and `node_modules/@bnb-chain/greenfield-js-sdk/node_modules/fast-xml-parser`) resolves to a version `>= 5.7.0`. Loop over `Object.keys(lock.packages)` filtering on `path.endsWith('/fast-xml-parser') || path === 'node_modules/fast-xml-parser'` rather than hardcoding one path, so the test also catches any other nested copy you haven't manually found. Run it now with `npx vitest run tests/dependency-pin-advisories.test.js` and confirm the new case fails (it should report the nested `4.5.7` entry as the failure).+3. Fix `package.json`: broaden the fast-xml-parser override so it reaches nested copies regardless of the requesting package's own version range, following the exact pattern `de2e362ec` used for zod (it removed the `@^4` key-scoping entirely rather than adding more scoped keys). Change `package.json:54` from `"fast-xml-parser@^4": "^5.11.2"` to an unscoped `"fast-xml-parser": "^5.11.2"`. Before doing so, check whether anything in the tree legitimately needs a `[email protected]` or other pre-4 major that `^5.11.2` would break: `npm ls fast-xml-parser 2>&1`. If every consumer in that output is already on a `4.x` or `5.x` requirement, the unscoped override is safe; if something requires `fast-xml-parser@^1` or `@^2` (unlikely, but verify rather than assume), keep the key-scoped form and instead add a second override entry scoped to the specific nested path's requester, e.g. `"@bnb-chain/greenfield-js-sdk": { "fast-xml-parser": "^5.11.2" }`, nested the same way the existing `@ethersproject/providers`/`hardhat`/`miniflare` entries in `package.json`'s `overrides` block already do.+4. Run `npm install` to reconcile `package-lock.json` against the new override. Read the diff of `package-lock.json`'s `fast-xml-parser` entries specifically (`git diff package-lock.json | grep -A3 -B3 fast-xml-parser`) and confirm every resolved copy, including the nested one under `@bnb-chain/greenfield-js-sdk`, now reads `>= 5.7.0`. Re-run `node -p "require('./node_modules/@bnb-chain/greenfield-js-sdk/node_modules/fast-xml-parser/package.json').version"` (or confirm the nested directory no longer exists because npm deduped it against the root copy, either outcome is acceptable) to verify at the filesystem level, not just the lockfile level.+5. Re-run the test from task 2: it must now pass. Run the full file: `npx vitest run tests/dependency-pin-advisories.test.js`.+6. Run `npm audit --omit=dev --json > /tmp/audit-444-after.json` and confirm the `fast-xml-parser` key is absent from `vulnerabilities` (grep for it: `python3 -c "import json; d=json.load(open('/tmp/audit-444-after.json')); print('fast-xml-parser' in d['vulnerabilities'])"` should print `False`). Diff the total vulnerability count against the "before" run to confirm only this one dropped and nothing regressed (`python3 -c "import json; print(json.load(open('/tmp/audit-444-before.json'))['metadata']['vulnerabilities']); print(json.load(open('/tmp/audit-444-after.json'))['metadata']['vulnerabilities'])"`).+7. Run `npm run test:core` and confirm no new failures relative to whatever baseline the suite currently reports (this is a dependency-resolution change touching a package only used by the BNB Greenfield vault-write path; it should not affect unrelated tests, but confirm rather than assume, same bar `de2e362ec` held itself to).+8. Run `npm run check:rules -- --paths package.json package-lock.json tests/dependency-pin-advisories.test.js` and fix anything it flags.+9. Add a `data/changelog.json` entry (tag `fix`) describing the fast-xml-parser advisory close for the Greenfield vault-write dependency, naming the advisory ID `GHSA-gh4j-gqv2-49f6`, then run `npm run build:pages` and confirm only the expected generated files change.+10. In your final report, record the three upstream-blocked findings (`node-forge` GHSA-86w9-cpqp-85rv, `bigint-buffer` GHSA-3gc7-fjrx-p6mg, `lodash.set` GHSA-p6mc-m468-83gw) with the exact advisory IDs and the one-line reason each has no available fix today, so a future audit can skip re-deriving this and only needs to re-check whether upstream has shipped a patch since.+11. Read the full diff before finishing and confirm every changed line is accounted for by the tasks above.++## Done when++- `package.json`'s fast-xml-parser override reaches every copy in the tree (verified by task 4, not assumed).+- The new `tests/dependency-pin-advisories.test.js` case (prompt 444 block) loops over all matching lockfile paths, was confirmed failing before the fix, and passes after.+- `npm audit --omit=dev --json` no longer lists `fast-xml-parser` in `vulnerabilities`, and the before/after total vulnerability count dropped by exactly the fast-xml-parser entries removed (no unrelated regression).+- `npm run test:core` shows no new failures versus the pre-change baseline.+- `npm run check:rules` reports no violations on the changed files.+- A changelog entry exists and `npm run build:pages` ran cleanly.+- The report names the three upstream-blocked advisories (node-forge, bigint-buffer, lodash.set) with their GHSA IDs and why they are out of scope, so they are not silently dropped or re-investigated from zero next time.++## Never blocked++| Apparent blocker | Resolution |+| --- | --- |+| "Should I also try to fix node-forge / bigint-buffer / lodash.set in this order?" | No. Each has an advisory `range` covering every published version (confirmed in "Why this matters" above); there is no patch to pin to. Forcing a semver-major bump of `agent0-sdk`, `@solana/spl-token`, or `@bnb-chain/greenfield-js-sdk` on the unverified hope that it removes the dependency entirely is out of scope and risks breaking the Solana trading SDKs and the Greenfield vault path for no confirmed gain. Record them (task 10) and stop there. |+| "The unscoped override might break something that needs an older fast-xml-parser major." | Task 3 tells you to check `npm ls fast-xml-parser` first and fall back to a nested-path-scoped override instead of the unscoped one if anything needs `<4.x`. Either path is acceptable; verify, don't guess. |+| "`npm install` might touch unrelated lockfile entries." | Expected to be minimal here (one package, already deduped at the root for every other consumer). If something unrelated shifts, read the diff and understand why before proceeding, same as any other dependency change; do not blindly accept it. |+| "Is a package.json/package-lock.json edit an owner-gated action?" | No. CLAUDE.md's gates are on-chain/spend actions, push/deploy, non-$THREE crypto content, and destroying unrecoverable data. A local dependency override, committed to the `evolve` branch like any other code change, is none of those. |++## Report format++State: the exact override line changed in `package.json`, the nested copy's version before and after (filesystem-verified, not just lockfile), the new test case and its fail-then-pass confirmation, the `npm audit` vulnerability counts before and after, the `test:core` pass counts before and after, the `check:rules` result, and the commit hash. List the three upstream-blocked advisories left out of scope with their GHSA IDs and one-line reasons.