Author:
    Creation:2026-12-04Last update:2026-12-04

    Understand i18n security. Risk / Impact. 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

    ArchitectureExamplesWho can change production textMain attack surface
    Compiled at build timeIntlayer, Paraglide, LinguiWhoever can merge and deployContent files, compiler, CI
    Messages resolved at runtimei18next, next-intl, vue-i18n with local filesWhoever can merge and deployInterpolation, parsing, file loading
    Remote dictionariesi18next HTTP backend, OTA services, CMS-drivenAny account or key with writeAccounts, API keys, the remote source
    Browser translation scriptDOM translation servicesThe providerThird-party script on your pages
    Translation reverse proxyProxy-based servicesThe providerYour traffic goes through a third party
    AI translation at runtimeAny tool calling a model per requestThe model, and what it readsData 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 December 4, 2026:

    LibraryAdvisoriesLast 12 monthsCritical / highFixed before disclosure
    i18next and official plugins15132 / 515 / 15
    vue-i18n620 / 26 / 6
    next-intl220 / 02 / 2
    FormatJS (react-intl), Lingui, Paraglide, svelte-i18n, ngx-translate, typesafe-i18n, Intlayer00--

    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:

    PackageIssueFixed inAdvisory
    i18next-fs-backendPrototype pollution through a missing-key string2.6.6GHSA-2933-q333-qg83
    i18next-fs-backendPath traversal through language and namespace2.6.4GHSA-8847-338w-5hcj
    i18next-http-middlewarePath traversal and SSRF through the same inputs3.9.3GHSA-jfgf-83c5-2c4m
    i18nextCorruption of shared built-in objects (DoS)26.3.4GHSA-6jcc-5g8w-32mx
    vue-i18nXSS through srcdoc despite escapeParameter11.4.14GHSA-83rm-6c8r-g728
    next-intlOpen redirect4.9.1GHSA-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:

    LibraryCommitsDays with a commitnpm releasesIssues closed within 7 daysMedian days to closeLast commit
    Intlayer3,85932423170%1.1Dec 3, 2026
    FormatJS1,4502086794%0.5Dec 4, 2026
    i18next + plugins91714210191%0.1Dec 4, 2026
    Paraglide4261205458%3.5Dec 3, 2026
    next-intl2388010369%1.7Dec 3, 2026
    Lingui2291132928%25.3Dec 4, 2026
    vue-i18n206674465%1.1Dec 4, 2026
    ngx-translate171271112%1,923Dec 3, 2026
    typesafe-i18n531--Feb 11, 2026
    svelte-i18n000--Oct 21, 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:

    LibraryPackages installednpm provenanceSECURITY.mdOpenSSF Scorecard
    typesafe-i18n1yesnonot rated
    ngx-translate2yesno4.2
    i18next (react-i18next, backend, detector)6nono4.6
    FormatJS (react-intl)6yesno4.2
    vue-i18n7yesyesnot rated
    next-intl51yesyes6.9
    svelte-i18n55nono2.9
    Paraglide70yesnonot rated
    Lingui (core, react, CLI)128yesno6.3
    Intlayer (core, React, Next.js, Vite)154yesyesnot 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.

    intlayer.config.ts
    import { type IntlayerConfig } from "intlayer";
    import { z } from "zod";
    
    const ownLink = z
      .url()
      .refine((link) => new URL(link).hostname.endsWith("example.com"));
    
    const config: IntlayerConfig = {
      // ...
      schemas: {
        pricing: z.object({
          title: z.string().max(60),
          checkoutUrl: ownLink,
        }),
      },
    };
    
    export default config;
    

    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 optimizations, a page receives the content it uses. A global catalog 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 fetch only 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 sanitizer. If markup comes from users, a CMS contributor or a model, sanitize 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:

    bash
    npm audit signatures
    

    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

    1. Are the advisories of the library and its plugins fixed in your lockfile?
    2. Can a locale or namespace taken from a URL reach a file path, a remote URL or an object key?
    3. Can production text change without a commit? Through which accounts and keys?
    4. Who reviews the locales nobody on the team reads?
    5. Which strings are rendered as markup, and who can write them?
    6. What leaves your machine at build time and at runtime?
    7. Which API keys exist, and can any of them reach the client bundle?
    8. 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.

    Related Posts

    Last Posts