Technical impact
A prototype pollution flaw exists in Joi versions 17.13.6 through 17.13.8 and 18.2.5 through 18.2.x, caused by the library's failure to reject a __proto__ language key during message compilation. The flaw enables attackers to override the internal prototype used for error messages, potentially changing or breaking how validation errors are rendered and influencing logic that depends on those messages. This is a classic prototype injection weakness (CWE-1321) and can lead to altered application behavior or denial of service. The vulnerability also maps to CWE-915, indicating unsafe or uncontrolled modification of internal state.
Affected Systems
The affected product is the Joi validation library from hapijs. Vulnerable versions include 17.13.6 up to 17.13.8 and 18.2.5 up through any 18.2.x less than 18.3.1. Any application that imports these versions is at risk when untrusted message configurations are passed via any().messages(), prefs, validate options, or Joi.extend.
Risk and Exploitability
With a CVSS score of 6.3, the vulnerability is of moderate severity. EPSS is < 1%, and the issue is not listed in the CISA KEV catalog. An attacker who can supply configuration data to Joi – such as a user submitting form input that is forwarded to a Joi validation routine – can trigger the prototype replacement, then use the altered prototype to influence validation output or trigger other downstream logic. The attack requires code execution within the application context, so indirect exploitation may combine this flaw with other vulnerabilities for higher impact.