Joi prototype pollution in message configuration
hapijs joi
hapijs joi
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.
From the CVE record · VulnCheck
Joi’s message compilation and merging can accept a `__proto__` language key. An attacker who can supply untrusted message configuration through `any().messages()`, preferences, validation options, or `Joi.extend` can alter or break validation error rendering and dependent logic. The input does not establish whether this requires authentication or user interaction.
Engineers using npm `joi` 17.2.0 through versions before 17.13.9 or 18.0.0 through versions before 18.3.1, or `@hapi/joi` 16.0.0 through 17.1.1, should check their installations.