zod is vulnerable to Prototype Pollution
38
CVSS Score
Low
Prototype Pollution
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.
Upgrade the zod library to the patch version.
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.
4.0.0 - 4.4.3
Fixed in 4.5.0zod is vulnerable to Prototype Pollution in versions 4.0.0 - 4.4.3.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
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.