Skip to content

i18next-locize-backend has URL Injection via Unsanitized Path Parameters

Moderate severity GitHub Reviewed Published Apr 18, 2026 in locize/i18next-locize-backend • Updated May 13, 2026

Package

npm i18next-locize-backend (npm)

Affected versions

< 9.0.2

Patched versions

9.0.2

Description

Summary

Versions of i18next-locize-backend prior to 9.0.2 interpolate lng, ns, projectId, and version directly into the configured loadPath / privatePath / addPath / updatePath / getLanguagesPath URL templates with no path-component validation and no encoding. When an application exposes any of these values to user-controlled input (?lng= / ?ns= query parameters via i18next-browser-languagedetector, cookies, request headers, or a URL-derived projectId), a crafted value can change the structure of the outgoing request URL.

Affected call sites in lib/index.js (pre-patch): the interpolate() helper is used at the five URL-build sites — _readAny/read (line 415 for private, 426 for public), getLanguages (lines 271 and 296), and writePage (lines 616 and 622) for the missing-key and update POST paths. The helper interpolate in lib/utils.js substitutes raw values with no encoding.

Impact

An attacker who can influence lng, ns, projectId, or version can:

  • Path traversallng = '../../admin' against https://api.locize.app/{{projectId}}/{{version}}/{{lng}}/{{ns}} changes the request URL path segment that reaches the locize CDN / API.
  • Query-string injectionlng = 'en?x=y' appends an attacker-chosen query to the URL.
  • Fragment truncationlng = 'en#x' silently truncates the path in browser fetches.
  • URL-encoded bypasslng = 'en%2F..' leverages server-side decoding to reintroduce /...

The worst-case concrete impact is loading an unintended translation resource (potentially causing wrong content to render) and, when a custom loadPath is configured against an internal / file-scheme URL, SSRF or arbitrary-file read on the host running the backend.

Additionally, the pre-patch interpolate() function read data[key] without excluding prototype-chain properties — under prototype-pollution conditions in the same process, that path could pull values from Object.prototype into the URL.

Related fixes shipped in 9.0.2

  • The defaults() helper replaces for...in iteration with Object.keys() plus an explicit prototype-key guard so a polluted Object.prototype cannot leak into the merged options object.
  • New utils.interpolateUrl / isSafeUrlSegment / sanitizeLogValue / redactUrlCredentials helpers mirror the pattern shipped in i18next-http-backend@3.0.5 (see its advisory GHSA-q89c-q3h5-w34g).

Affected versions

All versions of i18next-locize-backend prior to 9.0.2.

Patch

Fixed in 9.0.2. lib/index.js now uses interpolateUrl() at every URL-build site and returns an error callback (or silently drops the queued write for writePage) when any interpolated value fails the safety check. Legitimate i18next language-code shapes (BCP-47, en_US, zh-Hant-HK, my-custom.ns, +-joined multi-language values) all pass.

Workarounds

No workaround short of upgrading. If you cannot upgrade immediately, sanitise lng / ns / projectId / version at your application boundary before passing them through to i18next — reject values containing .., /, \, ?, #, %, whitespace, control characters, and cap the length.

Credits

Discovered via an internal security audit of the i18next / locize ecosystem.

References

References

@adrai adrai published to locize/i18next-locize-backend Apr 18, 2026
Published to the GitHub Advisory Database Apr 22, 2026
Reviewed Apr 22, 2026
Published by the National Vulnerability Database May 8, 2026
Last updated May 13, 2026

Severity

Moderate

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
Low
Availability
None

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:L/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(13th percentile)

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. Learn more on MITRE.

CVE ID

CVE-2026-41885

GHSA ID

GHSA-mgcp-mfp8-3q45
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.