Bump zod to 4.4.3 for prototype pollution hardening (v3.31.1) - #136
Bump zod to 4.4.3 for prototype pollution hardening (v3.31.1)#136cb-alish wants to merge 1 commit into
Conversation
zod 4.4.3 skips __proto__ keys on object catchall paths (colinhacks/zod#5898). Every generated request schema in src/schema is built on z.looseObject, which is the affected catchall variant, so pick the patch up as a precaution. The caret range already resolved to 4.4.3 on a fresh install; this also moves the committed lockfile off 4.3.6 so CI and contributors get the patched version. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe release updates the SDK version to 3.31.1, upgrades ChangesRelease version and dependency update
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This change updates the locked zod version and release metadata without altering SDK request behavior; no actionable merge-blocking risk remains after normal checks. Suggested reviewers: 🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
Comment |
Summary
Patch release that moves the
zodruntime dependency from4.3.6to4.4.3, which skips__proto__keys on object catchall paths.Every generated request schema in
src/schemais built onz.looseObject, the catchall variant the fix touches, so we pick the patch up as a precaution.Scope of the actual exposure
Worth being precise here, since the advisory sounds worse than what applies to this SDK:
enableValidationand is off by default, so zod never parses params unless an integrator turns it on.RequestWrapper._validateParamsonly readsresult.successand discardsresult.data. The originalparamsobject is what gets serialized and sent, so a poisoned parse output never reaches the request.Prior releases therefore had no known exploitable path. This is dependency hygiene and defense in depth, not a fix for a live hole.
Because the range was already a caret, fresh installs were resolving to
4.4.3anyway. The meaningful part of this change is moving the committed lockfile off4.3.6so CI and contributors get the patched version.Changes
package.json/package-lock.json: zod^4.3.6->^4.4.3VERSION,package.json,package-lock.json,src/environment.ts: 3.31.0 -> 3.31.1 (viamake increment-patch)CHANGELOG.md: v3.31.1 entry under aSecurity:headingTest plan
npm run buildsucceedsnpm test— 135 passing{"id":"cus_1","__proto__":{...}}through az.looseObjectschema drops the key, leaves the output prototype asObject.prototype, and does not pollute{}enableValidation: true:customer.list({ limit: 2 })returned HTTP 200 with live recordslimit: 500correctly rejected pre-flight withChargebeeZodValidationError(limit Too big: expected number to be <=100)__proto__key completed a full request cycle with({}).pollutedstillundefinedNotes for the reviewer
clientVersionbump, so no behavioral change to the SDK itself.v3*tag, not by merging this PR — av3.31.1tag still needs to be pushed after merge.master; those I looked at are all transitive devDependencies undermocha(brace-expansion,js-yaml,minimatch,picomatch,serialize-javascript). Since zod is the only runtime dependency, they do not reach consumers of the published package. Clearing them requires a breakingmochabump, so I left it out to keep this release focused.Made with Cursor
Updates
zodto4.4.3for__proto__hardening and refreshes the lockfile. Bumps the SDK to3.31.1, updatesEnvironment.clientVersion, and adds a security changelog entry. Validation reports 135 passing tests.