6.3medium
Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 Prototype Replacement via __proto__ Language Key
- Severity
- 6.3medium CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.40% (higher than 36% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-6w3j-5fw6-r9vr
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| hapijs joi | from 17.13.6 before 17.13.9, from 18.2.5 before 18.3.1 | CVE List |
| joi (npm) | from 17.2.0 before 17.13.6, from 18.0.0 before 18.2.5 | GitHub Advisory Database |
| @hapi/joi (npm) | from 16.0.0 up to 17.1.1 | GitHub Advisory Database |
All scores
| VulnCheck | 6.3medium CVSS:4.0 | 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 |
| VulnCheck | 3.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 3.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
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.
References
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-122131 changed 2026-11-05 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-6w3j-5fw6-r9vr changed 2026-11-05 | CC-BY-4.0 |
| NVD | CVE-2026-122131 changed 2026-11-12 | Public domain |