/

CVE-2026-41690

Severity:

HIGH RISK

(8.6)

Prototype Pollution in 18next-http-middleware

CVE-2026-41690

Deferred

Vulnerability type

Category:

Prototype Pollution

CWE:

CWE-22, CWE-1321

Impact:

Authorization Bypass and Potential Remote Code Execution

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

18next-http-middleware versions before 3.9.3 contain a prototype pollution vulnerability where unauthenticated HTTP requests can modify Object.prototype in the hosting Node.js process.

By abusing unvalidated keys in internal handlers, an attacker may bypass authorization checks, trigger type confusion and denial of service, or, in some downstream contexts, escalate to remote code execution.

Affected context

This vulnerability affects applications that integrate 18next-http-middleware with Node.js web frameworks such as Express or Fastify, and comparable setups in Deno.

It manifests when middleware handlers like getResourcesHandler and missingKeyHandler process user-controlled input and use it directly as object keys in merge or assignment operations without validation.

Any deployment where untrusted HTTP clients can interact with these endpoints, and where polluted prototype fields influence authorization logic or object creation, is exposed to risk.

Exploit preconditions

  • Attack surface: Public or internal HTTP endpoints handled by 18next-http-middleware.
  • Required access: Network access sufficient to send crafted HTTP requests; no prior authentication is required if the middleware is exposed before auth.
  • Trigger point: Invocation of getResourcesHandler or missingKeyHandler with attacker-controlled parameters that flow into internal object-key writes.
  • Why exploitation is possible: User-controlled keys are written into plain JavaScript objects without restricting dangerous property names, allowing modifications to Object.prototype and subsequent influence over many objects in the process.

Why this happens

The root cause is improper isolation of untrusted input from core language prototypes, a classic prototype pollution issue.

In JavaScript, writing attacker-controlled keys onto plain objects (e.g., via obj[key] = value, shallow merges, or deep assignment utilities) without filtering special property names can reach Object.prototype and mutate it globally.

This behavior maps to CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), and is sometimes enabled by inadequate input validation patterns often discussed alongside CWE-22 when user-provided keys overlap with path or key names.

Once polluted, downstream authorization checks, type assumptions, and object creations may behave unpredictably or insecurely.

Potential impact

  • Authorization checks may be bypassed, such as conditions like if (user.isAdmin) evaluating to true for any user.
  • Application logic may experience type confusion, leading to crashes or denial of service.
  • Global objects and libraries may behave incorrectly, causing subtle data integrity issues and business logic flaws.
  • Under certain downstream coding patterns, prototype pollution can be chained into arbitrary code execution.
  • Security logging, auditing, or rate-limiting mechanisms may be subverted or rendered unreliable.

General mitigation guidance

Effective mitigation focuses on preventing untrusted input from influencing object prototypes and core language structures.

Recommended defensive patterns include:

  • Key whitelisting / allow-listing: Only accept a predefined set of safe object keys from HTTP parameters, rejecting or ignoring all others.
  • Prototype-safe data structures: Use objects that do not inherit from Object.prototype (e.g., Object.create(null) or Maps) for data influenced by user input.
  • Dangerous key filtering: Explicitly block keys such as __proto__, constructor, prototype, and similar meta-properties before any merge or assignment.
  • Layered authorization checks: Implement authorization logic using robust, non-coercible primitives and avoid relying solely on dynamic object properties that can be inherited.
  • Principle of least privilege: Run application processes with minimal OS-level and service-level privileges so that any impact from polluted prototypes is constrained.

How teams detect issues like this

Prototype pollution weaknesses can be identified through a mix of code-centric and behavior-centric strategies:

  • Static analysis:
  • Search for deep merge or assignment utilities that accept user-controllable keys.
  • Flag patterns where request parameters or query/body keys are spread into objects, especially configuration or user objects, without validation.
  • Detect use of plain objects as sinks for untrusted key/value pairs without prototype-safe construction.
  • Code review signals:
  • Middleware handlers that map request parameters directly into configuration or options objects.
  • Authorization checks based on properties that can be inherited from prototypes (e.g., user.role, user.isAdmin) without sealing or freezing objects.
  • Lack of centralized input-validation for keys and object structures.
  • Runtime and testing approaches:
  • Security tests that send payloads targeting __proto__, constructor, and prototype keys, then observe changes in unrelated request handling.
  • Instrumentation or hooks that detect unexpected additions to Object.prototype or other core prototypes.
  • Automated tooling:
  • Use of JavaScript/TypeScript security linters and SAST tools configured with rules for prototype pollution patterns.

Sources

SourceLink
github.comgithub.com/i18next/i18next-http-middleware/security/advisories/GHSA-5fgg-jcpf-8jjw

Frequently asked

questions

The vulnerability is broadly exploitable wherever 18next-http-middleware is exposed to untrusted HTTP clients, because crafted requests can reach the vulnerable handlers and influence global application behavior through prototype pollution.

Not necessarily. If the middleware is reachable before authentication or on public endpoints, an unauthenticated attacker can attempt exploitation. If the handlers are only reachable behind authentication, then valid credentials or an upstream compromise would be required.

The safest pattern is to prevent user-controlled keys from ever reaching prototypes by combining key allow-lists, explicit filtering of dangerous property names, and the use of prototype-free data structures for untrusted input, alongside hardening of authorization checks so they do not rely on mutable, inherited properties.

Future prevention involves adopting secure coding guidelines for JavaScript object handling, enforcing input validation on both values and keys, using prototype-safe containers for user data, adding static analysis rules for prototype pollution patterns, and incorporating security-focused code review practices into the development lifecycle.

Find out what's already
exploitable in your codebase.