# CVE-2026-84368: joi: Prototype pollution via a `__proto__` language key in custom messages

> Prototype pollution in joi allows attackers to corrupt Object.prototype via custom message keys, potentially bypassing security checks in consuming applications.

- **Severity:** Low 3.7 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Sep 2026
- **Updated:** 2 Sep 2026
- **Also known as:** CLSA-2026-1791362244, ECHO-7ff3-9409-2629, GHSA-6w3j-5fw6-r9vr, MINI-3466-mhf3-25f4, MINI-49fh-wpxh-hc86, MINI-4pvg-j7m3-3pv3, MINI-6335-27px-c9c5, MINI-6524-gx66-qmff, MINI-665f-pm7x-24mw, MINI-8pw6-w566-wfvj, MINI-ccf4-xv3x-gwcv, MINI-cgrc-gjp6-mq45, MINI-g8xm-qj63-v6wc, MINI-jj6p-xp4h-xv5x, MINI-p23f-mjc4-5cpf, MINI-p9w9-mrc6-xh4v, MINI-q4j2-vcvq-88j9, MINI-rrvc-hv85-vxh3, MINI-vvm4-8j5p-97mh, MINI-whgx-j344-ggff, MINI-xcj3-38x5-fc77, ROOT-APP-NPM-CVE-2026-84368

## What is CVE-2026-84368?

CVE-2026-84368 is a low-severity vulnerability in hapijs joi, published on 1 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)

## Which versions are affected by CVE-2026-84368?

6 open source packages ship an affected version, including joi and @hapi/joi.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `joi` | npm | From 17.2.0 | 17.13.6 |
| `joi` | npm | From 17.2.0 | 17.13.6 |
| `joi` | npm | From 18.0.0 | 18.2.5 |
| `joi` | npm | From 18.0.0 | 18.2.5 |
| `@hapi/joi` | npm | From 16.0.0 to 17.1.1 | None |
| `@hapi/joi` | npm | From 16.0.0 to 17.1.1 | None |

## How do I fix CVE-2026-84368?

Upgrade joi to a fixed version for your release line: 17.13.6 or 18.2.5.

## Is CVE-2026-84368 being exploited?

There is no known exploitation of CVE-2026-84368 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-84368 and fix it if it is affected.

What it is: CVE-2026-84368 is a low-severity vulnerability in hapijs joi, published on 1 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-84368 in the wild and no public exploit code.

Affected packages and fixed versions:
- joi (npm): affected from 17.2.0; fixed in 17.13.6
- joi (npm): affected from 17.2.0; fixed in 17.13.6
- joi (npm): affected from 18.0.0; fixed in 18.2.5
- joi (npm): affected from 18.0.0; fixed in 18.2.5
- @hapi/joi (npm): affected from 16.0.0 up to 17.1.1; no fix listed
- @hapi/joi (npm): affected from 16.0.0 up to 17.1.1; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-84368/ (Markdown: https://insights.sbomify.com/CVE-2026-84368/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-84368
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-84368
- OSV: https://osv.dev/vulnerability/CVE-2026-84368

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-84368/
Summaries are generated and may contain mistakes; the official description above is the record.
