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.
Published: 2026-09-01
Score: 3.7 Low
EPSS: < 1% Very Low
KEV: No
Impact: Prototype pollution via custom messages
Action: Update joi
AI Analysis

Impact

The vulnerability arises from prototype pollution in the lib/messages.js module of the joi validation library. When an attacker can supply an untrusted language key named __proto__ or constructor through messages(), message(), prefs({messages}), Joi.extend({messages}), or rule({message}), the library writes properties onto Object.prototype or static properties on the Object constructor. This flaw is a classic Prototype Pollution weakness (CWE‑1321, CWE‑915) that can cause all objects in the process to inherit unexpected properties, potentially leading to unpredictable behaviour or bypasses in application logic. The impact is limited to objects affected by the polluted prototype, without enabling direct code execution, but can subvert flow control or introduce other subtle bugs.

Affected Systems

Vulnerable to usage of hapijs joi @hapi/joi versions 16.0.0‑17.13.6 and the successor joi package 18.0.0‑18.2.5. No patch is available for @hapi/joi; the fix is included in joi 17.13.6 and 18.2.5.

Risk and Exploitability

The flaw poses a low CVSS risk (3.7) and has an EPSS score of 0.00255. The exploitation requires that an attacker can inject untrusted input into the schema construction process, typically through dynamic configuration of messages() or similar APIs. Once achieved, prototype pollution can affect every object inspected by the application, potentially breaking control flow or exposing other vulnerabilities (CWE‑1321, CWE‑915). The vulnerability is not currently in CISA’s KEV catalog and has an EPSS score of 0.00255, indicating a very low probability of exploitation but still relevant to systems exposing schema construction to untrusted data.

Generated by OpenCVE AI on September 3, 2026 at 14:25 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to joi version 17.13.6 or later (or 18.2.5 if using the successor package) to eliminate the prototype pollution path.
  • If upgrading is not feasible, remove or restrict use of custom messages in schema construction and validate any language keys before feeding them into joi.
  • Verify that any configuration data used to build schemas originates only from trusted sources or is sanitized to disallow __proto__ or constructor keys.

Generated by OpenCVE AI on September 3, 2026 at 14:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-6w3j-5fw6-r9vr joi: Prototype pollution via a `__proto__` language key in custom messages
History

Thu, 03 Sep 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-915
References
Metrics threat_severity

None

threat_severity

Low


Wed, 02 Sep 2026 13:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 02 Sep 2026 02:15:00 +0000

Type Values Removed Values Added
First Time appeared Hapijs
Hapijs joi
Vendors & Products Hapijs
Hapijs joi

Tue, 01 Sep 2026 22:00:00 +0000

Type Values Removed Values Added
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.
Title joi: Prototype pollution via a `__proto__` language key in custom messages
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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-02T12:18:07.627Z

Reserved: 2026-09-01T16:27:58.129Z

Link: CVE-2026-84368

cve-icon Vulnrichment

Updated: 2026-09-02T12:17:54.690Z

cve-icon NVD

Status : Deferred

Published: 2026-09-01T21:18:47.887

Modified: 2026-09-09T21:09:13.080

Link: CVE-2026-84368

cve-icon Redhat

Severity : Low

Publid Date: 2026-09-01T20:36:51Z

Links: CVE-2026-84368 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-03T14:30:05Z

Weaknesses
  • CWE-1321

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

  • CWE-915

    Improperly Controlled Modification of Dynamically-Determined Object Attributes