CVE-2026-84368: joi Package Prototype Pollution via Custom Messages

joi Updated 08 Sep 2026

Summary

08/09/2026
Yes i
Low
3.7

CVE-2026-84368: joi: Prototype pollution via a proto language key in custom messages. Affects joi across 2 version ranges.

>= 17.2.0, < 17.13.6 >= 18.0.0, < 18.2.5

Fixed in 17.13.6 or 18.2.5, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The joi package is a popular JavaScript library used for schema validation, allowing developers to define and validate data structures in a flexible manner. It provides a rich set of features for data validation, including custom messages for error handling. However, a vulnerability has been identified that allows for prototype pollution through the misuse of custom message configurations.

Vulnerability Detail

The vulnerability arises when an application passes untrusted data into joi's custom message configuration methods, such as messages(), message(), prefs({ messages }), Joi.extend({ messages }), or rule({ message }). An attacker can exploit this by using keys like 'proto' or 'constructor', which can lead to the modification of Object.prototype. This means that any object in the application can inherit these malicious properties, potentially altering application behavior and leading to unauthorized access or manipulation of data.

How To Fix

Latest published version: 18.3.0 as of 23 Oct 2026

npm install joi@18.3.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 17.2.0, < 17.13.6 17.13.6
    npm install joi@17.13.6
  • >= 18.0.0, < 18.2.5 18.2.5
    npm install joi@18.2.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, avoid passing untrusted input into the custom message configuration methods. Ensure that any input does not contain 'proto' or 'constructor' properties. For example, you can validate the input before using it in the messages configuration:

const userInput = getUserInput();
if (!userInput.__proto__ && !userInput.constructor) {
    joi.messages(userInput);
}

Conclusion

The CVE-2026-84368 vulnerability in the joi package poses a significant risk due to prototype pollution via custom messages. It is essential for developers using joi to upgrade to the latest patched versions and implement the recommended workarounds to safeguard their applications.

See every vulnerability recorded for joi →

Share this vulnerability

FAQ

Prototype pollution is a security vulnerability that allows an attacker to modify the prototype of built-in objects in JavaScript, leading to unexpected behavior in applications.

You can check if your application is affected by using tools like Vulert, which monitors your package-lock.json for vulnerabilities in real-time.

If an immediate upgrade is not possible, implement the suggested workarounds to mitigate the risk until you can update to a secure version.

Failing to address this vulnerability can lead to unauthorized access, data manipulation, and potential breaches in application security.

Yes, the vulnerability affects joi versions starting from 17.2.0 up to 17.13.6 and 18.0.0 up to 18.2.5. Upgrading to the patched versions is crucial.

Related vulnerabilities

Recent vulnerabilities recorded for joi.

How To Fix

Latest published version: 18.3.0 as of 23 Oct 2026

npm install joi@18.3.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 17.2.0, < 17.13.6 17.13.6
    npm install joi@17.13.6
  • >= 18.0.0, < 18.2.5 18.2.5
    npm install joi@18.2.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback