{"id":"CVE-2026-122131","aliases":["CVE-2026-122131","GHSA-6w3j-5fw6-r9vr"],"related":["CVE-2026-84368"],"kind":"vulnerability","state":"published","title":"Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 Prototype Replacement via __proto__ Language Key","summary":"Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 contains a prototype pollution vulnerability in lib/messages.js compile() and merge() that fails to reject a __proto__ language key. Attackers supplying untrusted message configuration via any().messages(), prefs, validate options or Joi.extend can replace the compiled messages prototype, altering or breaking validation error rendering and dependent logic.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 contains a prototype pollution vulnerability in lib/messages.js compile() and merge() that fails to reject a __proto__ language key. Attackers supplying untrusted message configuration via any().messages(), prefs, validate options or Joi.extend can replace the compiled messages prototype, altering or breaking validation error rendering and dependent logic.","source":"cvelist"},{"lang":"en","text":"### Impact\nAn application that passes attacker-controlled data into joi's custom message configuration (`messages()`, `message()`, `prefs({ messages })`, `Joi.extend({ messages })` or `rule({ message })`) lets the attacker write properties onto `Object.prototype`, where every object in the process then inherits them. A key named `__proto__` was treated as a language name, and the code reused the object it found at that key, which resolves to the prototype rather than to a new own property; a key named `constructor` did the same to the `Object` function's statics. A consuming application that gates on the mere presence of a property (`if (user.isAdmin)`) can be made to take the wrong branch for every object it inspects.\n\nThis is not reachable from data that joi validates. Custom messages are schema-construction configuration, normally written by the application developer. Exploitation therefore requires an application that feeds untrusted input straight into schema construction.\n\n### Patches\nUpgrade to version 18.2.5 or 17.13.6.\n\n### Workarounds\nDo not pass untrusted input into `messages()`, `message()`, `prefs({ messages })`, `Joi.extend({ messages })` or `rule({ message })`. Or validate that they don't contain any `__proto__` or `constructor` property.","format":"markdown","source":"ghsa"}],"published":"2026-09-08T20:55:58.000Z","modified":"2026-11-12T21:30:23.870Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"}],"cwes":["CWE-1321"],"affected":[{"ranges":[{"type":"semver","introduced":"17.13.6","fixed":"17.13.9","status":"affected"},{"type":"semver","introduced":"18.2.5","fixed":"18.3.1","status":"affected"}],"vendor":"hapijs","product":"joi","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"17.2.0","status":"affected","fixed":"17.13.6"}],"ecosystem":"npm","package":"joi","purl":"pkg:npm/joi","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"16.0.0","status":"affected","lastAffected":"17.1.1"}],"ecosystem":"npm","package":"@hapi/joi","purl":"pkg:npm/%40hapi/joi","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"18.0.0","status":"affected","fixed":"18.2.5"}],"ecosystem":"npm","package":"joi","purl":"pkg:npm/joi","source":"ghsa"}],"references":[{"url":"https://github.com/hapijs/joi/commit/76f5771e1afe527cfda24be0e1a920ffa54888d6","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/hapijs/joi","tags":["package","product"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapijs/joi/commit/dae9467cec27e787bfdea8b276595177d52d28ec","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/hapijs/joi/pull/3164","tags":["issue-tracking","patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr","tags":["related","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapijs/joi/blob/v18.3.0/lib/messages.js#L64-L67","tags":["technical-description"],"sources":["cvelist","nvd"]},{"url":"https://www.vulncheck.com/advisories/joi-17.13.6-before-17.13.9-and-18.2.5-before-18.3.1-prototype-replacement-via-proto-language-key","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84368","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/hapijs/joi/pull/3138","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/hapijs/joi/pull/3139","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/hapijs/joi/commit/8d0b808f3e874d28f9078f61b7742290989afb36","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/hapijs/joi/commit/90d07571923c90e3432a328fc041d1cda03d30fa","tags":["web"],"sources":["ghsa"]}],"credits":["Zachariah Mithani (AploSec)","Marsup"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T19:39:47.724Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-122131","url":"https://www.cve.org/CVERecord?id=CVE-2026-122131","licence":"CVE Terms of Use","modified":"2026-11-05T19:40:15.094Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6w3j-5fw6-r9vr","url":"https://github.com/advisories/GHSA-6w3j-5fw6-r9vr","licence":"CC-BY-4.0","modified":"2026-11-05T10:55:49.405Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-122131","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-122131","licence":"Public domain","modified":"2026-11-12T21:30:23.870Z"}],"updatedAt":"2026-11-25T22:59:49.038Z","epss":{"score":0.00402,"percentile":0.36621,"date":"2026-12-01T12:00:22.000Z"}}