Repository navigation
fix(deps): update dependency i18next-http-backend to v4 [security] - #881
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
renovate
Bot
force-pushed
the
renovate/npm-i18next-http-backend-vulnerability
branch
from
October 12, 2026 14:36
da4442e to
6c6e657
Compare
renovate
Bot
force-pushed
the
renovate/npm-i18next-http-backend-vulnerability
branch
2 times, most recently
from
October 20, 2026 11:07
94a6fb6 to
d28d0d9
Compare
renovate
Bot
force-pushed
the
renovate/npm-i18next-http-backend-vulnerability
branch
from
October 26, 2026 23:02
d28d0d9 to
0706b3c
Compare
renovate
Bot
force-pushed
the
renovate/npm-i18next-http-backend-vulnerability
branch
from
November 4, 2026 00:50
0706b3c to
a2ae3f6
Compare
renovate
Bot
force-pushed
the
renovate/npm-i18next-http-backend-vulnerability
branch
from
November 20, 2026 23:59
a2ae3f6 to
a781aeb
Compare
renovate
Bot
force-pushed
the
renovate/npm-i18next-http-backend-vulnerability
branch
from
November 25, 2026 19:06
a781aeb to
3760164
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.1.1→^4.0.0i18next-http-backend has Path Traversal & URL Injection via Unsanitised lng/ns
CVE-2026-41691 / GHSA-q89c-q3h5-w34g
More information
Details
Summary
Versions of
i18next-http-backendprior to 3.0.5 interpolate thelngandnsvalues directly into the configuredloadPath/addPathURL template without any encoding, validation, or path sanitisation. When an application exposes the language-code selection to user-controlled input (the default —i18next-browser-languagedetectorreads?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,addQueryStringalready correctly usesencodeURIComponentfor each query-string param — only the URL-path substitution was unprotected.Impact
An attacker who can influence the resolved
lngornsvalue can alter the URL in several ways:lng = '../../config'turns/locales//.jsoninto/locales/../../config/translation.json. On a misconfigured web server, this can cause the request to target a different resource than intended; in SSR pipelines that usefile://or similar schemes forloadPath, it can read arbitrary files from the host filesystem.lng = 'en?admin=true'turns/locales//.jsoninto/locales/en?admin=true/translation.json. Some server frameworks parse the query portion with higher priority than the path and branch on attacker-controlled flags.lng = 'en#anything'silently discards the rest of the path in browser fetches (client cannot see the final URL).lng = 'en%2F..', after server-side URL decoding, resolves toen/..— the attacker bypasses the absence of a literal/in their input.The practical worst case is SSRF when
loadPathis an internal or file-scheme URL, and path-based authorisation bypass against servers that segment access by URL prefix.Also fixed in 3.0.5
omitFetchOptions. A module-level boolean inlib/request.jswas flipped totruethe first time any backend instance hit a "not implemented" fetch error. Once flipped, all subsequent requests from all backend instances in the same module silently stripped every user-configured fetch option — including security-relevantcredentials,mode, andcache. One misbehaving instance (for example during SSR hydration or in React Native) permanently removed these protections process-wide. 3.0.5 scopes the flag to the backend'soptionsobject (options._omitFetchOptions) so one instance's fallback cannot pollute siblings.lng/ns. Error callbacks embedded the rawlng/ns/URL in the message string. Crafted CR/LF values could inject fake log lines into file-backed log aggregators (CWE-117). 3.0.5 strips C0/C1 control chars before concatenation.loadPathcontained auser:password@hostauthority, the full URL (including the credentials) ended up in the error message strings returned to the caller. 3.0.5 redactsuser:password@before logging.for...in.addQueryStringand the XHRcustomHeadersloop usedfor...inwhich walks the prototype chain. PollutedObject.prototypeentries could leak into URL query parameters and request headers. 3.0.5 usesObject.keysand an explicit prototype-key guard.Affected versions
All versions of
i18next-http-backendprior to 3.0.5.Patch
Fixed in 3.0.5. Summary of the hardening:
utils.interpolateUrl(used by_readAnyandcreate) returnsnullif any substitution fails the URL-segment safety check (blocks..,/,\,?,#,%,@, whitespace, control chars, prototype keys, and values > 128 chars). Multi-language joins (en+de) are validated per-segment. The call sites now refuse to issue a request when the check fails and call back with a clear error.omitFetchOptionsis stored per-instance onoptions._omitFetchOptions.for...inover untrusted objects replaced withObject.keys+ prototype-key guard.Workarounds
No workaround short of upgrading. If you cannot upgrade immediately, sanitise
lng/nsyourself before they reach i18next (strip..,/,\,?,#,%, whitespace, and control characters; cap the length).Credits
Discovered via an internal security audit of the i18next ecosystem.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
i18next-http-backend incomplete URL validation permits SSRF
CVE-2026-105800 / GHSA-xvq9-wjp8-hwqf
More information
Details
There is an SSRF vulnerability when using
i18next-http-backend. A colon in an attacker-controlled language value can make a custom path template request an unintended origin.This is reachable under the following conditions: Attacker controls i18next language or namespace input that is interpolated into loadPath.
Proof of Concept
Run:
The expected result is:
Why the Previous Patch Was Incomplete
This vulnerability is caused by an incomplete patch for CVE-2026-41691. The previous patch addressed the following behavior: Original hardening blocks path traversal and selected URL-control characters in lng/ns.
The following bypass remains in the current release: lng=http:127.0.0.1: with loadPath=/.json; colon is not blocked and produces an outbound request.
Impact
The attacker-controlled language or namespace value can redirect the backend request to an unintended origin, resulting in URL injection and possible SSRF.
Recommended Fix
Parse the final URL and require it to remain within the intended origin and path. If absolute URLs are supported, validate them against an explicit allowlist.
Please let us know if you need any additional information or clarification. We are happy to prepare a pull request if that would be helpful. Thank you for reviewing this report.
Maintainer note
Confirmed and fixed in 4.0.2 (commit i18next/i18next-http-backend@07e0288).
Preconditions. The bypass only works when the
loadPath/addPathtemplate begins directly withor— no origin and no leading/, e.g./.json. Only in that position ishttp:parsed as a URL scheme. The default/locales//.jsonand every template with a leading path or origin are not affected: a colon inside a path segment has no structural meaning there, and the resulting string is rejected as an invalid URL. The same template shape also allowed annsvalue such as//evil.example/xto become a protocol-relative URL in browsers.Fix.
:is now rejected in bothlngandnsvalues, and//innsvalues. No BCP-47 language code contains a colon, and:is i18next's default namespace separator, so no usable namespace name does either.Affected range. Versions before 3.0.5 had no validation at all and are reachable through this vector too, so the affected range is
< 4.0.2rather than>= 3.0.5, <= 4.0.1.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
i18next-http-backend: Namespace value starting with / forms a protocol-relative URL when loadPath/addPath places right after a / (bypass of the // check added for GHSA-xvq9-wjp8-hwqf)
CVE-2026-115730 / GHSA-9jhj-wvmw-cfx5
More information
Details
Affected versions
Verified on 4.0.2 (latest on npm) and on commit 07e0288 (the GHSA-xvq9-wjp8-hwqf fix). Earlier 3.x/4.x versions that allow
/in ns are likely affected too. Not verified on them.Impact
Same class as GHSA-xvq9-wjp8-hwqf and GHSA-q89c-q3h5-w34g: when an attacker controls the namespace value, the request goes to an attacker-chosen origin. In a browser this loads attacker-controlled translation JSON (content injection into the UI, and XSS where translations are rendered as HTML). The precondition is a template with `` right after a leading
/, for example `//.json`. The 4.0.2 maintainer note says templates with a leading `/` are safe. This case is outside that statement.Root cause
isSafeNsUrlSegmentrejects any ns containing//, but allows a single leading/(needed for nested namespaces likea/b). Interpolation into//...puts the template's own/next to the value's/. The result starts with//, which is a protocol-relative URL. The check runs on the value, not on the final URL.Minimal PoC
Observed on 4.0.2:
Negative controls (same run)
//evil.example: rejected ("unsafe lng/ns value").http:127.0.0.1:9(the GHSA-xvq9 payload): rejected.commonand nested nsa/b:common/en.jsonanda/b/en.json, same origin.Suggested fix
Validate the final interpolated URL, not just the values: reject it if it starts with
//or\, or if it has a scheme or host the template did not have. The advisory already recommends this ("parse the final URL and require it to remain within the intended origin and path"). Alternatively, reject an ns that starts with/.Disclosure
We intend to keep this private for 90 days from the date of the report, or until a fixed release is available, whichever comes first, and are happy to adjust if you need more time.
Re-verification
Re-run on 2026-10-14 against the same latest release. The PoC still reproduces and the negative controls still hold.
Reported by Zachariah Mithani.
Maintainer note
Confirmed and fixed in 4.0.3 (commit i18next/i18next-http-backend@042c3d4).
Preconditions. The
loadPath/addPathtemplate must putdirectly after a leading `/` (for example `//.json`), and the attacker must control the namespace value. Applications usually set namespaces in code rather than from user input. The default `/locales//.json`, templates with an origin, and templates with a fixed path segment beforeare not affected. Only browsers are affected: in Node,fetch('//host/...')fails because there is no base URL to resolve against. XSS additionally requires the application to render translations as HTML.Fix. The 4.0.2
//check looked at each value on its own and could not see the/the template puts in front of it.interpolateUrlnow also checks the interpolated URL: it may only start with//or\if the template itself does. Protocol-relative CDN templates such as//cdn.example//.jsonkeep working.Affected range. Versions before 3.0.5 had no value validation at all and are reachable through this vector too, so the affected range is
< 4.0.3.Related. i18next-fs-backend had the same class of problem for file paths (a leading
/inns, orC:inlng, changing the root of a path built from a template that starts with the placeholder). It is fixed in i18next-fs-backend 2.6.9.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
i18next-http-backend: Query-parameter injection through & and = in lng when loadPath/addPath puts in the query string
CVE-2026-118258 / GHSA-3cmx-xjww-583x
More information
Details
Summary
The URL-segment check added for GHSA-q89c-q3h5-w34g blocks
?,#,%,:,/and@inlng, but not&or=, and the checked value is inserted into the URL without encoding. The README documents a multiload loadPath of the form/locales/resources.json?lng=de+en&ns=ns1+ns2. With a template like that, an attacker who controls the language value can add or override query parameters on the request the backend sends. By default the language comes from?lng=, a cookie orAccept-Language. This is the "query-string injection" impact described in GHSA-q89c; only the?form was closed.Server side (Express + i18next-http-middleware, default options),
GET /?lng=de%26ns%3Dprivate%26admin%3Dtruemakes the application request…?lng=de&ns=private&admin=true&ns=commonfrom its own translations API.Details
The checks are in
lib/utils.js. The base check (https://github.com/i18next/i18next-http-backend/blob/v4.0.3/lib/utils.js#L26-L44) rejects:..and\;/[?#%:\s]/;isSafeLangUrlSegment(https://github.com/i18next/i18next-http-backend/blob/v4.0.3/lib/utils.js#L51-L55) adds only/and@. Neither function rejects&or=.interpolateUrlthen splits on+, checks each segment, and joins the raw segments into the template, with no encoding (https://github.com/i18next/i18next-http-backend/blob/v4.0.3/lib/utils.js#L159-L184, return at L174).Call sites:
_readAnybuilds the load URL withinterpolateUrl(resolvedLoadPath, { lng: languages.join('+'), ns: … }): https://github.com/i18next/i18next-http-backend/blob/v4.0.3/lib/index.js#L64createbuilds the missing-key URL withinterpolateUrl(addPath, { lng, ns }): https://github.com/i18next/i18next-http-backend/blob/v4.0.3/lib/index.js#L133The README documents the query-shaped URL for multiloading (https://github.com/i18next/i18next-http-backend/blob/v4.0.3/README.md?plain=1#L130). The language value is attacker-controlled in normal setups, as GHSA-q89c itself says: detectors read
?lng=, cookies,localStorageand request headers. i18next-http-middleware'sLanguageDetectordoes the same on the server.Where
?is placed in the template determines which characters are structural. The fix treated only the path position. In a query position,&and=are the separators, so they must be rejected or encoded too.Suggested fix. Reject
&and=(and;) in bothlngandns; no BCP-47 language code or usable i18next namespace contains them. Alternatively,encodeURIComponenteach+-joined segment when the placeholder appears after?in the template.Proof of concept
How to run (Node 18+; everything runs on 127.0.0.1, with a fake translations API and an Express app):
mkdir i18next-poc && cd i18next-pocnpm init -ynpm i i18next@26.5.1 i18next-http-backend@4.0.3 i18next-http-middleware@3.9.9 express@5.3.0poc.mjsnode poc.mjsOutput (i18next-http-backend 4.0.3, i18next 26.5.1, i18next-http-middleware 3.9.9, Node 22):
The
?control is refused by the existing fix. The&form passes and reaches the API with injectedns=private&admin=true.Impact
This is injection of query parameters (CWE-74, HTTP parameter pollution) into the backend's outgoing requests:
ns, version, tenant, feature flags, cache keys) using the server's network position and credentials. Depending on how that API branches on its parameters, this can expose other namespaces or tenants' resources, or change server-side behaviour.?lng=…) does the same to the victim's same-origin request.Applications using the default path template
/locales//.json, or asupportedLngsallowlist, are not affected.credit to Adrian Korwel.
Maintainer note
Confirmed and fixed in 4.0.4 (commit i18next/i18next-http-backend@b0eef9e).
Preconditions. The
loadPath/addPathtemplate must putorin the query string (for example/locales/resources.json?lng=&ns=, the multiload shape), and the attacker must control the language or namespace value. The default/locales//.jsonand other path-only templates are not affected, nor are applications that restrict languages withsupportedLngs. The impact depends on what the translations API does with the injected parameters.Fix.
&,=and;are now rejected in bothlngandnsvalues, in addition to the?,#,%and:rejected before. No language code or usable namespace name contains them.+-joined multiload values such asde+enkeep working, verified end to end with i18next-multiload-backend-adapter.Affected range. Versions before 3.0.5 had no value validation at all and are reachable through this vector too, so the affected range is
< 4.0.4.Related. i18next-locize-backend had the same gap with custom query-shaped templates (its default paths are not affected). It is fixed in i18next-locize-backend 10.0.4.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
i18next/i18next-http-backend (i18next-http-backend)
v4.0.4Compare Source
Security release. See advisory GHSA-3cmx-xjww-583x.
&,=and;inlngandnsvalues. With a query-shapedloadPath/addPathtemplate such as/locales/resources.json?lng={{lng}}&ns={{ns}}(the multiload shape the README documents), a value likede&ns=private&admin=trueadded or overrode query parameters on the request (HTTP parameter pollution). The 3.0.5 fix only rejected?, which covers the path position. The default/locales/{{lng}}/{{ns}}.jsonand other path-only templates were not affected. No language code or usable namespace name contains these characters, and+-joined multiload values such asde+enkeep working.v4.0.3Compare Source
Security release. See advisory GHSA-9jhj-wvmw-cfx5.
//(or\) when theloadPath/addPathtemplate does not. With a template that puts{{ns}}directly after a leading/(e.g./{{ns}}/{{lng}}.json), annsvalue of/evil.examplepassed the per-value checks, because a single/is allowed for nested namespaces, but it joined the template's own/into//evil.example/en.json, a protocol-relative URL that browsers send to another origin. The 4.0.2//check looked at the value only, so it missed this. The interpolated URL is now checked as a whole. The default/locales/{{lng}}/{{ns}}.json, templates with an origin, and protocol-relative CDN templates such as//cdn.example/{{lng}}/{{ns}}.jsonare not affected and keep working.v4.0.2Compare Source
Security release. See advisory GHSA-xvq9-wjp8-hwqf.
:inlngandnsvalues, and//innsvalues. With aloadPath/addPathtemplate that starts with the placeholder (e.g.{{lng}}/{{ns}}.json— no origin and no leading/), a value such ashttp:127.0.0.1:8080was interpolated into an absolute URL and the request left the intended origin (SSRF / URL injection). The default/locales/{{lng}}/{{ns}}.jsonand every template with a leading path or origin were not affected, because a colon inside a path segment has no structural meaning there. No BCP-47 language code contains:, and:is i18next's defaultnsSeparator, so no usable namespace name does either — the tightened check has no legitimate collateral.v4.0.1Compare Source
Security release. See advisory GHSA-qh2f-jh77-hfwf.
loadPath/addPathtemplate gives when thelngandnsvalues are plain data. With a template that puts{{ns}}in the host, e.g.https://{{ns}}.cdn.example.com/{{lng}}.json, annsvalue of@evil.example/x(@ends the userinfo, since 4.0.1) orevil.example/x(/ends the host, since 3.0.6) sent the request, with itscustomHeaders, toevil.example./and@stay allowed innsfor nested and scoped namespaces such as@org/pkg, and they keep working in the path. The check runs forreadandcreate, and forloadPath/addPathfunctions that return a template. It includes the 4.0.3 check for a leading//, which it replaces. The default/locales/{{lng}}/{{ns}}.jsonand other templates with the placeholders in the path were not affected. A value in the host may now only contain letters, digits and-._~!*'().v4.0.0Compare Source
cross-fetchdependency.i18next-http-backendnow requires a host-providedfetch. This is available in Node ≥ 18 (stable since Node 21), all modern browsers, Deno, and Bun. For runtimes without nativefetch, install a ponyfill yourself and inject it viaoptions.alternateFetch, or stay on v3.x.engines.node = ">=18").lib/request.js— usesglobalThis(withglobal/windowfallbacks for legacy embedded runtimes) instead of separateglobal.*/window.*branches per API. XHR / ActiveXObject are still picked up if the host provides them, but no longer polyfilled."sideEffects": falsefor better tree-shaking by downstream bundlers.tsdown(rolldown + oxc). One config produces ESM, CJS, and the IIFE browser bundles. Drops@babel/cli,@babel/core,@babel/preset-env,babel-plugin-add-module-exports,browserify,uglify-js, thefixcjsrewrite hack, and the--ignore cross-fetchbrowserify flag. Side benefit: minified browser bundle shrinks from ~13 KB to ~6.8 KB (oxc minifier + no babel runtime helpers).index.jsper format (previously one file perlib/*.jsmodule). The package'sexportsmap is unchanged, so this is invisible to consumers using documented entry points.eslint-config-standard(+ five plugins) withneostandardand migrated to ESLint 9 flat config (eslint.config.mjs). Removed deprecatedtslintanddtslint—test:typescriptnow runstsc --noEmitplustsd..npmignore— published tarball no longer includes the sourcelib/, the build configs (tsdown.config.ts,eslint.config.mjs,tsconfig.json), or the rootindex.jsre-export shim. Drops from 21.3 KB → ~17 KB packed.alternateFetchis now documented in the README options block as the supported escape hatch for fetch ponyfills, test mocking, and request interception. v4 migration note added to "Getting started".v3.0.6Compare Source
nsvalues so nested namespace names (mapping to URL layouts such as/locales/en/a/b.json) fetch correctly again. 3.0.5's security fix applied the same strict URL-segment check to bothlngandns, which was correct forlng(no BCP-47 shape contains/) but over-strict forns— nested namespaces containing/were never officially supported, but the behaviour fell out of the implicit string-substitution semantics ofloadPathand is common enough in the wild to be worth accommodating.isSafeUrlSegmentis now split intoisSafeLangUrlSegment(strict — still rejects/) andisSafeNsUrlSegment(loose — allows/but still rejects..,\, URL-structure characters, control chars, prototype keys, and oversized inputs).isSafeUrlSegmentis kept as a backwards-compatible alias for the strict check. The 3.0.5 security fix remains in force for every concrete attack pattern from the original advisory.v3.0.5Compare Source
Security release — all issues found via an internal audit. See published advisory GHSA-q89c-q3h5-w34g.
lngornsvalues contain path-traversal, URL-structure (?,#,%,@, whitespace), path separators, control characters, prototype keys, or exceed 128 chars. Prevents path traversal / SSRF / URL injection via attacker-controlled language-code values.isSafeUrlSegmentis permissive for legitimate i18next language codes (any BCP-47-like shape, underscores, hyphens, dots,+-joined multi-language requests) (GHSA-q89c-q3h5-w34g)omitFetchOptions— the fetch-options-stripping fallback is now scoped to a single backend instance viaoptions._omitFetchOptionsinstead of a module-level boolean. One instance hitting a "not implemented" fetch error no longer permanently stripsrequestOptions(includingcredentials,mode,cache) from every other backend instance in the same processlng/ns/ URL values before they appear in error-callback strings (CWE-117 log forging)user:passwordcredentials from URLs before including them in error-callback strings — prevents leaking basic-auth credentials embedded inloadPath/addPathObject.keys+ prototype-key guard) inaddQueryStringand in thecustomHeadersloop in XHR mode — prevents prototype-pollution amplification into the URL and request headers.env*and*.pem/*.keyfiles in.gitignorev3.0.4Compare Source
{{lng}}and{{ns}}placeholders are supported; custom interpolation prefix/suffix from i18next config no longer applies to backend pathsv3.0.2Compare Source
v3.0.1Compare Source
v3.0.0Compare Source
i18next-http-backend/cjsexport or stay at v2.6.2 or v2.7.1v2.7.3Compare Source
v2.7.2Compare Source
v2.7.1Compare Source
v2.7.0Compare Source
v2.6.2Compare Source
v2.6.1Compare Source
v2.6.0Compare Source
v2.5.2Compare Source
v2.5.1Compare Source
v2.5.0Compare Source
v2.4.3Compare Source
v2.4.2Compare Source
v2.4.1Compare Source
v2.4.0Compare Source
v2.3.1Compare Source
v2.3.0Compare Source
v2.2.2Compare Source
v2.2.1Compare Source
v2.2.0Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.