Skip to content

Prototype pollution in i18next-http-middleware via user-controlled language and namespace parameters

High
adrai published GHSA-5fgg-jcpf-8jjw Apr 18, 2026

Package

npm i18next-http-middleware (npm)

Affected versions

< 3.9.3

Patched versions

3.9.3

Description

Summary

Versions of i18next-http-middleware prior to 3.9.3 allow an unauthenticated HTTP client to pollute Object.prototype in the Node.js process hosting the middleware, via two unvalidated entry points that reach internal object-key writes:

  • getResourcesHandler — reads lng / ns from query parameters or route params and passes them to utils.setPath(resources, [lng, ns], value). The setPath helper walked the key path without guarding against __proto__, constructor, or prototype keys, so a request like GET /locales/resources.json?lng=__proto__&ns=isAdmin wrote into Object.prototype.
  • missingKeyHandler — iterated the incoming request body with for...in, which traverses inherited prototype-chain properties. A POST body of the shape {"__proto__": {"isAdmin": true}} was forwarded into i18next.services.backendConnector.saveMissing.

Impact

After a single unauthenticated request of the form GET /locales/resources.json?lng=__proto__&ns=isAdmin, every {} created subsequently in the Node.js process inherits a polluted isAdmin property. This can:

  • Break authorisation checks (if (user.isAdmin) returning true for any user).
  • Cause denial of service via type confusion in downstream code reading unexpected prototype-chain properties.
  • Be chained into RCE depending on what downstream code reads from polluted objects.

The missingKeyHandler path has the same impact via a different attacker-controlled input (JSON request body instead of query string).

Affected versions

< 3.9.3.

Patch

Fixed in 3.9.3. The patch:

  1. Blocks __proto__, constructor, and prototype keys in utils.setPath — both at intermediate path segments (which previously created child objects under Object.prototype) and at the terminal assignment.
  2. Replaces the for...in body iteration in missingKeyHandler with Object.keys() plus an explicit dangerous-keys guard, so request-body keys that walk the prototype chain are no longer forwarded.

Workarounds

No workaround short of upgrading. Front-proxying the middleware with a WAF rule that rejects requests containing __proto__, constructor, or prototype in lng / ns query parameters or body keys is a partial mitigation.

Related advisories fixed in the same release

  • GHSA-c3h8-g69v-pjrg — HTTP response splitting + XSS-filter bypass (CVE-2026-41683). Same release.
  • A separate advisory for path traversal / SSRF via lng / ns in getResourcesHandler reaching the configured backend connector is filed alongside this one — split out per CNA rules because it is an independently fixable vulnerability with its own attack shape.

Credits

Discovered via an internal security audit of the i18next ecosystem.

References

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L

CVE ID

CVE-2026-41690

Weaknesses

Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. Learn more on MITRE.