Skip to content

fix(deps): updated i18next-http-backend to 4.0.2 - #41

Merged
karlspace merged 1 commit into
mainfrom
fix/i18next-http-backend-4.0.2
Oct 11, 2026
Merged

karlspace merged 1 commit into
mainfrom
fix/i18next-http-backend-4.0.2

Conversation

@karlspace

Copy link
Copy Markdown
Contributor

Why

Dependabot alert #65 (GHSA-xvq9-wjp8-hwqf, low): i18next-http-backend < 4.0.2 does not reject : in lng/ns values, so a loadPath template that starts with a placeholder can be turned into an absolute URL (SSRF / URL injection). It is a direct runtime dependency.

The only patched release is 4.0.2. The 3.x line ends at 3.0.6, so the existing ^3.0.6 range can never resolve to a fixed version - an in-range lockfile update is not possible and a direct major update is required. No overrides are used.

Note: this app's loadPath is ${import.meta.env.BASE_URL}locales/{{lng}}/...json (leading path), which the advisory lists as not affected - so this is hygiene that clears the alert rather than an active exploit fix.

What

  • i18next-http-backend: ^3.0.6 -> ^4.0.2 (package.json + package-lock.json)
  • Lockfile drops cross-fetch and the node-fetch subtree (node-fetch, whatwg-url, tr46, webidl-conversions) that only 3.x pulled in
  • No source changes

Proof it does not break

4.0 changelog breaking changes checked against how the app uses the backend (src/i18n.ts):

4.0 breaking change Impact here
cross-fetch dropped, host fetch required None - the backend only runs in the browser (Vite SPA/PWA); all supported browsers have native fetch
Node >= 18 None - .nvmrc, CI and the Dockerfile use Node 24
Bundled ESM/CJS output, sideEffects: false exports map and default export unchanged; import ... from 'i18next-http-backend', .use(...) and the loadPath option keep working. The backend is referenced by .use(), so it is not tree-shaken away

4.0.1 (allow @ in ns) and 4.0.2 (reject : in lng/ns, // in ns) only tighten/relax validation; the app uses BCP-47 codes and the default translation namespace, which are unaffected.

CI on this PR: 🔍 PR Validation / 🧪 Build & Test (automation-templates nodejs-build.yml) runs npm ci (frozen lockfile), type check, the vitest unit tests, vite build and npm audit --audit-level=high.

Left open

Resolved Dependabot alert GHSA-xvq9-wjp8-hwqf (incomplete URL
validation permits SSRF, low). The fix only exists in 4.0.2; the 3.x
line ends at 3.0.6, so the previous ^3.0.6 range could never resolve
to a patched release and a direct major update was required.

Breaking changes in 4.0 checked against this app:
* cross-fetch dropped, host fetch required - the backend only runs in
  the browser (Vite SPA/PWA), where native fetch is always present
* Node >= 18 required - CI and Docker build use Node 24 (.nvmrc)
* package exports map and default export unchanged, so the existing
  `import ... from 'i18next-http-backend'` and loadPath config stay
  as they are; no source changes needed

Lockfile now drops cross-fetch and the node-fetch subtree (node-fetch,
whatwg-url, tr46, webidl-conversions) that only 3.x pulled in. No
npm overrides were added.
@karlspace
karlspace merged commit 216fd5f into main Oct 11, 2026
6 checks passed
@karlspace
karlspace deleted the fix/i18next-http-backend-4.0.2 branch October 11, 2026 00:11
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.1.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant