<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Locize — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/locize/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/locize/feed.xml" rel="self" type="application/rss+xml"/><item><title>locize Client SDK Cross-Origin DOM XSS and Handler Hijack Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-locize-xss/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-locize-xss/</guid><description>The locize client SDK versions prior to 4.0.21 are vulnerable to cross-origin DOM XSS and handler hijack due to missing origin validation in the InContext Editor, allowing attackers to inject malicious code and exfiltrate data via crafted postMessage events.</description><content:encoded><![CDATA[<p>The locize client SDK, a browser module integrating the locize InContext translation editor, contains a cross-origin vulnerability in versions prior to 4.0.21. The vulnerability stems from the SDK&rsquo;s failure to validate the <code>event.origin</code> property when handling <code>window.addEventListener(&quot;message&quot;)</code> events. This allows a malicious webpage sharing a window reference with a locize-enabled host (e.g., via an iframe) to send crafted <code>postMessage</code> calls, triggering internal handlers without proper authorization. Successful exploitation can lead to DOM-based XSS, hijacking of the <code>api.source</code> and <code>api.origin</code> properties, and CSS injection, potentially compromising the confidentiality and integrity of the application. This vulnerability was discovered via an internal security audit of the locize ecosystem.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker hosts a malicious webpage with the intent to exploit a locize-enabled application.</li>
<li>The locize-enabled application embeds the attacker&rsquo;s page as an iframe or has a <code>window.opener</code>/<code>window.open</code> relationship with it.</li>
<li>The attacker crafts a <code>postMessage</code> with a <code>sender</code> field equal to <code>&quot;i18next-editor-frame&quot;</code> and a malicious payload targeted at specific handlers.</li>
<li>The locize SDK&rsquo;s <code>window.addEventListener(&quot;message&quot;)</code> handler receives the message and, without validating <code>event.origin</code>, dispatches it to the internal handlers.</li>
<li>If the attacker targets the <code>editKey</code> or <code>commitKeys</code> handlers, the attacker-controlled payload values are assigned to <code>item.node.innerHTML</code> or <code>item.node.setAttribute(attr, value)</code>, injecting malicious scripts or HTML.</li>
<li>If the attacker targets the <code>isLocizeEnabled</code> handler, the <code>api.source</code> and <code>api.origin</code> are hijacked, redirecting subsequent messages to the attacker&rsquo;s window and exfiltrating translation content.</li>
<li>If the attacker targets the <code>requestPopupChanges</code> handler, malicious CSS code is injected into the popup&rsquo;s inline style.</li>
<li>The attacker gains unauthorized access to sensitive data or injects malicious content into the locize-enabled application, impacting its integrity and confidentiality.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability can lead to several critical consequences. Cross-origin DOM XSS allows arbitrary code execution within the context of the vulnerable application. Hijacking <code>api.source</code> and <code>api.origin</code> results in the leakage of translation content and metadata to the attacker, compromising sensitive information. CSS injection can alter the visual appearance of the application, potentially leading to phishing attacks or further exploitation. The number of victims depends on the adoption rate of vulnerable locize SDK versions prior to 4.0.21.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to <code>locize</code> client SDK version 4.0.21 or later to patch the vulnerability. This version implements <code>event.origin</code> validation in <code>src/api/postMessage.js</code>, mitigating the risk of cross-origin attacks.</li>
<li>Deploy the Sigma rule &ldquo;Detect Locize Client SDK DOM XSS Attempt via postMessage&rdquo; to identify exploitation attempts based on manipulation of <code>innerHTML</code> or <code>setAttribute</code> in the locize context.</li>
<li>Enable web server logging and monitor for suspicious <code>postMessage</code> events originating from unexpected domains to detect potential exploitation attempts targeting the locize SDK.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>xss</category><category>dom-xss</category><category>postMessage</category><category>locize</category><category>javascript</category></item></channel></rss>