{"id":"CVE-2026-84367","aliases":["CLSA-2026-1792486432","CLSA-2026-1792510126","EUVD-2026-69648","GHSA-gg4h-3hg2-grpc","ROOT-APP-NPM-CVE-2026-84367"],"status":"published","title":"joi: object().rename() with a template target can set the validated object's prototype","description":"joi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.5 and 18.2.4, joi's lib/types/keys.js internals.rename() implementation used by object().rename() permits a schema that renames keys with a regular-expression source and a Joi.expression() or Joi.x() target that interpolates the pattern's own match data, combined with { multiple: true }, to derive a target from an attacker-controlled input key. An attacker can send x-__proto__ with an object value, causing the target to render as __proto__ and set the prototype of the object returned by validate() instead of creating an own key. The global Object.prototype is not modified, so the effect is confined to the object returned by that validation call. Static-string targets and schemas using the default { multiple: false } are not affected. This issue is fixed in versions 17.13.5 and 18.2.4.","severity":{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-08","score":0.00389,"percentile":0.33267,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1321"],"published":"2026-09-01T20:33:29Z","modified":"2026-10-28T02:30:42Z","fixes":[{"ecosystem":"npm","package":"joi","fixed_in":["17.13.5","18.2.4"],"sources":["ghsa","osv"]},{"ecosystem":"Root:npm","package":"joi","fixed_in":["17.13.5-aikido.1","17.13.5-aikido.2"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/joi","fixed_in":["17.13.5-root.io.1","17.13.5-root.io.2"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"joi","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"16.0.0"},{"fixed":"17.13.5"}]}]},{"source":"ghsa","ecosystem":"npm","package":"joi","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.0.0"},{"fixed":"18.2.4"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"@hapi/joi","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"16.1.8-tuxcare.0"},{"fixed":"16.1.8-tuxcare.2"}]}],"versions":["16.1.8","16.1.8-tuxcare.1"],"bundled":3},{"source":"osv","ecosystem":"TuxCare:npm","package":"joi","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"17.13.4-tuxcare.0"},{"fixed":"17.13.4-tuxcare.1"}]}],"versions":["17.13.4"],"bundled":4},{"source":"osv","ecosystem":"npm","package":"joi","ranges":[{"type":"SEMVER","events":[{"introduced":"16.0.0"},{"fixed":"17.13.5"}]}]},{"source":"osv","ecosystem":"npm","package":"joi","ranges":[{"type":"SEMVER","events":[{"introduced":"18.0.0"},{"fixed":"18.2.4"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"joi","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"17.13.5-aikido.1"},{"fixed":"17.13.5-aikido.2"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/joi","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"17.13.5-root.io.1"},{"fixed":"17.13.5-root.io.2"}]}]}],"products":[{"vendor":"hapijs","product":"joi"}],"references":[{"url":"https://github.com/hapijs/joi/security/advisories/GHSA-gg4h-3hg2-grpc","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/hapijs/joi/pull/3134","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/hapijs/joi/pull/3135","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/hapijs/joi/commit/162f367aa178d2e1ebec8dc1164e5fe16536ddf6","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/hapijs/joi/commit/172ececa192feda532b743d77bc9d3e523d19b01","tags":["x_refsource_MISC","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84367","tags":["advisory"]},{"url":"https://github.com/hapijs/joi/releases/tag/v17.13.5","tags":["web"]},{"url":"https://github.com/hapijs/joi/releases/tag/v18.2.4","tags":["web"]},{"url":"https://github.com/advisories/GHSA-gg4h-3hg2-grpc"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/84xxx/CVE-2026-84367.json","tags":["advisory"]},{"url":"https://github.com/hapijs/joi","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-84367","title":"joi: object().rename() with a template target can set the validated object's prototype","description":"joi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.5 and 18.2.4, joi's lib/types/keys.js internals.rename() implementation used by object().rename() permits a schema that renames keys with a regular-expression source and a Joi.expression() or Joi.x() target that interpolates the pattern's own match data, combined with { multiple: true }, to derive a target from an attacker-controlled input key. An attacker can send x-__proto__ with an object value, causing the target to render as __proto__ and set the prototype of the object returned by validate() instead of creating an own key. The global Object.prototype is not modified, so the effect is confined to the object returned by that validation call. Static-string targets and schemas using the default { multiple: false } are not affected. This issue is fixed in versions 17.13.5 and 18.2.4.","status":"published","published":"2026-09-01T20:33:29.295Z","modified":"2026-09-03T15:58:42.656Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"cna"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T14:20:08.391556Z"}],"euvd":[{"id":"EUVD-2026-69648","description":"joi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.5 and 18.2.4, joi's lib/types/keys.js internals.rename() implementation used by object().rename() permits a schema that renames keys with a regular-expression source and a Joi.expression() or Joi.x() target that interpolates the pattern's own match data, combined with { multiple: true }, to derive a target from an attacker-controlled input key. An attacker can send x-__proto__ with an object value, causing the target to render as __proto__ and set the prototype of the object returned by validate() instead of creating an own key. The global Object.prototype is not modified, so the effect is confined to the object returned by that validation call. Static-string targets and schemas using the default { multiple: false } are not affected. This issue is fixed in versions 17.13.5 and 18.2.4.","status":"published","published":"2026-09-01T20:33:29Z","modified":"2026-09-03T15:58:42Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"updated_at":"2026-11-02T18:01:13.671159Z"}],"ghsa":[{"id":"GHSA-gg4h-3hg2-grpc","title":"joi: object().rename() with a template target can set the validated object's prototype","description":"### Impact\n\nApplications are affected only if a schema renames keys with a regular-expression source and a `Joi.expression()` / `Joi.x()` target that interpolates the pattern's own match data, combined with `{ multiple: true }`, for example `.rename(/^x-(.+)$/, Joi.x('{#1}'), { multiple: true })`. Because the target is rendered from the matched input key, an attacker who controls input keys can send `x-__proto__` with an object value and make the rename target render as `__proto__`, which sets the prototype of the object joi returns instead of creating a key on it. The global `Object.prototype` is not modified, so the effect is confined to the object returned by that one `validate()` call.\n\nSchemas using a static string rename target are not affected, and neither are schemas left on the default `{ multiple: false }`.\n\n### Patches\n\nVersions 17.13.5 and 18.2.4 have been released to address the issue.\n\n### Workarounds\n\n1. Replace the template rename target with a static string target.\n2. Keep the template but make the capture unable to produce `__proto__`, using a negative lookahead: `.rename(/^x-(?!__proto__$)(.+)$/, Joi.x('{#1}'), { multiple: true })`\n3. Drop { multiple: true } from the rename, which stops the rename before the assignment.","status":"published","published":"2026-09-08T20:51:21Z","modified":"2026-09-08T20:51:23Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T14:41:14.764963Z"}],"nvd":[{"id":"CVE-2026-84367","description":"joi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.5 and 18.2.4, joi's lib/types/keys.js internals.rename() implementation used by object().rename() permits a schema that renames keys with a regular-expression source and a Joi.expression() or Joi.x() target that interpolates the pattern's own match data, combined with { multiple: true }, to derive a target from an attacker-controlled input key. An attacker can send x-__proto__ with an object value, causing the target to render as __proto__ and set the prototype of the object returned by validate() instead of creating an own key. The global Object.prototype is not modified, so the effect is confined to the object returned by that validation call. Static-string targets and schemas using the default { multiple: false } are not affected. This issue is fixed in versions 17.13.5 and 18.2.4.","status":"published","published":"2026-09-01T21:18:47.737Z","modified":"2026-09-09T21:09:13.08Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"secondary"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T14:12:43.04945Z"}],"osv":[{"id":"CVE-2026-84367","title":"joi: object().rename() with a template target can set the validated object's prototype","description":"joi is a schema description language and data validator for JavaScript. From 16.0.0 until 17.13.5 and 18.2.4, joi's lib/types/keys.js internals.rename() implementation used by object().rename() permits a schema that renames keys with a regular-expression source and a Joi.expression() or Joi.x() target that interpolates the pattern's own match data, combined with { multiple: true }, to derive a target from an attacker-controlled input key. An attacker can send x-__proto__ with an object value, causing the target to render as __proto__ and set the prototype of the object returned by validate() instead of creating an own key. The global Object.prototype is not modified, so the effect is confined to the object returned by that validation call. Static-string targets and schemas using the default { multiple: false } are not affected. This issue is fixed in versions 17.13.5 and 18.2.4.","status":"published","published":"2026-09-01T20:33:29.295Z","modified":"2026-10-28T02:30:42.236446972Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T15:45:18.482949Z"},{"id":"GHSA-gg4h-3hg2-grpc","title":"joi: object().rename() with a template target can set the validated object's prototype","description":"### Impact\n\nApplications are affected only if a schema renames keys with a regular-expression source and a `Joi.expression()` / `Joi.x()` target that interpolates the pattern's own match data, combined with `{ multiple: true }`, for example `.rename(/^x-(.+)$/, Joi.x('{#1}'), { multiple: true })`. Because the target is rendered from the matched input key, an attacker who controls input keys can send `x-__proto__` with an object value and make the rename target render as `__proto__`, which sets the prototype of the object joi returns instead of creating a key on it. The global `Object.prototype` is not modified, so the effect is confined to the object returned by that one `validate()` call.\n\nSchemas using a static string rename target are not affected, and neither are schemas left on the default `{ multiple: false }`.\n\n### Patches\n\nVersions 17.13.5 and 18.2.4 have been released to address the issue.\n\n### Workarounds\n\n1. Replace the template rename target with a static string target.\n2. Keep the template but make the capture unable to produce `__proto__`, using a negative lookahead: `.rename(/^x-(?!__proto__$)(.+)$/, Joi.x('{#1}'), { multiple: true })`\n3. Drop { multiple: true } from the rename, which stops the rename before the assignment.","status":"published","published":"2026-09-08T20:51:21Z","modified":"2026-09-08T21:00:05.097709715Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T15:46:47.822182Z"},{"id":"CLSA-2026-1792486432","title":"TuxCare security update for @hapi/joi (3 CVEs)","description":"TuxCare rebuilt @hapi/joi to address 3 CVEs. Fixed in 16.1.8-tuxcare.2.","status":"published","published":"2026-10-20T08:53:52Z","modified":"2026-10-20T13:45:10.569817686Z","updated_at":"2026-11-02T15:43:54.378946Z"},{"id":"CLSA-2026-1792510126","title":"TuxCare security update for joi (4 CVEs)","description":"TuxCare rebuilt joi to address 4 CVEs. Fixed in 17.13.4-tuxcare.1.","status":"published","published":"2026-10-20T15:28:46Z","modified":"2026-10-20T19:30:18.883518642Z","updated_at":"2026-11-02T15:43:54.378946Z"},{"id":"ROOT-APP-NPM-CVE-2026-84367","title":"CVE-2026-84367 in joi - Patched by Root","description":"Root has patched CVE-2026-84367 in the joi package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-10-14T05:25:15Z","modified":"2026-10-14T06:15:03.298495129Z","updated_at":"2026-11-02T15:53:27.649662Z"}]}}
