{"answers":{"affected":"2 open source packages ship an affected version, including express-zod-api.","exploited":"There is no known exploitation of GHSA-mvrp-3cvx-c325 in the wild and no public exploit code.","fix":"Upgrade express-zod-api to 10.0.0-beta1 or later.","what":"GHSA-mvrp-3cvx-c325 is a denial of service vulnerability in express-zod-api, published on 4 Oct 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-mvrp-3cvx-c325 and fix it if it is affected.\n\nWhat it is: GHSA-mvrp-3cvx-c325 is a denial of service vulnerability in express-zod-api, published on 4 Oct 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-mvrp-3cvx-c325 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- express-zod-api (npm): affected all versions; fixed in 10.0.0-beta1\n- express-zod-api (npm): affected all versions; fixed in 10.0.0-beta1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-mvrp-3cvx-c325/ (Markdown: https://insights.sbomify.com/GHSA-mvrp-3cvx-c325/index.md)","id":"GHSA-mvrp-3cvx-c325","markdown":"https://insights.sbomify.com/GHSA-mvrp-3cvx-c325/index.md","name":"GHSA-mvrp-3cvx-c325","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":true,"product_category":"Node.js validation library","requires_auth":"none","summary":"Attackers can cause denial of service in API servers using Zod email validation via inefficient regex complexity.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\n\nAPI servers running `express-zod-api` having:\n\n- version of `express-zod-api` below `10.0.0-beta1`,\n- and using the following (or similar) validation schema in its implementation: `z.string().email()`,\n\nare vulnerable to a DoS attack due to: \n\n- Inefficient Regular Expression Complexity in `zod` versions up to `3.22.2`,\n- depending on `zod`.\n\n### Patches\n\nThe patched version of `zod` fixing the vulnerability is `3.22.3`.\n\nHowever, it's highly recommended to upgrade `express-zod-api` to at least version `10.0.0`, which does not depend on `zod` strictly and directly, but requires its installation as a peer dependency instead, enabling you to install the patched `zod` version yourself.\n\n### Workarounds\n\nWhen it's not possible to upgrade your dependencies, consider the following replacement in your implementation:\n\n```diff\n- z.string().email()\n+ z.string().regex(\n+   /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_+-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i\n+ )\n```\n\nThis regular expression is taken from the suggested patch of `zod`.\n\n### References\n\n- Original issue: https://github.com/colinhacks/zod/issues/2609\n- The patch: https://github.com/colinhacks/zod/pull/2824\n- Entry in database: https://nvd.nist.gov/vuln/detail/CVE-2023-4316\n- Enumeration: https://cwe.mitre.org/data/definitions/1333.html\n- Parent advisory: https://github.com/advisories/GHSA-m95q-7qp3-xv42\n- Changelog entry for `express-zod-api` version `10.0.0-beta1`: https://github.com/RobinTail/express-zod-api/blob/master/CHANGELOG.md#v1000-beta1","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Zod denial of service vulnerability during email validation","id":"GHSA-mvrp-3cvx-c325","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"denial_of_service","year":"2023"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["10.0.0-beta1"],"introduced":["0"],"last_affected":[],"package":"express-zod-api","purl":null,"source":"GHSA-mvrp-3cvx-c325"},{"ecosystem":"npm","fixed":["10.0.0-beta1"],"introduced":["0"],"last_affected":[],"package":"express-zod-api","purl":"pkg:npm/express-zod-api","source":"GHSA-mvrp-3cvx-c325"}],"products":null,"published":"2023-10-04","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can cause denial of service in API servers using Zod email validation via inefficient regex complexity.","url":"https://insights.sbomify.com/GHSA-mvrp-3cvx-c325/"}