Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. i18next-http-backend
  4. ›
  5. GHSA-q89c-q3h5-w34g

GHSA-q89c-q3h5-w34g: i18next-http-backend has Path Traversal & URL Injection via Unsanitised lng/ns

April 22, 2026

Versions of i18next-http-backend prior to 3.0.5 interpolate the lng and ns values directly into the configured loadPath / addPath URL template without any encoding, validation, or path sanitisation. When an application exposes the language-code selection to user-controlled input (the default — i18next-browser-languagedetector reads ?lng= query params, cookies, localStorage, and request headers), an attacker can inject characters that change the structure of the outgoing request URL.

Affected call sites:

  • _readAny — lib/index.js:64: interpolate(resolvedLoadPath, { lng: languages.join('+'), ns: namespaces.join('+') })
  • create — lib/index.js:123 (pre-patch): interpolate(addPath, { lng, ns: namespace })

The helper interpolate (lib/utils.js) previously returned the raw value with no encoding. In contrast, addQueryString already correctly uses encodeURIComponent for each query-string param — only the URL-path substitution was unprotected.

References

  • github.com/advisories/GHSA-q89c-q3h5-w34g
  • github.com/i18next/i18next-http-backend
  • github.com/i18next/i18next-http-backend/security/advisories/GHSA-q89c-q3h5-w34g

Code Behaviors & Features

Detect and mitigate GHSA-q89c-q3h5-w34g with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.0.5

Fixed versions

  • 3.0.5

Solution

Upgrade to version 3.0.5 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Source file

npm/i18next-http-backend/GHSA-q89c-q3h5-w34g.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:51 +0000.