{"id":"GHSA-4528-x5fx-h6hg","revision":null,"records":[{"revision":"ceb519bf3ca54b59b34eb954403fe77e","observedAt":"2026-11-04T02:57:16.741+00:00","statement":{"source":"cve-program","id":"CVE-2026-118772","aliases":[],"title":"joi: quadratic-time split in `string().email({ multiple: true })` allows denial of service","description":"joi is a schema description language and data validator for JavaScript. From 17.1.1 until 17.13.9 and 18.3.1, the Joi.string().email({ multiple: true }) rule uses a separator regular expression whose leading whitespace quantifier is retried at every position in a long whitespace run that contains no separator, causing quadratic work during String.prototype.split. The behavior applies to the default separator and every custom separator. Applications that validate attacker-controlled values with the multiple option and no effective prior length limit can have the Node.js event loop blocked for seconds by one request, preventing other work. A .max() rule is not sufficient when abortEarly: false allows the email rule to run after the maximum-length check fails. This vulnerability is fixed in versions 17.13.9 and 18.3.1.","state":0,"publishedAt":"2026-10-29T18:13:33.771+00:00","modifiedAt":"2026-11-04T01:33:51.841+00:00","affected":[{"ecosystem":"Vendor product","name":"joi","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"hapijs\",\n                    \"product\": \"joi\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 16.0.0, <= 17.1.1\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \">= 18.0.0, < 18.3.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"joi","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"@hapi\",\n                    \"product\": \"joi\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 16.0.0, <= 17.1.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/hapijs/joi/security/advisories/GHSA-4528-x5fx-h6hg","https://github.com/hapijs/joi/pull/3162","https://github.com/hapijs/joi/pull/3163","https://github.com/hapijs/joi/commit/03dc1d909818503b06240dadc81e9227ed2649cf","https://github.com/hapijs/joi/commit/807858d7480f5075b0610817e3e44230890fb18e","https://github.com/hapijs/joi/releases/tag/v17.13.9","https://github.com/hapijs/joi/releases/tag/v18.3.1"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-118772","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-118772","identifiers":["CVE-2026-118772"]},"retained":false,"historicalAffected":[]},{"revision":"b035a1e8a0b54a2697ccbb33b30b8ab1","observedAt":"2026-11-16T04:36:42.292+00:00","statement":{"source":"euvd","id":"EUVD-2026-113320","aliases":["CVE-2026-118772","GHSA-4528-x5fx-h6hg"],"title":"joi is a schema description language and data validator for JavaScript. From 17.1.1 until 17.13.9 and 18.3.1, the Joi.string().email({ multiple: true }) rule uses a separator regular expression whose leading whitespace quantifier is retried…","description":"joi is a schema description language and data validator for JavaScript. From 17.1.1 until 17.13.9 and 18.3.1, the Joi.string().email({ multiple: true }) rule uses a separator regular expression whose leading whitespace quantifier is retried at every position in a long whitespace run that contains no separator, causing quadratic work during String.prototype.split. The behavior applies to the default separator and every custom separator. Applications that validate attacker-controlled values with the multiple option and no effective prior length limit can have the Node.js event loop blocked for seconds by one request, preventing other work. A .max() rule is not sufficient when abortEarly: false allows the email rule to run after the maximum-length check fails. This vulnerability is fixed in versions 17.13.9 and 18.3.1.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":null}],"references":["https://github.com/hapijs/joi/security/advisories/GHSA-4528-x5fx-h6hg","https://github.com/hapijs/joi/pull/3162","https://github.com/hapijs/joi/pull/3163","https://github.com/hapijs/joi/commit/03dc1d909818503b06240dadc81e9227ed2649cf","https://github.com/hapijs/joi/commit/807858d7480f5075b0610817e3e44230890fb18e","https://github.com/hapijs/joi/releases/tag/v17.13.9","https://github.com/hapijs/joi/releases/tag/v18.3.1"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-113320","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 29, 2026, 6:13:33 PM","dateUpdated":"Nov 4, 2026, 1:33:51 AM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-113320","identifiers":["EUVD-2026-113320","CVE-2026-118772","GHSA-4528-x5fx-h6hg"]},"retained":false,"historicalAffected":[]},{"revision":"7d0eef32895e4f32bf60fcb0a5928090","observedAt":"2026-11-06T01:43:49.822+00:00","statement":{"source":"nvd","id":"CVE-2026-118772","aliases":[],"title":"joi is a schema description language and data validator for JavaScript. From 17.1.1 until 17.13.9 and 18.3.1, the Joi.string().email({ multiple: true }) rule uses a separator regular expression whose leading whitespace quantifier is retried…","description":"joi is a schema description language and data validator for JavaScript. From 17.1.1 until 17.13.9 and 18.3.1, the Joi.string().email({ multiple: true }) rule uses a separator regular expression whose leading whitespace quantifier is retried at every position in a long whitespace run that contains no separator, causing quadratic work during String.prototype.split. The behavior applies to the default separator and every custom separator. Applications that validate attacker-controlled values with the multiple option and no effective prior length limit can have the Node.js event loop blocked for seconds by one request, preventing other work. A .max() rule is not sufficient when abortEarly: false allows the email rule to run after the maximum-length check fails. This vulnerability is fixed in versions 17.13.9 and 18.3.1.","state":0,"publishedAt":"2026-10-29T19:17:19.563+00:00","modifiedAt":"2026-11-04T02:17:15.813+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/hapijs/joi/commit/03dc1d909818503b06240dadc81e9227ed2649cf","https://github.com/hapijs/joi/commit/807858d7480f5075b0610817e3e44230890fb18e","https://github.com/hapijs/joi/pull/3162","https://github.com/hapijs/joi/pull/3163","https://github.com/hapijs/joi/releases/tag/v17.13.9","https://github.com/hapijs/joi/releases/tag/v18.3.1","https://github.com/hapijs/joi/security/advisories/GHSA-4528-x5fx-h6hg"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-118772","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Awaiting Analysis","weaknesses":["CWE-1333"],"productCriteria":[],"sourceDates":{"published":"2026-10-29T19:17:19.563","lastModified":"2026-11-04T02:17:15.813"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-118772","identifiers":["CVE-2026-118772"]},"retained":false,"historicalAffected":[]},{"revision":"657bb5db26774536b48584dcf2bddf90","observedAt":"2026-10-30T23:45:44.41+00:00","statement":{"source":"osv","id":"GHSA-4528-x5fx-h6hg","aliases":["CVE-2026-118772"],"title":"joi: quadratic-time split in `string().email({ multiple: true })` allows denial of service","description":"### Summary\n\n`Joi.string().email({ multiple: true })` takes quadratic time to split a value that contains a long run of whitespace. One request with 100 KB of spaces blocks the Node.js event loop for several seconds, which causes a denial of service.\n\n### Details\n\nWhen the `multiple` option is set, the `email` rule splits the value into addresses with a regular expression that removes whitespace on each side of the separator:\n\n```js\nconst regex = new RegExp(`\\\\s*[${options.separator ? escapeRegex(options.separator) : ','}]\\\\s*`);\n// ...\nconst emails = options.multiple ? value.split(regex) : [value];\n```\n\n`String.prototype.split` tries a match at each position of the value. At each position inside a whitespace run, the leading `\\s*` reads the rest of the run, does not find a separator, and backtracks through all of it. A run of `n` whitespace characters without a separator therefore costs `n²` steps. This applies to the default separator and to all custom `separator` values.\n\nThe fix lets the leading whitespace match start only at the beginning of a whitespace run, so the split is linear:\n\n```js\nconst regex = new RegExp(`(?:(?<!\\\\s)\\\\s+)?[${options.separator ? escapeRegex(options.separator) : ','}]\\\\s*`);\n```\n\nThe split results do not change. The regular expression is now built only when `multiple` is set.\n\nEvery `joi` release from `17.1.1` up to and including `17.13.8`, and from `18.0.0` up to and including `18.3.0`, is affected. Every `@hapi/joi` release from `16.0.0` is affected.\n\nWorkarounds for users who cannot upgrade:\n\n- Add `.max()` before `.email()`, for example `Joi.string().max(1000).email({ multiple: true })`. The `max` rule then rejects long values before the `email` rule runs.\n- Do not use the `abortEarly: false` option with this schema. With `abortEarly: false`, the `email` rule runs even when the `max` rule fails.\n- Do not use `.trim()` as a workaround. It removes only the whitespace at the start and at the end of the value.\n\n### Proof of concept\n\n```js\nconst Joi = require('joi');\n\nconst schema = Joi.string().email({ multiple: true });\nfor (const n of [25000, 50000, 100000, 200000]) {\n    const start = Date.now();\n    schema.validate(' '.repeat(n));\n    console.log(`${n} spaces: ${Date.now() - start} ms`);\n}\n```\n\nOutput on `joi@18.3.0` (Node.js 26):\n\n```text\n25000 spaces: 244 ms\n50000 spaces: 887 ms\n100000 spaces: 3349 ms\n200000 spaces: 13579 ms\n```\n\nOutput on the patched version:\n\n```text\n25000 spaces: 0 ms\n50000 spaces: 0 ms\n100000 spaces: 0 ms\n200000 spaces: 1 ms\n```\n\nOver HTTP, send the whitespace in a field that the route validates with this schema:\n\n```http\nPOST /invite HTTP/1.1\nContent-Type: application/json\n\n{\"emails\": \"<100000 spaces>\"}\n```\n\n### Impact\n\nThis is a denial of service by CPU exhaustion. It affects each application that validates untrusted input with `Joi.string().email({ multiple: true })` and that has no length limit before the `email` rule. One request with 100 KB of whitespace blocks the Node.js event loop for several seconds, and the server cannot process other requests during that time. The attacker needs no authentication when the route is public, and a small number of concurrent requests can keep the service unavailable.","state":0,"publishedAt":"2026-10-30T23:10:23+00:00","modifiedAt":"2026-10-30T23:15:07.2730353+00:00","affected":[{"ecosystem":"npm","name":"joi","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"17.1.1"},{"kind":"fixed","version":"17.13.9"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@hapi/joi","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"16.0.0"},{"kind":"last_affected","version":"17.1.1"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"joi","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"18.0.0"},{"kind":"fixed","version":"18.3.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/hapijs/joi/security/advisories/GHSA-4528-x5fx-h6hg","https://nvd.nist.gov/vuln/detail/CVE-2026-118772","https://github.com/hapijs/joi/pull/3162","https://github.com/hapijs/joi/pull/3163","https://github.com/hapijs/joi/commit/03dc1d909818503b06240dadc81e9227ed2649cf","https://github.com/hapijs/joi/commit/807858d7480f5075b0610817e3e44230890fb18e","https://github.com/hapijs/joi","https://github.com/hapijs/joi/releases/tag/v17.13.9","https://github.com/hapijs/joi/releases/tag/v18.3.1"],"sourceUrl":"https://github.com/advisories/GHSA-4528-x5fx-h6hg","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-4528-x5fx-h6hg","identifiers":["GHSA-4528-x5fx-h6hg","CVE-2026-118772"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-16T04:30:52.2557588+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-16T04:30:52.2557588+00:00","lastSuccessAt":"2026-11-16T04:30:52.4138138+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:30:52.4138142+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-6be044d0e08779dadd136f949a536de4047af96f5d7bceb7e190ecffbb8f18ca-0bd49273d5e55042165b0bf8d929a5e1c58f2e80c55e9b90759e8068a491d2ff","complete":true,"records":425880,"lastAttemptAt":"2026-11-16T04:30:51.492258+00:00","lastSuccessAt":"2026-11-16T04:30:51.4787927+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:30:51.492258+00:00","snapshotPublishedAt":"2026-11-16T04:26:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-3abc02021b4f4aca8814a90171a3cff3","complete":false,"records":13821,"lastAttemptAt":"2026-11-16T04:37:50.2124914+00:00","lastSuccessAt":"2026-11-16T04:37:50.2998134+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:37:50.2998134+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-16T04:30:52.2557588+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-16T04:30:52.2557588+00:00","lastSuccessAt":"2026-11-16T04:30:52.4146228+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:30:52.414623+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-6e513190d9ef4881bece4dd24fccf509","complete":false,"records":13833,"lastAttemptAt":"2026-11-16T04:31:23.21264+00:00","lastSuccessAt":"2026-11-16T04:31:23.208+00:00","error":"100 identifier lookups failed; latest failures include HttpIOException. Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T04:31:23.208+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13774,"expectedIdentifiers":13874,"failedIdentifiers":100},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-64eea06dbd27de8464d5dbce1b78cc794cc59e2d901516ae0d3ea76e624cdae0","complete":true,"records":9955,"lastAttemptAt":"2026-11-16T04:30:52.205304+00:00","lastSuccessAt":"2026-11-14T13:57:23.1208135+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:30:52.205304+00:00","snapshotPublishedAt":"2026-11-14T13:17:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-16T04:30:51.636669+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:30:51.636669+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-16T04:30:52.2185713+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:30:52.2185713+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-e77c8ea93875d599a3ee92fde74c7150d1a28eacc697b92dc129baff6877c60e","complete":true,"records":232477,"lastAttemptAt":"2026-11-16T04:30:52.0116608+00:00","lastSuccessAt":"2026-11-16T01:07:48.2266333+00:00","error":null,"lastVerifiedAt":"2026-11-16T04:30:52.0116608+00:00","snapshotPublishedAt":"2026-11-16T01:03:09+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}