PluginUpdate: disable inline HTML in markdown renderer to prevent HTML injection#1447
Conversation
There was a problem hiding this comment.
Pull request overview
This PR mitigates a potential HTML/XSS injection vector in the plugin update dialog by ensuring untrusted release notes are not interpreted as inline HTML by Qt’s markdown rendering path.
Changes:
- HTML-escape
pluginUpdateInfo.releaseNotesbefore rendering it viaQTextBrowser::setMarkdown().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ment()->setMarkdown() Agent-Logs-Url: https://github.com/DistroAV/DistroAV/sessions/45acbab7-4f14-430c-b2bd-ec8b64e8f402 Co-authored-by: paulpv <[email protected]>
…tor to fix compiler error Agent-Logs-Url: https://github.com/DistroAV/DistroAV/sessions/dd6ab576-9cf8-4db1-8a45-01cf00b74b9b Co-authored-by: paulpv <[email protected]>
|
@Trouffman @BitRate27 Ready for your review. The mock hostile input renders much better now: CC @RayneYoruka |
Add a debug-only button in OutputSettings that opens a synthetic PluginUpdate dialog populated with deliberately hostile releaseNotes (raw HTML, script tags, javascript: links, etc.). The new showSampleUpdateDialog() helper constructs a fake PluginUpdateInfo and shows the PluginUpdate UI so developers can visually verify that markdown rendering properly escapes/handles unsafe input. The button is only created when LOG_LEVEL >= LOG_DEBUG; the helper itself is unrestricted (gating is done at the caller). Also add the function prototype to update.h and include QPushButton where needed.
cb6030d to
dc25290
Compare
Added in
|
…and blank-line separators Agent-Logs-Url: https://github.com/DistroAV/DistroAV/sessions/5ce7601a-cd99-41c8-9021-178769d170a8 Co-authored-by: paulpv <[email protected]>
Fixed in
The result should now show:
|
Ensure the debug sample update dialog uses Markdown hard line breaks (trailing two spaces + newline) so the mock releaseNotes render with the intended line breaks when testing HTML-escaping/formatting.
|
@Trouffman @BitRate27 Added Chinese, Indian, Thai text per Trouffman's request:
CC @RayneYoruka |
Trouffman
left a comment
There was a problem hiding this comment.
Should be good, Only possible flag is that the code for the testing purpose might trigger some anti-malware scans.



QTextDocument::MarkdownNoHTMLflag viadocument()->setMarkdown()— prevents HTML injection at the parser level without any pre-escaping#include <QTextDocument>soQTextDocument::MarkdownFeaturesenum values are visible to the compilerQTextDocument::MarkdownFeatures(...)to fixno viable conversion from 'int' to 'MarkdownFeatures'compiler error\xNNUTF-8 byte sequences with\uNNNNUnicode code point escapes (portable, compiler-independent), and add blank lines between language paragraphs so each renders as a distinct paragraph