Browse Source

Fix a phishing vulnerability related to HTML in memo fields

Original report by @s-rah here: https://github.com/ZcashFoundation/zecwallet/issues/205
pull/140/head
Duke Leto 5 years ago
parent
commit
e264af0155
  1. 2
      src/mainwindow.cpp
  2. 2
      src/txtablemodel.cpp

2
src/mainwindow.cpp

@ -926,6 +926,7 @@ void MainWindow::setupTransactionsTab() {
if (!memo.isEmpty()) {
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
mb.setTextFormat(Qt::PlainText);
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
mb.exec();
}
@ -981,6 +982,7 @@ void MainWindow::setupTransactionsTab() {
if (!memo.isEmpty()) {
menu.addAction(tr("View Memo"), [=] () {
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
mb.setTextFormat(Qt::PlainText);
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
mb.exec();
});

2
src/txtablemodel.cpp

@ -143,7 +143,7 @@ void TxTableModel::updateAllData() {
return Settings::paymentURIPretty(Settings::parseURI(dat.memo));
} else {
return modeldata->at(index.row()).type +
(dat.memo.isEmpty() ? "" : " tx memo: \"" + dat.memo + "\"");
(dat.memo.isEmpty() ? "" : " tx memo: \"" + dat.memo.toHtmlEscaped() + "\"");
}
}
case 1: {

Loading…
Cancel
Save