What changed, and why it matters
This merge changes how text is shown in the Monero GUI wallet. The main goal appears to be preventing rich-text formatting (HTML-like markup) from being interpreted in places where untrusted data could appear, such as scanned QR codes, dialog boxes, and transaction details. It also adds a new transaction-details popup that explicitly uses rich text. The change reduces the risk that an attacker could trick the wallet into displaying fake instructions or clickable links by embedding markup in data the wallet reads.
Treat this as a security hardening fix. Review whether any remaining dialogs still use AutoText/RichText with untrusted content, ensure the new txDetailsPopup's rich-text content is fully sanitized or composed only from trusted local data, and consider whether QR scanner error strings need additional sanitization before display.
Security signals we found
Multiple QML text elements switched from AutoText/default to Text.PlainText
StandardDialog content area defaulted to TextEdit.PlainText instead of TextEdit.AutoText
QRCodeScanner removed MessageDialog usage and routes errors through informationPopup
New txDetailsPopup explicitly uses TextEdit.RichText for transaction details
Mining error messages stripped of <br> HTML tags and replaced with plain-text newlines
Evidence from the diff
The patch sets textFormat: Text.PlainText on multiple QML Label/Text elements and on StandardDialog’s content area, which previously defaulted to TextEdit.AutoText. AutoText lets Qt decide whether to render content as rich text when it detects HTML-like tags. By forcing plain text, untrusted strings (QR decode errors, camera errors, wallet file names, update notices, mining errors, password prompts) are rendered literally. A new txDetailsPopup instance of StandardDialog is added with textFormat: TextEdit.RichText, and the History page routes transaction details through it, suggesting transaction details are considered trusted/structured content that still needs rich formatting. QRCodeScanner replaces MessageDialog with the existing informationPopup, also avoiding rich-text rendering of scanned error content.
Changed components
components/PasswordDialog.qmlcomponents/QRCodeScanner.qmlcomponents/StandardDialog.qmlcomponents/UpdateDialog.qmlmain.qmlpages/History.qmlpages/Mining.qmlwizard/WizardOpenWallet1.qmlInspect captured patch +41 / −27
### components/PasswordDialog.qml
@@ -156,6 +156,7 @@ FocusScope {
Layout.maximumWidth: 400
Label {
+ textFormat: Text.PlainText
text: {
if (newPasswordDialogMode) {
return qsTr("Please enter new wallet password") + translationManager.emptyString;
### components/QRCodeScanner.qml
@@ -29,7 +29,6 @@
import QtQuick
import QtCore
import QtMultimedia
-import QtQuick.Dialogs
import moneroComponents.QRCodeScanner 1.0
Rectangle {
@@ -83,11 +82,18 @@ Rectangle {
return { "address": address, "extra_parameters": params }
}
+ // Errors may contain scanned data; MessageDialog would render it as rich text
+ function showError(error) {
+ informationPopup.title = qsTr("QR Scanner") + translationManager.emptyString
+ informationPopup.text = error
+ informationPopup.onCloseCallback = null
+ informationPopup.open()
+ }
+
function showDecodeError(error, warning) {
if (!warning)
root.state = "Stopped"
- messageDialog.text = error
- messageDialog.visible = true
+ showError(error)
}
function startCapture() {
@@ -172,8 +178,7 @@ Rectangle {
console.error("QR scanner camera error:", error, errorString)
if (root.state === "Capture") {
root.state = "Stopped"
- messageDialog.text = errorString
- messageDialog.visible = true
+ root.showError(errorString)
}
}
focusMode: Camera.FocusModeAuto
@@ -231,14 +236,6 @@ Rectangle {
}
}
- MessageDialog {
- id: messageDialog
- title: qsTr("QR Scanner") + translationManager.emptyString
- onAccepted: {
- root.state = "Stopped"
- }
- }
-
Connections {
target: cameraPermission
function onStatusChanged() {
### components/StandardDialog.qml
@@ -46,6 +46,8 @@ Rectangle {
property alias okText: okButton.text
property alias cancelText: cancelButton.text
property alias closeVisible: closeButton.visible
+ // Set at declaration only; changing it at runtime reformats the content
+ property alias textFormat: dialogContent.textFormat
// same signals as Dialog has
signal accepted()
@@ -136,7 +138,7 @@ Rectangle {
Layout.fillHeight: true
renderType: Text.QtRendering
font.family: MoneroComponents.Style.fontLight.name
- textFormat: TextEdit.AutoText
+ textFormat: TextEdit.PlainText
readOnly: true
font.pixelSize: 14
selectByMouse: false
### components/UpdateDialog.qml
@@ -75,6 +75,7 @@ Popup {
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 18
text: qsTr("New Monero version v%1 is available.").arg(updateDialog.version)
+ textFormat: Text.PlainText
}
Text {
### main.qml
@@ -1836,6 +1836,15 @@ ApplicationWindow {
}
}
+ // Transaction details dialog
+ StandardDialog {
+ id: txDetailsPopup
+ anchors.fill: parent
+ z: parent.z + 1
+ cancelVisible: false
+ textFormat: TextEdit.RichText
+ }
+
// Transaction confirmation popup
TxConfirmationDialog {
// dynamically change onclose handler
@@ -1978,9 +1987,9 @@ ApplicationWindow {
informationPopup.open();
}
onRejectedNewPassword: {}
- Keys.enabled: !passwordDialog.visible && informationPopup.visible
- Keys.onEnterPressed: informationPopup.close()
- Keys.onReturnPressed: informationPopup.close()
+ Keys.enabled: !passwordDialog.visible && (informationPopup.visible || txDetailsPopup.visible)
+ Keys.onEnterPressed: informationPopup.visible ? informationPopup.close() : txDetailsPopup.close()
+ Keys.onReturnPressed: informationPopup.visible ? informationPopup.close() : txDetailsPopup.close()
}
DevicePassphraseDialog {
@@ -2504,6 +2513,7 @@ ApplicationWindow {
var inputDialogVisible = inputDialog && inputDialog.visible
var successfulTxPopupVisible = successfulTxPopup && successfulTxPopup.visible
var informationPopupVisible = informationPopup && informationPopup.visible
+ var txDetailsPopupVisible = txDetailsPopup && txDetailsPopup.visible
// prompt password after X seconds of inactivity
var inactivity = Utils.epoch() - appWindow.userLastActive;
@@ -2512,6 +2522,7 @@ ApplicationWindow {
if (inputDialogVisible) inputDialog.close()
remoteNodeDialog.close();
informationPopup.close()
+ txDetailsPopup.close()
if (txConfirmationPopup.visible) {
txConfirmationPopup.close()
txConfirmationPopup.clearFields()
@@ -2531,6 +2542,7 @@ ApplicationWindow {
if (inputDialogVisible) inputDialog.open(inputDialog.inputText)
if (successfulTxPopupVisible) successfulTxPopup.open(successfulTxPopup.transactionID)
if (informationPopupVisible) informationPopup.open()
+ if (txDetailsPopupVisible) txDetailsPopup.open()
} else {
passwordDialog.showError(qsTr("Wrong password"));
}
### pages/History.qml
@@ -1765,10 +1765,9 @@ Rectangle {
rings = rings.replace(/\|/g, '\n')
currentWallet.getTxKeyAsync(hash, function(hash, tx_key) {
- informationPopup.title = qsTr("Transaction details") + translationManager.emptyString;
- informationPopup.content = buildTxDetailsString(hash, hasPaymentId ? paymentId : null, tx_key, tx_note, destinations, rings, address, address_label, integratedAddress, dateTime, amount);
- informationPopup.onCloseCallback = null
- informationPopup.open();
+ txDetailsPopup.title = qsTr("Transaction details") + translationManager.emptyString;
+ txDetailsPopup.content = buildTxDetailsString(hash, hasPaymentId ? paymentId : null, tx_key, tx_note, destinations, rings, address, address_label, integratedAddress, dateTime, amount);
+ txDetailsPopup.open();
});
}
### pages/Mining.qml
@@ -326,12 +326,12 @@ Rectangle {
}
else
{
- miningError(qsTr("Couldn't start mining.<br>") + translationManager.emptyString)
+ miningError(qsTr("Couldn't start mining.") + translationManager.emptyString)
}
}
}
else {
- miningError(qsTr("Couldn't start mining.<br>") + translationManager.emptyString)
+ miningError(qsTr("Couldn't start mining.") + translationManager.emptyString)
}
}
}
@@ -582,9 +582,10 @@ Rectangle {
function miningError(message) {
p2poolManager.exit()
errorPopup.title = qsTr("Error starting mining") + translationManager.emptyString;
- errorPopup.text = message
+ var text = message
if (persistentSettings.useRemoteNode && !persistentSettings.allowRemoteNodeMining)
- errorPopup.text += qsTr("Mining is only available on local daemons. Run a local daemon to be able to mine.<br>") + translationManager.emptyString
+ text += "\n" + qsTr("Mining is only available on local daemons. Run a local daemon to be able to mine.") + translationManager.emptyString
+ errorPopup.text = text
errorPopup.open()
}
@@ -635,7 +636,7 @@ allArgs = allArgs.filter( ( el ) => !defaultArgs.includes( el.split(" ")[0] ) )
startP2Pool()
}
else {
- miningError(qsTr("Couldn't start mining.<br>") + translationManager.emptyString)
+ miningError(qsTr("Couldn't start mining.") + translationManager.emptyString)
}
}
@@ -655,7 +656,7 @@ allArgs = allArgs.filter( ( el ) => !defaultArgs.includes( el.split(" ")[0] ) )
update()
}
else {
- miningError(qsTr("Couldn't start mining.<br>") + translationManager.emptyString)
+ miningError(qsTr("Couldn't start mining.") + translationManager.emptyString)
}
}
### wizard/WizardOpenWallet1.qml
@@ -254,6 +254,7 @@ Rectangle {
}
Text {
+ textFormat: Text.PlainText
text: {
// truncate on window width
var maxLength = wizardController.layoutScale <= 1 ? 12 : 16Why this scored 61/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.