TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tell HN: Immersive-translate plugin may expose you to XSS attacks

3 pointsby simonmysun9 months ago
This post might not directly concern English-speaking users, but I know there are many users (at least many Chinese speaking users) browse Hacker News with immersive-translate plugin[1]. The plugin has https:&#x2F;&#x2F;news.ycombinator.com included in its default list of sites to translate.<p>I recently identified a potential XSS injection target. When users navigate to a specific piece of content using the plugin, malicious code could be executed by their browser. This allows the possibility of cookies being stolen or other malicious activities. I have reported in their issue tracker[2].<p>Example:<p><pre><code> &lt;button onmouseover=alert(123)&gt;&lt;img src=&quot;&#x2F;404&quot; onerror=alert(789)&gt;im a button&lt;script&gt;alert(456)&lt;&#x2F;script&gt;&lt;&#x2F;button&gt; </code></pre> If you translate the above content using immersive-translate, you’ll see a popup. Moving your mouse over the translated content could trigger another popup.<p>Suggestions:<p><pre><code> - For Immersive-Translate users: Until this issue is fixed, I recommend disabling the default translation of Hacker News content and only translating content that has been manually reviewed. - For Hacker News admins: To mitigate this risk, you might consider adding a `Content-Security-Policy` header in the server responses or including a `&lt;meta http-equiv=&quot;Content-Security-Policy&quot; content=&quot;xxx&quot;&gt;` tag in the HTML `&lt;head&gt;` section. </code></pre> [1]: https:&#x2F;&#x2F;immersivetranslate.com&#x2F;<p>[2]: https:&#x2F;&#x2F;github.com&#x2F;immersive-translate&#x2F;immersive-translate&#x2F;issues&#x2F;2022

2 comments

simonmysun9 months ago
Screenshots to prove: <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;vaKVo52" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;vaKVo52</a>
moritzwarhier9 months ago
Nice advice about the CSP, but ultimately the issue is with the browser add-on?
评论 #41277691 未加载