crash_reporter: detect more altcoin-forks, don't send reports
What changed, and why it matters
This commit tightens a check in Electrum's crash reporter so it refuses to send crash reports to Electrum's servers when the software is an altcoin fork. Previously, forks that kept Bitcoin's genesis block but changed the project's source-code URL could still spam Electrum with crash reports. The change adds a URL check to catch more forks. It is a defensive hardening patch, not a fix for a vulnerability in Electrum itself.
No urgent action needed for Electrum users. Fork maintainers should set their own `BaseCrashReporter.report_server` or disable automated reporting. Upstream may want to document this policy in fork guidelines.
Security signals we found
hardening: additional validation before sending sensitive crash data to external server
information-disclosure reduction: prevents third-party fork users from leaking crash data to upstream Electrum
resource-abuse reduction: prevents upstream crash server from receiving reports it cannot act on
no memory-safety, crypto, or remote-code-execution signals present
Evidence from the diff
The patch modifies electrum/base_crash_reporter.py. send_report() now computes bitcoinlike_genesis from the last four hex characters of constants.net.GENESIS and also checks whether constants.GIT_REPO_URL contains /spesmilo/. If either the genesis block is not Bitcoin-like or the codebase is forked (i.e., not the upstream spesmilo repository), and the report destination is still .electrum.org, it raises an exception instead of uploading the crash report. This prevents altcoin forks from pointing their users at Electrum’s crash-reporting infrastructure.
Changed components
electrum/base_crash_reporter.pyBaseCrashReporter.send_report()Inspect captured patch +9 / −3
diff --git a/electrum/base_crash_reporter.py b/electrum/base_crash_reporter.py
index 3689649..abdd11c 100644
--- a/electrum/base_crash_reporter.py
+++ b/electrum/base_crash_reporter.py
@@ -89,13 +89,19 @@ class BaseCrashReporter(Logger):
def send_report(self, asyncio_loop, proxy: 'ProxySettings', *, timeout=None) -> CrashReportResponse:
# FIXME the caller needs to catch generic "Exception", as this method does not have a well-defined API...
- if (constants.net.GENESIS[-4:] not in [
+ bitcoinlike_genesis = constants.net.GENESIS[-4:] in [
"e26f", # mainnet
"4943", # testnet 3
"f043", # testnet 4
"1ef6", # signet
- ] and ".electrum.org" in BaseCrashReporter.report_server):
- # Gah! Some kind of altcoin wants to send us crash reports.
+ ]
+ is_forked_codebase = not bitcoinlike_genesis or "/spesmilo/" not in constants.GIT_REPO_URL
+ if is_forked_codebase and ".electrum.org" in BaseCrashReporter.report_server:
+ # Some kind of altcoin wants to send us crash reports... ?
+ # - You, the reader, yes *you*: if you forked the codebase e.g. to support an altcoin,
+ # please consider that upstream Electrum does NOT want to receive automated crash reports
+ # from your users. You should set up your own crash report server,
+ # and change `BaseCrashReporter.report_server` accordingly, or just disable reporting.
raise Exception(_("Missing report URL."))
report = self.get_traceback_info(*self.exc_args)
report.update(self.get_additional_info())
Why this scored 23/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.