CVE-2026-84367

joi: object().rename() with a template target can set the validated object's prototype

Published Sep 1, 2026 CVSS 3.1 · 3.7 Low EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Joi to version 17.13.5 or later, or to 18.2.4 or later.
  • If an immediate upgrade is not possible, remove or avoid using object().rename() with { multiple: true } and a template target; instead, use static string keys or disallow regex sources in the rename operation.
  • Sanitize or reject any key names that could influence prototype properties, such as keys containing "__proto__" or "constructor".

Generated by OpenCVE AI on September 2, 2026 at 03:32 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-gg4h-3hg2-grpc joi: object().rename() with a template target can set the validated object's prototype
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Hapijs
Hapijs joi
Vendors & Products Hapijs
Hapijs joi
Type Values Removed Values Added
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.
Title joi: object().rename() with a template target can set the validated object's prototype
Weaknesses CWE-1321
References
Metrics cvssV3_1

{'score': 3.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N'}

Weaknesses
  • CWE-1321

    Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 3, 2026, 3:58 PM
Reserved
Sep 1, 2026, 4:27 PM
Status
Deferred
Published
Sep 1, 2026, 9:18 PM
Modified
Sep 9, 2026, 9:09 PM