mediumCVSS 4.2Vulnerability

GHSA-4c35-wcg5-mm9h

## Summary `setNestedProperty` in `packages/next-intl/src/extractor/utils.tsx` walks a dotted key path and assigns the final value without blocking the reserved keys `__proto__`, `constructor`, or `prototype`. When the next-intl Next.js plugin is configured with `experimental.messages` and `messages.precompile: true`, a JSON translation catalog containing a top‑level `__proto__` key causes `setNestedProperty(result, '__proto__.isAdmin', compiledMessage)` to assign onto `Object.prototype`, polluting every object in the running build process. ## Details Root cause — `packages/next-intl/src/extractor/utils.tsx:13-34`: ```ts export function setNestedProperty( obj: Record<string, any>, keyPath: string, value: any ): void { const keys = keyPath.split('.'); let current = obj; for (let i = 0; i < keys.length - 1; i++) { const key = keys[i]; if ( !(key in current) || typeof current[key] !== 'object' || current[key] === null ) { current[key] = {}; } current = current[key]; } current[keys[keys.length - 1]] = value; } ``` The existence check `!(key in current)` uses the `in` operator, which walks the prototype chain. For `key === '__proto__'`, `'__proto__' in {}` is `true` (it's inherited from `Object.prototype`) and `typeof current['__proto__'] === 'object'` (it *is* `Object.prototype`). The guard therefore never re-initializes `current[key]`, and `current = current['__proto__']` redirects all subsequent writes onto `Object.prototype`. The final assignment `current[keys[keys.length-1]] = value` sets `Object.prototype[<attacker key>] = <attacker value>`. Build-time data flow: 1. `packages/next-intl/src/plugin/catalog/catalogLoader.tsx:55-83` — the webpack/turbopack loader receives the catalog file `source` and, if `options.messages.precompile` is enabled, calls `codec.decode(source, {locale})`. 2. `packages/next-intl/src/extractor/format/codecs/JSONCodec.tsx:9-18` — `decode` runs `JSON.parse(source)`. V8 insta

Properties

ghsa_id
GHSA-4c35-wcg5-mm9h
severity
medium
summary
next-intl has prototype pollution with `experimental.messages.precompile` via attacker-controlled translation catalog keys
cvss_score
4.2
cve_id
GHSA-4c35-wcg5-mm9h
cvss_vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L
is_ghsa_only
true
ghsa_published
2026-05-06T17:34:12Z
source_url
https://github.com/advisories/GHSA-4c35-wcg5-mm9h
ghsa_updated
2026-05-06T17:34:13Z

Related Entities (4)

VULNERABLE_TO (1)

[Software]npm/next-intl

AFFECTS (1)

[Software]npm/next-intl

HAS_WEAKNESS (1)

[Weakness]Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-4c35-wcg5-mm9h (CVSS 4.2) — Ninja Signal Threat Intelligence | Ninja Signal