Repository navigation
Update dependency i18next-http-backend to v4.0.4 [SECURITY] (master) - #10249
Merged
renovate[bot] merged 1 commit intoOct 29, 2026
Merged
Conversation
renovate
Bot
deleted the
renovate/master-npm-i18next-http-backend-vulnerability
branch
October 29, 2026 02:17
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:
4.0.2→4.0.4Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
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 OSV and 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 OSV and 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.Configuration
📅 Schedule: (in timezone Europe/Zurich)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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.