aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorThomas <thomas.giudici@proton.me>2026-06-18 13:34:27 +0200
committerThomas <thomas.giudici@proton.me>2026-06-18 14:17:25 +0200
commit3d3a391ef43b1ac09160f4d572d5fbf85f249dc8 (patch)
tree4b6225110645f6936e7ad1617cdea0ed5ad32cb9 /components
parenta003cb75b6416488d0a448198e6de03211ae1a67 (diff)
downloadmonzero-gui-3d3a391ef43b1ac09160f4d572d5fbf85f249dc8.tar.gz
monzero-gui-3d3a391ef43b1ac09160f4d572d5fbf85f249dc8.tar.xz
monzero-gui-3d3a391ef43b1ac09160f4d572d5fbf85f249dc8.zip
qml: escape untrusted text in remaining RichText views
Extends the escaping from commit 23ec5eb6 to the RichText sinks it did not cover: the transaction note in the tx details popup (History), the wallet name and account label in the send confirmation (TxConfirmationDialog), the address label on the merchant page (Merchant), and the wallet path on the info page (SettingsInfo). These were interpolated unescaped, so a value containing markup is rendered as rich text. The transaction note is the notable case: it can be set from a payment request's tx_description, so it is attacker influenced. Escape these fields with Utils.htmlEscape. Set the send confirmation From field to Text.RichText explicitly so the escaped entities decode in both of its branches; the single-account branch contains no tag and would otherwise render as plain text and show the raw entity.
Diffstat (limited to 'components')
-rw-r--r--components/TxConfirmationDialog.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/TxConfirmationDialog.qml b/components/TxConfirmationDialog.qml
index 1700aa0a..51da022f 100644
--- a/components/TxConfirmationDialog.qml
+++ b/components/TxConfirmationDialog.qml
@@ -242,6 +242,7 @@ Rectangle {
Layout.fillWidth: true
font.pixelSize: 15
color: MoneroComponents.Style.defaultFontColor
+ textFormat: Text.RichText
text: {
if (currentWallet) {
var walletTitle = function() {
@@ -257,9 +258,9 @@ Rectangle {
if (appWindow.currentWallet.numSubaddressAccounts() > 1) {
var currentSubaddressAccount = currentWallet.currentSubaddressAccount;
var currentAccountLabel = currentWallet.getSubaddressLabel(currentWallet.currentSubaddressAccount, 0);
- return walletTitle() + " (" + walletName + ")" + "<br>" + qsTr("Account #") + currentSubaddressAccount + (currentAccountLabel !== "" ? " (" + currentAccountLabel + ")" : "") + translationManager.emptyString;
+ return walletTitle() + " (" + Utils.htmlEscape(walletName) + ")" + "<br>" + qsTr("Account #") + currentSubaddressAccount + (currentAccountLabel !== "" ? " (" + Utils.htmlEscape(currentAccountLabel) + ")" : "") + translationManager.emptyString;
} else {
- return walletTitle() + " (" + walletName + ")" + translationManager.emptyString;
+ return walletTitle() + " (" + Utils.htmlEscape(walletName) + ")" + translationManager.emptyString;
}
} else {
return "";