zod is vulnerable to Regular Expression Denial of Service (ReDoS)
25
Low Risk
The emoji format validator (z.emoji() and z.string().emoji()) used ^(\p{Extended_Pictographic}|\p{Emoji_Component})+$. Those Unicode properties overlap on four hair-component code points (U+1F9B0–U+1F9B3), so a failed match re-explores exponentially many ways of attributing already-consumed characters. A roughly 100-byte string of those code points plus a trailing non-emoji character can stall the event loop for seconds, and RegExp.test() cannot be interrupted by a request timeout. The same pattern ships in zod, zod/mini, zod/v4-mini, and the bundled Zod 3 API. The fix collapses the alternation into a single character class so matching is linear.
You are affected if you are using a version that falls within the vulnerable range and your application validates untrusted input with z.emoji() or z.string().emoji().
zod is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 3.21.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.