---
id: "CVE-2026-122131"
kind: "vulnerability"
aliases: ["CVE-2026-122131"]
title: "Joi: prototype pollution via untrusted __proto__ message language key"
severity: "medium"
cvss: 6.3
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["backend", "javascript", "joi", "node.js", "package"]
not_affected_if: ["fixed-schemas", "no-user-supplied-messages", "versions-outside-range"]
published_at: "2026-11-04T21:18:08+00:00"
first_seen_at: "2026-11-04T21:49:19+00:00"
updated_at: "2026-11-04T21:51:14+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-122131", "first_seen_at": "2026-11-04T21:49:19+00:00"}]
exploit_sources: []
---

# Joi: prototype pollution via untrusted __proto__ message language key

Joi, a JavaScript validation library, fails to reject a __proto__ language key when compiling messages, so attacker-supplied message configuration can replace the messages prototype. The result is altered or broken validation error rendering and dependent logic.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Joi version with `npm ls joi` and compare it against the affected ranges 17.13.6 to before 17.13.9 and 18.2.5 to before 18.3.1.
- Search the code for `any().messages(`, `.prefs(`, `Joi.extend` or validate options that take user-supplied objects.

## Fix

- Joi 17.x: move to `17.13.9` or later.
- Joi 18.x: move to `18.3.1` or later.

## Timeline

- 2026-11-04T21:49:19+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-122131

## Documents

- [advisory] Vendor advisory: github.com https://github.com/hapijs/joi/security/advisories/GHSA-6w3j-5fw6-r9vr
- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/joi-17.13.6-before-17.13.9-and-18.2.5-before-18.3.1-prototype-replacement-via-proto-language-key
- [fix] Patch: github.com https://github.com/hapijs/joi/commit/76f5771e1afe527cfda24be0e1a920ffa54888d6
- [fix] Patch: github.com https://github.com/hapijs/joi/commit/dae9467cec27e787bfdea8b276595177d52d28ec

## From the sources

Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 contains a prototype pollution vulnerability in lib/messages.js compile() and merge() that fails to reject a __proto__ language key. Attackers supplying untrusted message configuration via any().messages(), prefs, validate options or Joi.extend can replace the compiled messages prototype, altering or breaking validation error rendering and dependent logic.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
