# CVE-2026-41886: locize Client SDK: Cross-origin DOM XSS & Handler Hijack Through Missing e.origin Validation in InContext Editor

> Attackers can execute arbitrary scripts or hijack handlers in locize-enabled applications by sending crafted postMessages without origin validation.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 8 May 2026
- **Updated:** 8 May 2026
- **Also known as:** GHSA-w937-fg2h-xhq2

## What is CVE-2026-41886?

CVE-2026-41886 is a high-severity cross-site scripting vulnerability in locize, published on 8 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

locize is a localization platform that connects code and i18n setup. Prior to version 4.0.21, the locize client SDK registers a window.addEventListener("message", …) handler that dispatches to registered internal handlers (editKey, commitKey, commitKeys, isLocizeEnabled, requestInitialize, …) without validating event.origin. The pre-patch listener in src/api/postMessage.js gates dispatch on event.data.sender === "i18next-editor-frame" — that value sits inside the attacker-controlled message payload, not the browser-enforced origin. Any web page that could embed or be embedded by a locize-enabled host — an iframe on a third-party page, a window.open-ed victim, a parent frame reaching down — could send a crafted postMessage and trigger the internal handlers. This issue has been patched in version 4.0.21.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation), CWE-346 (Origin Validation Error)

## Which versions are affected by CVE-2026-41886?

2 open source packages ship an affected version, including locize.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `locize` | npm | All versions | 4.0.21 |
| `locize` | npm | All versions | 4.0.21 |

## How do I fix CVE-2026-41886?

Upgrade locize to 4.0.21 or later.

## Is CVE-2026-41886 being exploited?

There is no known exploitation of CVE-2026-41886 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41886 and fix it if it is affected.

What it is: CVE-2026-41886 is a high-severity cross-site scripting vulnerability in locize, published on 8 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-41886 in the wild and no public exploit code.

Affected packages and fixed versions:
- locize (npm): affected all versions; fixed in 4.0.21
- locize (npm): affected all versions; fixed in 4.0.21

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-41886/ (Markdown: https://insights.sbomify.com/CVE-2026-41886/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-41886
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-41886
- OSV: https://osv.dev/vulnerability/CVE-2026-41886

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-41886/
Summaries are generated and may contain mistakes; the official description above is the record.
