chore(deps): update next-intl to 4.9.2#9
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
e7acd2d to
070b4ca
Compare
070b4ca to
5ab457a
Compare
5ab457a to
8d22e89
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.7.0→4.9.2next-intl has an open redirect vulnerability
CVE-2026-40299 / GHSA-8f24-v5vv-gm5j
More information
Details
Impact
Applications using the
next-intlmiddleware withlocalePrefix: 'as-needed'could construct URLs where path handling and the WHATWG URL parser resolved a relative redirect target to another host (e.g. scheme-relative//or control characters stripped by the URL parser), so the middleware could redirect the browser off-site while the user still started from a trusted app URL.Patches
The problem has been patched, please update to
next-intl@4.9.1.Credits
Many thanks to Joni Liljeblad from Oura for responsibly disclosing the vulnerability and for suggesting the fix.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
next-intl has prototype pollution with
experimental.messages.precompilevia attacker-controlled translation catalog keysGHSA-4c35-wcg5-mm9h
More information
Details
Summary
setNestedPropertyinpackages/next-intl/src/extractor/utils.tsxwalks a dotted key path and assigns the final value without blocking the reserved keys__proto__,constructor, orprototype. When the next-intl Next.js plugin is configured withexperimental.messagesandmessages.precompile: true, a JSON translation catalog containing a top‑level__proto__key causessetNestedProperty(result, '__proto__.isAdmin', compiledMessage)to assign ontoObject.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 theinoperator, which walks the prototype chain. Forkey === '__proto__','__proto__' in {}istrue(it's inherited fromObject.prototype) andtypeof current['__proto__'] === 'object'(it isObject.prototype). The guard therefore never re-initializescurrent[key], andcurrent = current['__proto__']redirects all subsequent writes ontoObject.prototype. The final assignmentcurrent[keys[keys.length-1]] = valuesetsObject.prototype[<attacker key>] = <attacker value>.Build-time data flow:
packages/next-intl/src/plugin/catalog/catalogLoader.tsx:55-83— the webpack/turbopack loader receives the catalog filesourceand, ifoptions.messages.precompileis enabled, callscodec.decode(source, {locale}).packages/next-intl/src/extractor/format/codecs/JSONCodec.tsx:9-18—decoderunsJSON.parse(source). V8 installs__proto__as an own data property on the result when the JSON key is literally"__proto__"(bypassing the normalObject.prototype.__proto__setter that would otherwise reassign the prototype).JSONCodec.tsx:33-53—traverseMessagesiteratesObject.keys(obj), which for a JSON‑parsed object includes the own__proto__key. It readsobj.__proto__(returns the attacker’s nested object, notObject.prototype, because it's an own property), recurses into it, and emits message id__proto__.isAdmin.catalogLoader.tsx:71—precompileMessages(decoded, cache).catalogLoader.tsx:89-131— for each message, callssetNestedProperty(result, message.id, compiledMessage). Withmessage.id === '__proto__.isAdmin',setNestedPropertywalks intoObject.prototypeand assignsObject.prototype.isAdmin = compiledMessage.The same sink is also reachable via
JSONCodec.encode(JSONCodec.tsx:20-26) andPOCodec(packages/next-intl/src/extractor/format/codecs/POCodec.tsx:87) during extraction, both of which feed attacker-influencedmessage.idvalues intosetNestedProperty— but those paths require control of source-code identifiers, which is a weaker attack vector than the build-time catalog path above.After pollution, every subsequent object access during the remainder of the Next.js build pipeline (webpack, turbopack, babel, next-intl’s own logic) inherits the attacker-controlled properties. This is a classic gadget-chain precondition for corrupting build-tool internals and tampering with generated bundles, since many build tools use patterns like
if (obj.someFlag)oroptions[key] ?? defaultthat are sensitive to polluted prototypes.Trust boundary note: next-intl’s message catalogs are realistically attacker-influenced in practice. Translation files are routinely round-tripped through external TMS systems (Crowdin, Lokalise, Transifex), accepted via community locale PRs, or pulled from third-party translation packages — any of which can carry a crafted
__proto__key unnoticed, since JSON translation diffs are usually merged with minimal scrutiny.PoC
Prerequisites: a Next.js project using next-intl ≤ 4.9.1 with the Next.js plugin configured:
Drop a malicious catalog at
messages/en.json:{ "Greeting": "Hello", "__proto__": { "isAdmin": "polluted" } }Run
next build(ornext dev). ThecatalogLoaderwill invokeJSONCodec.decode→traverseMessages→precompileMessages→setNestedProperty.Minimal reproduction of the sink itself (verified locally against the v4.9.1 source):
Output:
PWNED.Full chain reproduction (also verified):
After the loader runs,
({}).isAdmin === 'polluted'for the remainder of the build Node process.Impact
Object.prototypeis polluted for the lifetime of the build‑time Node.js process, affecting every object created or inspected thereafter in the Next.js build pipeline (webpack/turbopack loaders, babel plugins, next-intl’s own codecs, user plugins).obj.someFlag,options[key] ?? default,if (!config.noX), etc. can be coerced into unintended behavior, including emitting tampered bundles.experimental.messages+precompileconfiguration. Users who do not use the extractor/precompile features are not affected.Recommended Fix
Reject reserved keys in
setNestedPropertyand stop using theinoperator for the existence check. A minimal patch topackages/next-intl/src/extractor/utils.tsx:Additionally:
packages/next-intl/src/extractor/format/codecs/JSONCodec.tsx, maketraverseMessagesskip reserved keys (or switch toObject.create(null)+Object.hasOwnsemantics) so that a malicious catalog is rejected early with a clear error rather than producing__proto__.*message ids.packages/next-intl/src/plugin/catalog/catalogLoader.tsx, initializeprecompileMessages’sresultwithObject.create(null)as defense in depth, so even if a key slipped through it could not redirect throughObject.prototype.Severity
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
amannn/next-intl (next-intl)
v4.9.2Compare Source
Bug Fixes
precompile: true(#2307) (c0bf0ee) – by @amannnv4.9.1Compare Source
Bug Fixes
v4.9.0Compare Source
Features
transitionTypesonLink(#2302) (02811f5) – by @amannnv4.8.4Compare Source
Bug Fixes
v4.8.3Compare Source
Bug Fixes
@formatjs/intl-localematcher(#2265) (196f1f3) – by @amannnv4.8.2Compare Source
Bug Fixes
next.config.ts(#2245) (f57800e) – by @amannnv4.8.1Compare Source
Bug Fixes
precompilealias on Windows (#2237) (8e7151a) – by @amannnv4.8.0Compare Source
Features
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.