{"id":"CVE-2026-41692","aliases":["CVE-2026-41692","GHSA-6457-mxpq-4fqq"],"related":[],"kind":"vulnerability","state":"published","title":"i18nextify is vulnerable to DOM XSS via javascript:/data: URL schemes in translated href/src attributes","summary":"i18nextify is a JavaScript library that adds website internationalization via a script tag, without source code changes. Versions prior to 4.0.8 substitute {{key}} interpolation tokens inside src and href attribute values with the raw string returned by i18next.t(). The substitution logic in src/localize.js (the replaceInside handler) only guards against a duplicated http:// origin prefix — it does not validate the URL scheme of the substituted value. A translated value such as javascript:alert(1) or data:text/html,<script>...</script> is applied unchanged to the live DOM attribute when an attacker can influence the content of a translation file or the translation-backend response — for example, via a compromised translation CDN, user-contributed locales, a MITM on a plain-HTTP backend, or write access to the translation JSON. This issue was patched in version 4.0.8.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"i18nextify is a JavaScript library that adds website internationalization via a script tag, without source code changes. Versions prior to 4.0.8 substitute {{key}} interpolation tokens inside src and href attribute values with the raw string returned by i18next.t(). The substitution logic in src/localize.js (the replaceInside handler) only guards against a duplicated http:// origin prefix — it does not validate the URL scheme of the substituted value. A translated value such as javascript:alert(1) or data:text/html,<script>...</script> is applied unchanged to the live DOM attribute when an attacker can influence the content of a translation file or the translation-backend response — for example, via a compromised translation CDN, user-contributed locales, a MITM on a plain-HTTP backend, or write access to the translation JSON. This issue was patched in version 4.0.8.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nVersions of `i18nextify` prior to 4.0.8 substitute `{{key}}` interpolation tokens inside `src` and `href` attribute values with the raw string returned by `i18next.t()`. The substitution logic in `src/localize.js` (`replaceInside` handler around line 122) only guards against a duplicated `http://` origin prefix — it does not validate the URL scheme of the substituted value. A translated value such as `javascript:alert(1)` or `data:text/html,<script>...</script>` is applied unchanged to the live DOM attribute.\n\n### Impact\n\nWhen an attacker can influence the content of a translation file or the translation-backend response — compromised translation CDN, user-contributed locales, MITM on a plain-HTTP backend, write access to the translation JSON — they can:\n\n- Set any `href` on an anchor to a `javascript:` URI, executing arbitrary JavaScript when the victim clicks the link.\n- Set any `src` on `<iframe>`, `<object>`, or `<embed>` to a `data:text/html` URI containing a full script payload that runs in the page's origin.\n- Use `vbscript:` on legacy IE installations or `file:` for local-resource navigation attacks.\n\nThis path is distinct from the general i18nextify design that intentionally renders HTML from translations — href/src schemes are narrow and attack-specific, and no legitimate translation needs `javascript:` or `data:`. The fix therefore blocks these schemes outright without changing other behaviour.\n\n### Also fixed in 4.0.8\n\n- **`debug` / `saveMissing` URL-parameter substring match.** The previous detection `window.location.search.indexOf('debug=true') > -1` matched the substring anywhere in the query string. A URL like `?nosaveMissing=true` silently enabled `saveMissing` mode, causing the victim's browser to POST every unknown translation key to the configured `addPath` — a form of CSRF-style abuse of missing-key reporting. `?track_debug=true` enabled verbose debug logging, leaking i18next internals to the console. Now uses `URLSearchParams` for exact parameter matching.\n- **Optional `sanitize(html, ctx)` hook.** The library's core purpose is to render HTML from translations — a behaviour that is safe only when the translation source is fully trusted. Applications with partially-trusted sources (user-contributed locales, third-party CDN, MITM-exposed HTTP backend) can now wire a sanitizer (e.g. DOMPurify) via `i18next.options.sanitize`. Defaults to pass-through to preserve existing behaviour for the main use case.\n\n### Affected versions\n\nAll versions of `i18nextify` prior to **4.0.8**.\n\n### Patch\n\nFixed in **4.0.8**. The URL-scheme blocklist is `^\\s*(javascript|data|vbscript|file)\\s*:` (case-insensitive) applied to each translated value before it is joined back into the `href`/`src` attribute. Values matching the blocklist are replaced with an empty string so the attribute becomes harmless rather than leaving the attacker's URL in place.\n\n### Workarounds\n\nNo workaround short of upgrading. If you cannot upgrade immediately, audit every translation file for `javascript:`, `data:`, `vbscript:`, and `file:` prefixes in any value that may reach an `href`/`src` position, and restrict translation-file write access to trusted operators. Serving translations over HTTPS and pinning the translation backend to an internal origin reduce the MITM surface.\n\n### Credits\n\nDiscovered via an internal security audit of the i18next ecosystem.","format":"markdown","source":"ghsa"},{"lang":"es","text":"i18nextify es una biblioteca JavaScript que añade internacionalización a sitios web mediante una etiqueta script, sin cambios en el código fuente. Las versiones anteriores a la 4.0.8 sustituyen los tokens de interpolación {{key}} dentro de los valores de los atributos src y href con la cadena sin procesar devuelta por i18next.t(). La lógica de sustitución en src/localize.js (el gestor replaceInside) solo se protege contra un prefijo de origen http:// duplicado - no valida el esquema de URL del valor sustituido. Un valor traducido como javascript_disabled: alert(1) o javascript_disabled: ,[script_tag]...[/script] se aplica sin cambios al atributo DOM activo cuando un atacante puede influir en el contenido de un archivo de traducción o en la respuesta del backend de traducción - por ejemplo, a través de una CDN de traducción comprometida, configuraciones regionales aportadas por usuarios, un MitM en un backend HTTP sin cifrar, o acceso de escritura al JSON de traducción. Este problema fue parcheado en la versión 4.0.8.","source":"nvd"}],"published":"2026-04-22T17:42:24.000Z","modified":"2026-10-26T20:10:00.160Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-94"],"affected":[{"ranges":[{"version":"< 4.0.8","status":"affected"}],"vendor":"i18next","product":"i18nextify","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.0.8"}],"ecosystem":"npm","package":"i18nextify","purl":"pkg:npm/i18nextify","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.0.8"}],"vendor":"i18next","product":"i18nextify","cpe":"cpe:2.3:a:i18next:i18nextify:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/i18next/i18nextify/security/advisories/GHSA-6457-mxpq-4fqq","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/i18next/i18nextify/commit/16f23dbcdcf893673587f7a03355bf7ce0a0e49e","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41692","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/i18next/i18nextify","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-05-11T18:03:40.834Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41692","url":"https://www.cve.org/CVERecord?id=CVE-2026-41692","licence":"CVE Terms of Use","modified":"2026-05-11T18:04:43.650Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6457-mxpq-4fqq","url":"https://github.com/advisories/GHSA-6457-mxpq-4fqq","licence":"CC-BY-4.0","modified":"2026-05-11T13:53:13.645Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41692","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41692","licence":"Public domain","modified":"2026-10-26T20:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:20.925Z","epss":{"score":0.00144,"percentile":0.03908,"date":"2026-12-01T12:00:22.000Z"}}