Created attachment 90659 [details] Screenshot For example copy this line: <p>Hello! <img src="https://community.kde.org/images.community/5/5f/Kde-in-progress.png" /></p> The popup will show the image. This looks vulnerable to cross-site scripting and other malicious stuff. It should probably escape the content before setting it to tooltip.
I may have used to wrong word - it's the applet's tooltip which appears on mouse hover, not the popup. The popup is correct.
the tooltip content is just assigned to Plasmoid.toolTipSubText. I do not know whether it's possible to add textFormat for it. Adding Marco for more insight.
I don't think the textFormat should change, maybe, but the tooltip should/could still escape the string properly, no?
(In reply to Martin Klapetek from comment #3) > I don't think the textFormat should change, maybe, but the tooltip > should/could still escape the string properly, no? I think escaping is wrong as it would turn every "<" into < - this is comparable stupid if you have for example copied something like "1 < 2".
What I was thinking is that if that tooltip renders html correctly, it would render those escaped sequences correctly too.
Oh and fwiw, it actually does. So copying "<" actually puts "<" into the tooltip. So escaping the tooltip text would easily solve it.
> So escaping the tooltip text would easily solve it. but only if it might be rich text. Try copying a line break first, it would encode it as PlainText. E.g. copy this section: " <p>Test</p>" once with and once without the line break.
Both cases work correct for me. Maybe the tooltip is set to always-rich text or the detection improved in qt5.4, dunno.
Git commit 97b71c3f72f7669b7966ea4a433486756844b5a2 by Martin Gräßlin. Committed on 28/01/2015 at 13:24. Pushed by graesslin into branch 'master'. [applets/clipboard] Force tooltips to be PlainText Prevents cross-side scripting attempts. This requires 8044e15 of plasma-framework. FIXED-IN: 5.3.0 REVIEW: 122289 M +1 -0 applets/clipboard/contents/ui/clipboard.qml http://commits.kde.org/plasma-workspace/97b71c3f72f7669b7966ea4a433486756844b5a2