CVE-2026-84368: joi Prototype Pollution Vulnerability

LOW
Advisory Identifier: GHSA-6w3j-5fw6-r9vr
CVSS 3.7
CWE-1321
Published
Advisory Summary

CVE-2026-84368 is a LOW (CVSS 3.7) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting joi libraries in the npm ecosystem. The issue involves prototype pollution via a `__proto__` language key in custom messages. Remediation is available by upgrading affected packages to version 17.13.6, 18.2.5.

CVE-2026-84368 at a Glance

CVE Identifier CVE-2026-84368
GHSA Identifier GHSA-6w3j-5fw6-r9vr
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product joi
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-84368

To remediate this vulnerability, upgrade all affected joi dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

joi fixed: 17.13.6
npm install joi@17.13.6
@hapi/joi fixed: Latest secure release
npm install @hapi/joi@Latest secure release
joi fixed: 18.2.5
npm install joi@18.2.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls joi

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-84368, inspect your project dependencies using npm:

npm ls joi

Analyze the terminal output to locate any version of joi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 17.13.6), your application is affected.

Note: The npm ls joi command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In joi, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact An application that passes attacker-controlled data into joi's custom message configuration (`messages()`, `message()`, `prefs({ messages })`, `Joi.extend({ messages })` or `rule({ message })`) lets the attacker write properties onto `Object.prototype`, where every object in the process then inherits them. A key named `__proto__` was treated as a language name, and the code reused the object it found at that key, which resolves to the prototype rather than to a new own property; a key named `constructor` did the same to the `Object` function's statics. A consuming application that gates on the mere presence of a property (`if (user.isAdmin)`) can be made to take the wrong branch for every object it inspects. This is not reachable from data that joi validates. Custom messages are schema-construction configuration, normally written by the application developer. Exploitation therefore requires an application that feeds untrusted input straight into schema construction. ### Patches Upgrade to version 18.2.5 or 17.13.6. ### Workarounds Do not pass untrusted input into `messages()`, `message()`, `prefs({ messages })`, `Joi.extend({ messages })` or `rule({ message })`. Or validate that they don't contain any `__proto__` or `constructor` property.

CVE-2026-84368 Affected joi Versions

3 component(s)
Fixed Versions:
17.13.618.2.5
Product / Package Ecosystem Affected Versions Fixed Version
joi
npm
≥ 17.2.0
< 17.13.6
17.13.6
@hapi/joi
npm
≥ 16.0.0
≤ 17.1.1
joi
npm
≥ 18.0.0
< 18.2.5
18.2.5

References

Frequently Asked Questions

What is CVE-2026-84368?
CVE-2026-84368 is a security vulnerability in joi involving Prototype pollution via a `__proto__` language key in custom messages under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which joi versions are affected?
Affected versions include releases prior to 17.13.6, 18.2.5 across affected packages: joi, @hapi/joi.
What version fixes CVE-2026-84368?
Upgrading to 17.13.6, 18.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is joi affected?
Yes, joi is affected in releases prior to 17.13.6, 18.2.5. Upgrade your dependency to 17.13.6, 18.2.5 or later.
Is @hapi/joi affected?
Yes, @hapi/joi is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-84368?
CVE-2026-84368 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-84368?
CVE-2026-84368 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2026-84368?
Run the dependency tree command: 'npm ls joi'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6w3j-5fw6-r9vr",
  "modified" : "2026-09-08T20:55:58Z",
  "published" : "2026-09-08T20:55:58Z",
  "aliases" : [ "CVE-2026-84368" ],
  "summary" : "joi: Prototype pollution via a `__proto__` language key in custom messages",
  "details" : "### Impact\nAn application that passes attacker-controlled data into joi's custom message configuration (`messages()`, `message()`, `prefs({ messages })`, `Joi.extend({ messages })` or `rule({ message })`) lets the attacker write properties onto `Object.prototype`, where every object in the process then inherits them. A key named `__proto__` was treated as a language name, and the code reused the object it found at that key, which resolves to the prototype rather than to a new own property; a key named `constructor` did the same to the `Object` function's statics. A consuming application that gates on the mere presence of a property (`if (user.isAdmin)`) can be made to take the wrong branch for every object it inspects.\n\nThis is not reachable from data that joi validates. Custom messages are schema-construction configuration, normally written by the application developer. Exploitation therefore requires an application that feeds untrusted input straight into schema construction.\n\n### Patches\nUpgrade to version 18.2.5 or 17.13.6.\n\n### Workarounds\nDo not pass untrusted input into `messages()`, `message()`, `prefs({ messages })`, `Joi.extend({ messages })` or `rule({ message })`. Or validate that they don't contain any `__proto__` or `constructor` property.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "joi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "17.2.0"
      }, {
        "fixed" : "17.13.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@hapi/joi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.0.0"
      }, {
        "last_affected" : "17.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "joi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "18.0.0"
      }, {
        "fixed" : "18.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-84368"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/pull/3138"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/pull/3139"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/commit/8d0b808f3e874d28f9078f61b7742290989afb36"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/commit/90d07571923c90e3432a328fc041d1cda03d30fa"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hapijs/joi"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-08T20:55:58Z",
    "nvd_published_at" : "2026-09-01T21:18:47Z"
  }
}