Fix a phishing vulnerability related to HTML in memo fields
Original report by @s-rah here: ZcashFoundation#205
This commit is contained in:
@@ -886,6 +886,7 @@ void MainWindow::setupTransactionsTab() {
|
|||||||
|
|
||||||
if (!memo.isEmpty()) {
|
if (!memo.isEmpty()) {
|
||||||
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
|
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
|
||||||
|
mb.setTextFormat(Qt::PlainText);
|
||||||
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
|
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
|
||||||
mb.exec();
|
mb.exec();
|
||||||
}
|
}
|
||||||
@@ -934,6 +935,7 @@ void MainWindow::setupTransactionsTab() {
|
|||||||
if (!memo.isEmpty()) {
|
if (!memo.isEmpty()) {
|
||||||
menu.addAction(tr("View Memo"), [=] () {
|
menu.addAction(tr("View Memo"), [=] () {
|
||||||
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
|
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
|
||||||
|
mb.setTextFormat(Qt::PlainText);
|
||||||
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
|
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
|
||||||
mb.exec();
|
mb.exec();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ QVariant TxTableModel::data(const QModelIndex &index, int role) const {
|
|||||||
return Settings::paymentURIPretty(Settings::parseURI(memo));
|
return Settings::paymentURIPretty(Settings::parseURI(memo));
|
||||||
} else {
|
} else {
|
||||||
return modeldata->at(index.row()).type +
|
return modeldata->at(index.row()).type +
|
||||||
(memo.isEmpty() ? "" : " tx memo: \"" + memo + "\"");
|
(memo.isEmpty() ? "" : " tx memo: \"" + memo.toHtmlEscaped() + "\"");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return concatMultipleMemos(dat);
|
return concatMultipleMemos(dat);
|
||||||
|
|||||||
Reference in New Issue
Block a user