CVE-2026-122131
JSON

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 packageVersionsReported by
hapijs joifrom 17.13.6 before 17.13.9, from 18.2.5 before 18.3.1CVE List
joi (npm)from 17.2.0 before 17.13.6, from 18.0.0 before 18.2.5GitHub Advisory Database
@hapi/joi (npm)from 16.0.0 up to 17.1.1GitHub Advisory Database

All scores

VulnCheck6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
VulnCheck3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHub3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-1321

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

https://github.com/hapijs/joi/commit/76f5771e1afe527cfda24be0e1a920ffa54888d6patch
https://github.com/hapijs/joipackage, product
https://github.com/hapijs/joi/commit/dae9467cec27e787bfdea8b276595177d52d28ecpatch
https://github.com/hapijs/joi/pull/3164issue-tracking, patch
https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vrrelated, vendor-advisory, web
https://github.com/hapijs/joi/blob/v18.3.0/lib/messages.js#L64-L67technical-description
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-keythird-party-advisory
https://nvd.nist.gov/vuln/detail/CVE-2026-84368advisory
https://github.com/hapijs/joi/pull/3138web
https://github.com/hapijs/joi/pull/3139web
https://github.com/hapijs/joi/commit/8d0b808f3e874d28f9078f61b7742290989afb36web
https://github.com/hapijs/joi/commit/90d07571923c90e3432a328fc041d1cda03d30faweb

Related

Sources

SourceRecordLicence
CVE ListCVE-2026-122131 changed 2026-11-05CVE Terms of Use
GitHub Advisory DatabaseGHSA-6w3j-5fw6-r9vr changed 2026-11-05CC-BY-4.0
NVDCVE-2026-122131 changed 2026-11-12Public domain