CVE-2026-84367: CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in hapijs joi
Description
joi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.5 and 18.2.4, joi's lib/types/keys.js internals.rename() implementation used by object().rename() permits a schema that renames keys with a regular-expression source and a Joi.expression() or Joi.x() target that interpolates the pattern's own match data, combined with { multiple: true }, to derive a target from an attacker-controlled input key. An attacker can send x-__proto__ with an object value, causing the target to render as __proto__ and set the prototype of the object returned by validate() instead of creating an own key. The global Object.prototype is not modified, so the effect is confined to the object returned by that validation call. Static-string targets and schemas using the default { multiple: false } are not affected. This issue is fixed in versions 17.13.5 and 18.2.4.
CVSS v3.1
Score 3.7low
Affected software
hapijs
joi
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in hapijs joi involves improper control of object prototype attributes (CWE-1321), specifically a prototype pollution flaw in the internals.rename() function used by object().rename(). When a schema uses a regular-expression source for renaming keys combined with Joi.expression() or Joi.x() targets that interpolate the matched pattern data and the { multiple: true } option, an attacker can supply a key such as x-__proto__ with an object value. This causes the prototype of the object returned by validate() to be set to the attacker's object, rather than adding a normal own property. The global Object.prototype remains unaffected, so the pollution is confined to the validated object instance. This flaw affects joi versions from 16.0.0 up to but not including 17.13.5 and 18.2.4, where it has been fixed.
Potential Impact
The vulnerability allows an attacker to modify the prototype of the object returned by the validate() function, potentially leading to unexpected behavior or logic errors in applications relying on joi for validation. However, the global Object.prototype is not modified, which limits the scope of the impact to the single validated object instance. The CVSS score is 3.7 (low), indicating limited impact with no confidentiality or availability effects and requiring network access with high attack complexity and no privileges or user interaction.
Mitigation Recommendations
This vulnerability is fixed in joi versions 17.13.5 and 18.2.4. Users should upgrade to these versions or later to remediate the issue. There is no indication of vendor-provided temporary fixes or workarounds. If upgrading immediately is not possible, avoid using schemas that rename keys with regular-expression sources combined with Joi.expression() or Joi.x() targets that interpolate match data and the { multiple: true } option. Schemas using static-string targets or the default { multiple: false } are not affected.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-09-01T16:27:58.129Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a973b19acd9273b492feeaf
Added to database: 09/01/2026, 20:52:41 UTC
Last enriched: 09/07/2026, 13:03:03 UTC
Last updated: 10/16/2026, 06:48:19 UTC
Views: 83
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.