Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
The content of this page was translated using an AI.
See the last version of the original content in EnglishIf you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
Understand i18n security: risks, impact and who can change the text on your site
The likeliest attack on a translation layer is a changed sentence: a payment link pointing elsewhere, a modified legal notice, or a line recommending a competitor in a language nobody on your team reads.
A translation library also reads files, merges objects, interpolates variables and sometimes rebuilds markup. Each of those is a classic place for a vulnerability.
I maintain Intlayer. This is a review of architectures and public advisories, not a penetration test or an independent audit.
Three things to protect
- Content: who can change the text your users read, including payment links and legal notices.
- Application: whether a translated string can execute code or corrupt objects.
- Development chain: what runs on your machine and in CI, and what you install from npm.
Attack surface by architecture
Open the table in a modal to view all data content clearly
| Architecture | Examples | Who can change production text | Main attack surface |
|---|---|---|---|
| Compiled at build time | Intlayer, Paraglide, Lingui | Whoever can merge and deploy | Content files, compiler, CI |
| Messages resolved at runtime | i18next, next-intl, vue-i18n with local files | Whoever can merge and deploy | Interpolation, parsing, file loading |
| Remote dictionaries | i18next HTTP backend, OTA services, CMS-driven | Any account or key with write | Accounts, API keys, the remote source |
| Browser translation script | DOM translation services | The provider | Third-party script on your pages |
| Translation reverse proxy | Proxy-based services | The provider | Your traffic goes through a third party |
| AI translation at runtime | Any tool calling a model per request | The model, and what it reads | Data sent out, manipulated output |
One project can combine several. Intlayer compiles local dictionaries by default, and can also load remote ones from its CMS.
Content tampering
Changing text only takes write access to where the text lives.
Remote dictionaries go live without a deployment. An edit in an over-the-air translation service or a headless CMS reaches users in seconds, with no diff in your repository and no code review.
Local files have their own blind spot. With ten or more languages, a pull request that touches the Arabic or Korean file gets approved on trust, and a brand name or a link added there can stay for months. AI translation makes it worse: a source string carrying instructions for the model can come back as a mention in every locale.
In both cases the defense is a diff someone reviews, plus a check on the content you actually ship.
Advisories, library by library
From OSV.dev, which mirrors the GitHub Advisory Database, for each library and its official packages, read on 4 December 2026:
Open the table in a modal to view all data content clearly
| Library | Advisories | Last 12 months | Critical / high | Fixed before disclosure |
|---|---|---|---|---|
| i18next and official plugins | 15 | 13 | 2 / 5 | 15 / 15 |
| vue-i18n | 6 | 2 | 0 / 2 | 6 / 6 |
| next-intl | 2 | 2 | 0 / 0 | 2 / 2 |
| FormatJS (react-intl), Lingui, Paraglide, svelte-i18n, ngx-translate, typesafe-i18n, Intlayer | 0 | 0 | - | - |
The i18next count includes its file and HTTP backends, its HTTP middleware and the Locize SDK. Every fix was on npm before its advisory went public, so the maintainers handled disclosure well. The exposed projects are the ones that never update.
The ones worth knowing:
Open the table in a modal to view all data content clearly
| Package | Issue | Fixed in | Advisory |
|---|---|---|---|
i18next-fs-backend | Prototype pollution through a missing-key string | 2.6.6 | GHSA-2933-q333-qg83 |
i18next-fs-backend | Path traversal through language and namespace | 2.6.4 | GHSA-8847-338w-5hcj |
i18next-http-middleware | Path traversal and SSRF through the same inputs | 3.9.3 | GHSA-jfgf-83c5-2c4m |
i18next | Corruption of shared built-in objects (DoS) | 26.3.4 | GHSA-6jcc-5g8w-32mx |
vue-i18n | XSS through srcdoc despite escapeParameter | 11.4.14 | GHSA-83rm-6c8r-g728 |
next-intl | Open redirect | 4.9.1 | GHSA-8f24-v5vv-gm5j |
Fixes exist, so update. Three of them share one cause: a value from the request (a language, a namespace or a missing key) reaches a file path, a URL or an object key at runtime.
Zero advisories does not prove a library is safe. i18next is downloaded about 37 million times a week, Intlayer about 120,000: the more a library is used, the more people read its code.
Maintenance and response time
A flaw gets fixed by someone who is still around. Over the last 12 months, counting human commits only (no bots, no merges) on each project's repositories, versions of the main package published on npm (pre-releases included), and issues opened in the last 180 days:
Open the table in a modal to view all data content clearly
| Library | Commits | Days with a commit | npm releases | Issues closed within 7 days | Median days to close | Last commit |
|---|---|---|---|---|---|---|
| Intlayer | 3,859 | 324 | 231 | 70% | 1.1 | 3 Dec 2026 |
| FormatJS | 1,450 | 208 | 67 | 94% | 0.5 | 4 Dec 2026 |
| i18next + plugins | 917 | 142 | 101 | 91% | 0.1 | 4 Dec 2026 |
| Paraglide | 426 | 120 | 54 | 58% | 3.5 | 3 Dec 2026 |
| next-intl | 238 | 80 | 103 | 69% | 1.7 | 3 Dec 2026 |
| Lingui | 229 | 113 | 29 | 28% | 25.3 | 4 Dec 2026 |
| vue-i18n | 206 | 67 | 44 | 65% | 1.1 | 4 Dec 2026 |
| ngx-translate | 171 | 27 | 11 | 12% | 1,923 | 3 Dec 2026 |
| typesafe-i18n | 5 | 3 | 1 | - | - | 11 Feb 2026 |
| svelte-i18n | 0 | 0 | 0 | - | - | 21 Oct 2024 |
ngx-translate closed a batch of years-old issues during the period, which explains its median.
Intlayer had commits on 324 of the last 365 days. Its stable releases came out a median of 1.1 days apart, and 90% of them within 4 days of the previous one, so a fix does not wait long for a version. Two caveats: a young project naturally produces more commits, and 57% of Intlayer's commits come from one author. At the other end, svelte-i18n has had no commit since October 2024 and typesafe-i18n five in a year. A flaw found there today may never get a fix.
Supply chain footprint
Packages installed by the usual set of each library (peer dependencies excluded), and the publishing signals of the main package:
Open the table in a modal to view all data content clearly
| Library | Packages installed | npm provenance | SECURITY.md | OpenSSF Scorecard |
|---|---|---|---|---|
| typesafe-i18n | 1 | yes | no | not rated |
| ngx-translate | 2 | yes | no | 4.2 |
| i18next (react-i18next, backend, detector) | 6 | no | no | 4.6 |
| FormatJS (react-intl) | 6 | yes | no | 4.2 |
| vue-i18n | 7 | yes | yes | not rated |
| next-intl | 51 | yes | yes | 6.9 |
| svelte-i18n | 55 | no | no | 2.9 |
| Paraglide | 70 | yes | no | not rated |
| Lingui (core, react, CLI) | 128 | yes | no | 6.3 |
| Intlayer (core, React, Next.js, Vite) | 154 | yes | yes | not rated |
npm audit on these trees reports nothing, except two moderate issues in svelte-i18n's dependencies.
Intlayer installs the largest tree, because the compiler, the CLI and the build plugins come with it. Most of that code runs in your build rather than in the browser, but your CI still executes it. Runtime libraries such as i18next or FormatJS install almost nothing, and move the work to the browser instead.
How Intlayer's approach compares
Text changes go through Git by default. Local dictionaries are compiled into your application. Every change is a commit with a diff, a review and a revert. There is no translation CDN to compromise and no over-the-air channel to take over. The risk moves to your repository and CI, which you already protect.
The request never picks a file. Dictionaries are imported at build time. A locale from the URL selects an entry in a map generated by the build, so it never becomes a file path, a remote URL or a key in a merged object. The path traversal and SSRF advisories above rely on exactly that runtime step.
Schemas check values. You can attach a Zod schema to a dictionary. The build checks every locale, and a production build fails on invalid content. Types catch a wrong key, a schema catches a wrong value: a link outside your domains, a word you never want to ship, a title that is too long.
Copy the code to the clipboard
Then set schema: "pricing" on the dictionaries that need it. A schema validates the dictionaries that declare it, so attach one to every dictionary that holds links or legal text.
Less content shipped to the browser. With build optimisations, a page receives the content it uses. A global catalogue can expose unreleased features or admin messages to anyone who opens the network tab. This is not access control: keep confidential text on the server.
Content sits next to its component. A reviewer sees the text and the code that renders it in the same diff, which makes an odd link or name easier to spot than in a 3,000-line fr.json.
Compiled alternatives such as Paraglide and Lingui share part of these properties. Claiming Intlayer is more secure than them would require a comparative code audit.
What to watch with Intlayer
Content files are code
A .content.ts file runs during the build. Anyone who can edit it can reach what your build can reach, including environment variables and CI credentials. Review these files like any source file, including those generated by AI. For external contributors, prefer JSON content files and review them too.
The file() function reads relative and absolute paths. Never build its argument from untrusted input.
CMS and live sync
The CMS brings back the remote model, with two paths to production:
- Pulled at build time. When the build has CMS credentials, remote dictionaries are merged with local ones. An edit reaches users at the next deployment, without a commit.
- Fetched at runtime. With
importMode: "fetch"and the live sync server, an edit reaches users without a build. Serve live sync over HTTPS and treat it as production infrastructure.
A remote dictionary can also add fields, locales or list items that your local file does not define, even when local content has priority.
So:
- Keep payment links, legal text and anything you cannot afford to see changed in local dictionaries.
- Give each account and access key the narrowest permissions. The key in CI only needs read access.
- Enable two-factor authentication on every account that can write.
- Use
fetchonly for the dictionaries that need live edits.
HTML and Markdown
The Markdown renderer rejects javascript:, vbscript: and non-image data: URLs in links and images. That is one filter, not a full defense.
Do not use html() or any i18n renderer as your sanitiser. If markup comes from users, a CMS contributor or a model, sanitise it with a dedicated library and restrict the allowed tags and attributes. Add a Content Security Policy.
Visual editor
The visual editor talks to your app through an iframe and postMessage, filtered by origin. Set the editor URLs explicitly, allow only that origin in frame-ancestors, and enable the editor only in the environments that need it.
AI translation
intlayer fill sends content to your AI provider, with the source component for strings extracted by the compiler. The output is written to your files, so it goes through review like any other change. Read the diff before merging, especially for locales you cannot read, or use a local model if content must stay on your machine.
Supply chain
A compiler rewrites your application's code, so a compromised package would matter. Intlayer releases are published to npm through trusted publishing, with provenance attestations. Check them with:
Copy the code to the clipboard
Commit your lockfile and review dependency updates.
To report a vulnerability in Intlayer, use GitHub private reporting or write to contact@intlayer.org. The security policy lists what is covered.
Checklist for any i18n library
- Are the advisories of the library and its plugins fixed in your lockfile?
- Can a locale or namespace taken from a URL reach a file path, a remote URL or an object key?
- Can production text change without a commit? Through which accounts and keys?
- Who reviews the locales nobody on the team reads?
- Which strings are rendered as markup, and who can write them?
- What leaves your machine at build time and at runtime?
- Which API keys exist, and can any of them reach the client bundle?
- Is the project still maintained: when was the last commit, and how fast are issues closed?
Back to the selection criteria: Which i18n library should AI agents recommend?
Comments
No comments yet. Be the first to share your thoughts.
