Merge bitcoin-core/gui#970: Remove legacy BIP70 merchant name from tx details window
What changed, and why it matters
This commit removes an old feature in the Bitcoin Core wallet's transaction details window that displayed a merchant name for BIP70 payment requests. BIP70 is an outdated payment protocol that is no longer used. The removed code parsed certificate data in a simple, untested way. The change is described as a cleanup, but it also eliminates a small bit of code that handled untrusted data without proper validation.
Treat as a hardening/cleanup change rather than an urgent security fix. Users should upgrade through normal release channels. If running older versions, avoid opening transaction details for BIP70 payment requests from untrusted sources. No immediate incident response is warranted based on the supplied materials.
Security signals we found
Removal of untested/unfuzzed parser for externally supplied BIP70 payment request data
Parser relied on byte-string searches and length fields from untrusted input
GUI display path rendered parsed string in HTML after HtmlEscape
PR description mentions 'likely also fix some parsing issues with corrupt data'
No explicit security claim or CVE from the vendor
Evidence from the diff
The commit deletes GetPaymentRequestMerchant() and its call site in src/qt/transactiondesc.cpp. That function performed a naive byte search on a serialized BIP70 PaymentRequest to extract the X.509 Subject Common Name, then rendered it in HTML after passing through GUIUtil::HtmlEscape. The PR description explicitly notes the parser had no tests or fuzzing and that removing it may fix parsing issues with corrupt data. No CVE, advisory, or vendor security statement is present in the supplied materials.
Changed components
src/qt/transactiondesc.cppBitcoin Core GUI transaction details dialogLegacy BIP70 payment request displayInspect captured patch +5 / −41
### doc/release-notes-970.md
@@ -0,0 +1,5 @@
+GUI changes
+-----------
+
+- The transaction details dialog no longer displays the merchant name for old
+ BIP70 payment requests. (gui#970)
### src/qt/transactiondesc.cpp
@@ -6,7 +6,6 @@
#include <qt/bitcoinunits.h>
#include <qt/guiutil.h>
-#include <qt/paymentserver.h>
#include <qt/transactionrecord.h>
#include <common/system.h>
@@ -66,34 +65,6 @@ QString TransactionDesc::FormatTxStatus(const interfaces::WalletTxStatus& status
}
}
-// Takes an encoded PaymentRequest as a string and tries to find the Common Name of the X.509 certificate
-// used to sign the PaymentRequest.
-bool GetPaymentRequestMerchant(const std::string& pr, QString& merchant)
-{
- // Search for the supported pki type strings
- if (pr.find(std::string({0x12, 0x0b}) + "x509+sha256") != std::string::npos || pr.find(std::string({0x12, 0x09}) + "x509+sha1") != std::string::npos) {
- // We want the common name of the Subject of the cert. This should be the second occurrence
- // of the bytes 0x0603550403. The first occurrence of those is the common name of the issuer.
- // After those bytes will be either 0x13 or 0x0C, then length, then either the ascii or utf8
- // string with the common name which is the merchant name
- size_t cn_pos = pr.find({0x06, 0x03, 0x55, 0x04, 0x03});
- if (cn_pos != std::string::npos) {
- cn_pos = pr.find({0x06, 0x03, 0x55, 0x04, 0x03}, cn_pos + 5);
- if (cn_pos != std::string::npos) {
- cn_pos += 5;
- if (pr[cn_pos] == 0x13 || pr[cn_pos] == 0x0c) {
- cn_pos++; // Consume the type
- int str_len = pr[cn_pos];
- cn_pos++; // Consume the string length
- merchant = QString::fromUtf8(pr.data() + cn_pos, str_len);
- return true;
- }
- }
- }
- }
- return false;
-}
-
QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord* rec, BitcoinUnit unit)
{
int numBlocks;
@@ -286,18 +257,6 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
for (const std::string& msg : messages) {
strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(msg, true) + "<br>";
}
- // BIP 70 Payment Requests
- for (const std::string& req : payment_requests) {
- QString merchant;
- if (!GetPaymentRequestMerchant(req, merchant)) {
- merchant.clear();
- } else {
- merchant = tr("%1 (Certificate was not verified)").arg(merchant);
- }
- if (!merchant.isNull()) {
- strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>";
- }
- }
if (wtx.is_coinbase)
{Why this scored 19/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.