Описание
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.
A flaw was found in joi. This vulnerability, known as prototype pollution, allows an attacker to inject properties into core JavaScript objects by supplying untrusted input directly into schema-construction configuration. Specifically, by using language keys like __proto__ or constructor in custom messages, an attacker can write properties onto Object.prototype or the Object function's static properties. This can lead to a consuming application taking incorrect execution paths, potentially altering its behavior in unexpected ways.
Отчет
A flaw was found in joi, a data validation library for JavaScript. Prototype pollution exists in the message compilation and merging logic, where attacker-controlled language keys such as proto supplied through schema configuration methods can write properties onto Object.prototype. Exploitation requires an application to pass untrusted input directly into schema-construction configuration, not into validated data, making real-world impact limited.
Меры по смягчению последствий
Upgrade to joi 17.13.6 or 18.2.5. As a workaround, ensure that only trusted, developer-controlled input is passed into joi schema configuration methods such as messages(), message(), prefs({ messages }), Joi.extend({ messages }), or rule({ message }). Do not pass user-supplied data directly into schema construction.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Gatekeeper 3 | gatekeeper/gatekeeper-rhel9 | Fix deferred | ||
| Migration Toolkit for Containers | rhmtc/openshift-migration-ui-rhel8 | Fix deferred | ||
| Red Hat Build of Podman Desktop | rh-podman-desktop.git | Fix deferred | ||
| Red Hat Data Grid 8 | redhat-datagrid-maven-repository.zip | Fix deferred | ||
| Red Hat Enterprise Linux 10 | grafana | Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana | Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-pcp | Fix deferred | ||
| Red Hat Enterprise Linux 8 | pcs | Fix deferred | ||
| Red Hat Enterprise Linux 9 | grafana | Fix deferred | ||
| Red Hat Fuse 7 | joi | Out of support scope |
Показывать по
Ссылки на источники
Дополнительная информация
Статус:
3.7 Low
CVSS3
Связанные уязвимости
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.
joi: Prototype pollution via a `__proto__` language key in custom messages
3.7 Low
CVSS3