CVE-2026-84368: 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.6 and 18.2.5, the @hapi/joi package through 17.1.1 and the successor joi package contain prototype pollution in lib/messages.js, where exports.compile() and exports.merge() reuse inherited objects for attacker-controlled language keys supplied through messages(), message(), prefs({ messages }), Joi.extend({ messages }), or rule({ message }). A language key named __proto__ writes properties onto Object.prototype, and constructor writes to the Object function's static properties. A consuming application that gates on the presence of an inherited property can take the wrong branch for every inspected object. The flaw is not reachable from data that joi validates and requires an application to feed untrusted input directly into schema-construction configuration. This issue is fixed in joi versions 17.13.6 and 18.2.5; no fixed @hapi/joi version is available.
CVSS v3.1
Score 3.7low
Affected software
hapijs
joi
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The hapijs joi package versions 16.0.0 through 17.13.5 and versions before 18.2.5 contain a prototype pollution vulnerability in lib/messages.js. Functions exports.compile() and exports.merge() reuse inherited objects for language keys supplied through various message-related APIs. An attacker can supply a language key named __proto__ or constructor to modify Object.prototype or Object static properties. This can cause applications that rely on inherited property checks to take incorrect code paths. The vulnerability is not exploitable via normal joi data validation but requires untrusted input to be passed into schema construction configuration. The issue is fixed in joi versions 17.13.6 and 18.2.5. No fixed versions exist for the older @hapi/joi package, which is affected through 17.1.1.
Potential Impact
This vulnerability allows an attacker to modify JavaScript object prototypes via specially crafted language keys in joi schema construction configuration. This can cause applications that check for inherited properties to behave incorrectly, potentially leading to logic errors or security bypasses. However, the flaw does not impact the validation of normal data inputs and requires direct feeding of untrusted input into schema construction. The CVSS score is 3.7 (low severity), reflecting limited impact and exploitation complexity.
Mitigation Recommendations
Upgrading to joi versions 17.13.6 or 18.2.5 resolves this vulnerability. No fixed versions exist for the older @hapi/joi package, so migrating to the maintained joi package and updating to a fixed version is recommended. Since the vulnerability requires untrusted input to be passed into schema construction configuration, avoiding this practice also mitigates the risk. Patch status is not explicitly stated as 'official-fix' in the vendor advisory, but the description confirms fixes in joi 17.13.6 and 18.2.5.
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: 6a973b19acd9273b492feeb1
Added to database: 09/01/2026, 20:52:41 UTC
Last enriched: 09/08/2026, 03:08:27 UTC
Last updated: 10/16/2026, 18:48:25 UTC
Views: 98
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.