Impact
The vulnerability exists in the Joi validation library when the object().rename() method is used with a regular‑expression source and a template target that interpolates match data. When { multiple: true } is specified, an attacker can send a key such as x-__proto__ with an object value, causing the target name to evaluate to __proto__ and thereby set the prototype of the object returned by validate() instead of creating a normal key property. This alteration is limited to the object returned by the validation call and does not modify the global Object.prototype. If the prototype is polluted, subsequent code that relies on prototype properties can be subverted, potentially leading to logic flaws or code execution through prototype cascades.
Affected Systems
Vulnerable versions of hapijs Joi include all releases from 16.0.0 up through 17.13.4 and 18.2.3. The issue has been fixed in Joi releases 17.13.5 and 18.2.4. Any project that imports Joi 16.x, 17.x prior to 17.13.5, or 18.x prior to 18.2.4 is affected.
Risk and Exploitability
The CVSS score of 3.7 classifies this issue as low severity. EPSS data is not available, and the vulnerability is not listed in the CISA KEV catalog, indicating no known widespread exploitation. However, the potential for prototype pollution means an attacker could influence the behavior of privileged code that consumes the validated object, especially if the validator is used on untrusted input in a server‑side context. The exploitation vector is likely remote, via any HTTP request or other data source that the application validates with Joi's rename feature.
OpenCVE Enrichment
Github GHSA