Medium, CVSS 4.2npmAmendedPublished
next-intl has prototype pollution with experimental.messages.precompile via attacker-controlled translation catalog keys
GHSA-4c35-wcg5-mm9h
- Affected
- npm next-intl <= 4.9.1
- Fixed in
- 4.9.2· Vendor fix available
- Issue
- 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: 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…
Recommended action: Upgrade to 4.9.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.