PT-2026-36654 · Npm · I18Next-Http-Middleware
Published
2026-04-22
·
Updated
2026-04-22
CVSS v3.1
8.6
High
| Vector | AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L |
Summary
Versions of
i18next-http-middleware prior to 3.9.3 pass user-controlled lng and ns parameters to two internal paths that use them in ways that enable prototype pollution and, depending on the configured backend, path traversal or SSRF.The vulnerable entry points are unauthenticated HTTP handlers that are part of the middleware's public API:
getResourcesHandler— readslng/nsfrom query parameters or route params and passes them unvalidated to:utils.setPath(resources, [lng, ns], ...)— thesetPathhelper did not guard againstproto,constructor, orprototypekeys, writing intoObject.prototypewhen those values were supplied.i18next.services.backendConnector.load(languages, namespaces, ...)— depending on the configured backend, unvalidated path segments enabled filesystem path traversal (e.g. withi18next-fs-backend) or SSRF (e.g. withi18next-http-backend).- A
namespaces.forEach(ns => i18next.options.ns.push(ns))loop additionally performed permanent, unbounded growth of the shared singleton namespace list. missingKeyHandler— iterated the incoming request body withfor...in, which traverses inherited prototype-chain properties. A POST body like{" proto ": {"isAdmin": true}}was forwarded intosaveMissing.
Impact
- Prototype pollution — a single unauthenticated request of the form
GET /locales/resources.json?lng= proto &ns=isAdminwrites intoObject.prototype, affecting every plain object created subsequently in the Node.js process. This can break authorization checks (if (user.isAdmin)), cause denial of service via type confusion, or be chained into RCE depending on what downstream code reads from polluted objects. - Path traversal / SSRF — with filesystem or HTTP backends that interpolate
lng/nsinto paths or URLs, attacker-controlled values likens=../../etc/passwdorlng=internal-servicecould reach resources outside the intended scope. - Denial of service — the unbounded
i18next.options.nsgrowth, plus repeated backend load calls, enabled memory and CPU exhaustion from unique namespace payloads.
Affected versions
< 3.9.3.Patch
Fixed in 3.9.3. The patch:
- Blocks
proto,constructor, andprototypekeys inutils.setPath. - Replaces the
for...inbody iteration inmissingKeyHandlerwithObject.keys()plus an explicit dangerous-keys guard. - Introduces a
utils.isSafeIdentifierhelper (denylist approach — still permits any legitimate i18next language code shape) that filterslng/nsvalues for path-traversal, path separators, control characters, prototype keys, and over-long inputs before they reach the backend connector and before they are pushed intoi18next.options.ns.
Workarounds
No workaround short of upgrading. Front-proxying the middleware with a WAF rule that rejects requests containing
proto, constructor, prototype, .., or control characters in lng/ns query parameters or body keys is a partial mitigation.Credits
Discovered via an internal security audit of the i18next ecosystem.
Fix
Prototype Pollution
Path traversal
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
I18Next-Http-Middleware