Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 Prototype Replacement via __proto__ Language Key
cve-program · CVE-2026-122131
PublishedJoi 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.
Read the publisher's advisorycve-program · CVE-2026-84368
Publishedjoi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.6 and 18.2.5, the @hapi/joi package through 17.1.1 and the successor joi package contain prototype pollution in lib/messages.js, where exports.compile() and exports.merge() reuse inherited objects for attacker-controlled language keys supplied through messages(), message(), prefs({ messages }), Joi.extend({ messages }), or rule({ message }). A language key named __proto__ writes properties onto Object.prototype, and constructor writes to the Object function's static properties. A consuming application that gates on the presence of an inherited property can take the wrong branch for every inspected object. The flaw is not reachable from data that joi validates and requires an application to feed untrusted input directly into schema-construction configuration. This issue is fixed in joi versions 17.13.6 and 18.2.5; no fixed @hapi/joi version is available.
Read the publisher's advisoryeuvd · EUVD-2026-117085
PublishedJoi 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.
Read the publisher's advisoryeuvd · EUVD-2026-69649
Publishedjoi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.6 and 18.2.5, the @hapi/joi package through 17.1.1 and the successor joi package contain prototype pollution in lib/messages.js, where exports.compile() and exports.merge() reuse inherited objects for attacker-controlled language keys supplied through messages(), message(), prefs({ messages }), Joi.extend({ messages }), or rule({ message }). A language key named __proto__ writes properties onto Object.prototype, and constructor writes to the Object function's static properties. A consuming application that gates on the presence of an inherited property can take the wrong branch for every inspected object. The flaw is not reachable from data that joi validates and requires an application to feed untrusted input directly into schema-construction configuration. This issue is fixed in joi versions 17.13.6 and 18.2.5; no fixed @hapi/joi version is available.
Read the publisher's advisorynvd · CVE-2026-122131
PublishedJoi 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.
Read the publisher's advisorynvd · CVE-2026-84368
Publishedjoi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.6 and 18.2.5, the @hapi/joi package through 17.1.1 and the successor joi package contain prototype pollution in lib/messages.js, where exports.compile() and exports.merge() reuse inherited objects for attacker-controlled language keys supplied through messages(), message(), prefs({ messages }), Joi.extend({ messages }), or rule({ message }). A language key named __proto__ writes properties onto Object.prototype, and constructor writes to the Object function's static properties. A consuming application that gates on the presence of an inherited property can take the wrong branch for every inspected object. The flaw is not reachable from data that joi validates and requires an application to feed untrusted input directly into schema-construction configuration. This issue is fixed in joi versions 17.13.6 and 18.2.5; no fixed @hapi/joi version is available.
Read the publisher's advisoryosv · GHSA-6w3j-5fw6-r9vr
Published### Impact An 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. This 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. ### Patches Upgrade to version 18.2.5 or 17.13.6. ### Workarounds Do 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.
Read the publisher's advisoryAffected versions, risk and source history
Related advisories and sources
Publishers link these advisories through the identifiers shown below. A shared identifier or date alone does not tell you whether your software is affected or whether the advisories describe the same cause.
CVE-2026-122131 · CVE overview and exploitation status
CVE-2026-84368 · CVE overview and exploitation status
cve-program · CVE-2026-122131
- https://github.com/hapijs/joi/commit/76f5771e1afe527cfda24be0e1a920ffa54888d6
- https://github.com/hapijs/joi
- https://github.com/hapijs/joi/commit/dae9467cec27e787bfdea8b276595177d52d28ec
- https://github.com/hapijs/joi/pull/3164
- https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
- https://github.com/hapijs/joi/blob/v18.3.0/lib/messages.js#L64-L67
- 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
cve-program · CVE-2026-84368
- https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
- https://github.com/hapijs/joi/pull/3138
- https://github.com/hapijs/joi/pull/3139
- https://github.com/hapijs/joi/commit/8d0b808f3e874d28f9078f61b7742290989afb36
- https://github.com/hapijs/joi/commit/90d07571923c90e3432a328fc041d1cda03d30fa
euvd · EUVD-2026-117085
- https://github.com/hapijs/joi/commit/76f5771e1afe527cfda24be0e1a920ffa54888d6
- https://github.com/hapijs/joi
- https://github.com/hapijs/joi/commit/dae9467cec27e787bfdea8b276595177d52d28ec
- https://github.com/hapijs/joi/pull/3164
- https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
- https://github.com/hapijs/joi/blob/v18.3.0/lib/messages.js#L64-L67
- 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
euvd · EUVD-2026-69649
- https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
- https://github.com/hapijs/joi/pull/3138
- https://github.com/hapijs/joi/pull/3139
- https://github.com/hapijs/joi/commit/8d0b808f3e874d28f9078f61b7742290989afb36
- https://github.com/hapijs/joi/commit/90d07571923c90e3432a328fc041d1cda03d30fa
nvd · CVE-2026-122131
- https://github.com/hapijs/joi
- https://github.com/hapijs/joi/blob/v18.3.0/lib/messages.js#L64-L67
- https://github.com/hapijs/joi/commit/76f5771e1afe527cfda24be0e1a920ffa54888d6
- https://github.com/hapijs/joi/commit/dae9467cec27e787bfdea8b276595177d52d28ec
- https://github.com/hapijs/joi/pull/3164
- https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
- 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
nvd · CVE-2026-84368
- https://github.com/hapijs/joi/commit/8d0b808f3e874d28f9078f61b7742290989afb36
- https://github.com/hapijs/joi/commit/90d07571923c90e3432a328fc041d1cda03d30fa
- https://github.com/hapijs/joi/pull/3138
- https://github.com/hapijs/joi/pull/3139
- https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
osv · GHSA-6w3j-5fw6-r9vr
- https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
- https://nvd.nist.gov/vuln/detail/CVE-2026-84368
- https://github.com/hapijs/joi/pull/3138
- https://github.com/hapijs/joi/pull/3139
- https://github.com/hapijs/joi/commit/8d0b808f3e874d28f9078f61b7742290989afb36
- https://github.com/hapijs/joi/commit/90d07571923c90e3432a328fc041d1cda03d30fa
- https://github.com/hapijs/joi
Related changes
Linked by CVE identifier- 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… · Advisory content revised · 13 Nov 2026
- 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… · Advisory content revised · 7 Nov 2026
- joi: Prototype pollution via a `__proto__` language key in custom messages · Advisory content revised · 5 Nov 2026
- Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 Prototype Replacement via __proto__ Language Key · Newly collected advisory · 4 Nov 2026