zod is vulnerable to Prototype Pollution
38
Low Risk
Object and record parsers did not consistently strip a __proto__ key. The key could still be copied from untrusted input, declared on the schema, or produced when a record key schema or transform normalized a value to __proto__, which can replace the parsed object's prototype via ordinary property assignment. .strict() also swallowed an own __proto__ input key instead of reporting unrecognized_keys. Error formatters and both JSON Schema converters wrote nested path segments such as toString or constructor without own-property semantics, so those segments could walk onto Object.prototype. Parsers now drop __proto__ in all of those cases, .strict() reports the key, and formatters and converters use own-property writes.
You are affected if you are using a version that falls within the vulnerable range and you parse untrusted objects or records, use .strict(), format Zod errors, or convert schemas to JSON Schema.
zod is vulnerable to Prototype Pollution in versions 4.0.0 - 4.4.3.
Upgrade the zod library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.