Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-jfgf-83c5-2c4m
No affected components available
Summary
Versions of i18next-http-middleware prior to 3.9.3 pass the user-controlled lng and ns values from getResourcesHandler directly into i18next.services.backendConnector.load(languages, namespaces, …) without any sanitisation. Depending on which backend is configured, the unvalidated path segments enable one of two attacks:
- Filesystem path traversal when the middleware is paired with
i18next-fs-backend(or any backend that interpolateslng/nsinto a filesystem path). - Server-Side Request Forgery (SSRF) when the middleware is paired with
i18next-http-backend(or any backend that interpolates into an HTTP URL).
Example request:
GET /locales/resources.json?lng=../../etc/passwd&ns=root
with i18next-fs-backend reads the attacker-chosen file from disk; with i18next-http-backend reshapes the outgoing URL to target an internal service.
Impact
- Arbitrary file read via
fs-style backends — any file the Node process can read becomes reachable (source, configuration,.sshkeys,.env, Docker secrets, etc.). - SSRF via
http-style backends — requests to internal IPs / hostnames not normally reachable from the internet; combined with cloud metadata endpoints this can escalate to credential theft. - Unbounded growth of
i18next.options.ns— a now-incidental amplification: the pre-patchgetResourcesHandlerpushed every uniquensvalue into the sharedi18next.options.nssingleton array without validation or bounds, enabling memory exhaustion from repeated unique payloads.
The severity is bounded by the backend in place, but the middleware itself exposed the unsanitised path; this is the "weakest link" layer.
Affected versions
< 3.9.3.
Patch
Fixed in 3.9.3. The patch introduces utils.isSafeIdentifier and applies it in getResourcesHandler before lng and ns reach the backend connector:
languages = languages.filter(utils.isSafeIdentifier)
namespaces = namespaces.filter(utils.isSafeIdentifier)
isSafeIdentifier uses a denylist approach — it still accepts any legitimate i18next language-code shape (i18next FAQ) — rejecting:
..sequences (relative path traversal)- path separators (
/,\) - control characters (C0/C1)
- prototype keys (
__proto__/constructor/prototype) - empty strings and values longer than 128 characters
Unsafe values are dropped; only safe values reach the backend. The fix is a defence-in-depth layer on top of any sanitisation the backend itself may apply.
Workarounds
No workaround short of upgrading. Front-proxying the middleware with a WAF rule that rejects requests containing .., /, \, or URL-structure characters in lng / ns is a partial mitigation. Upgrading the configured backend (i18next-fs-backend ≥ 2.6.4, i18next-http-backend ≥ 3.0.5) also closes the same attack at the next layer.
Related advisories fixed in the same release
- GHSA-5fgg-jcpf-8jjw — prototype pollution via
setPathandmissingKeyHandler. Independently fixable, filed separately per CNA rules. - GHSA-c3h8-g69v-pjrg — HTTP response splitting + XSS-filter bypass (CVE-2026-41683).
Credits
Discovered via an internal security audit of the i18next ecosystem.
Resources
- CWE-22: Path Traversal
- CWE-918: Server-Side Request Forgery (SSRF) (specific sub-case when paired with an HTTP backend)
- i18next FAQ: language code formatting
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability. The impact is confined to the system where the vulnerability exists. There is a high impact on the confidentiality of the information. There is a low impact on the integrity of the data.
Exploitation activity has been observed. Apply available patches or mitigations urgently.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard