Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. i18next-fs-backend
  4. ›
  5. GHSA-8847-338w-5hcj

GHSA-8847-338w-5hcj: i18next-fs-backend: Path traversal via unsanitised lng/ns allows arbitrary file read/overwrite

April 22, 2026

Versions of i18next-fs-backend prior to 2.6.4 interpolate the caller-supplied lng and ns values directly into the configured loadPath and addPath templates with no path-component validation and no sanitisation. When an application exposes the resolved language code to user-controlled input (?lng= query parameter, cookie, request header), a crafted value can break out of the intended locale directory.

Affected call sites in lib/index.js:

  • read (line 38 pre-patch): const filename = interpolate(loadPath, { lng: language, ns: namespace })
  • removeFile (line 101 pre-patch): same pattern against addPath
  • writeFile (line 127 pre-patch): same pattern against addPath for queued missing-key writes

The helper interpolate in lib/utils.js substitutes raw values with no encoding — unlike the addQueryString helper in i18next-http-backend, there is no equivalent safety for path interpolation.

References

  • github.com/advisories/GHSA-8847-338w-5hcj
  • github.com/i18next/i18next-fs-backend
  • github.com/i18next/i18next-fs-backend/security/advisories/GHSA-8847-338w-5hcj

Code Behaviors & Features

Detect and mitigate GHSA-8847-338w-5hcj with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.6.4

Fixed versions

  • 2.6.4

Solution

Upgrade to version 2.6.4 or above.

Impact 8.2 HIGH

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

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-73: External Control of File Name or Path

Source file

npm/i18next-fs-backend/GHSA-8847-338w-5hcj.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 09 May 2026 12:19:30 +0000.