fix ln invoice not configured correctly for applinks
What changed, and why it matters
This commit fixes two separate bugs in a cryptocurrency wallet app. First, it corrects how Lightning Network invoice links are formatted so that Android/iOS 'applinks' open properly. Second, it adds a safety check so that if the Monero wallet isn't loaded yet, the app returns an empty list of subaddresses instead of crashing. Neither change appears to be a security vulnerability fix in the traditional sense; they are reliability/bug fixes.
Treat as a routine bug-fix commit. Review whether the Lightning invoice URI handling could be abused via malicious deep links, but the patch itself is a correctness fix. No immediate security response is indicated by the diff.
Security signals we found
Null-dereference crash guard added (defensive hardening)
URI scheme normalization for external app-link handling
No explicit security claims in commit title or message
Evidence from the diff
The diff contains two changes: (1) In cw_core/lib/payment_uris.dart, the toString() of LightningPaymentRequest is changed from bolt11Invoice ?? 'lightning:$lnURL' to 'lightning:${bolt11Invoice ?? lnURL}', ensuring the ‘lightning:’ URI scheme is always present for applink routing. (2) In cw_monero/lib/api/subaddress_list.dart, a null check for currentWallet is added before calling currentWallet!.history(), preventing a null-dereference/crash when the wallet is not yet configured. The commit message frames both as bug fixes (‘fix ln invoice not configured correctly for applinks’ and ‘gracefully handle monero subaddresses’). No security-relevant language is used by the vendor.
Changed components
cw_core/lib/payment_uris.dartcw_monero/lib/api/subaddress_list.dartInspect captured patch +4 / −1
### cw_core/lib/payment_uris.dart
@@ -464,5 +464,5 @@ class LightningPaymentRequest extends PaymentURI {
final String? bolt11Invoice;
@override
- String toString() => bolt11Invoice ?? "lightning:$lnURL";
+ String toString() => "lightning:${bolt11Invoice ?? lnURL}";
}
### cw_monero/lib/api/subaddress_list.dart
@@ -72,6 +72,9 @@ List<TinyTransactionDetails> ttDetails = [];
Future<List<Subaddress>> getAllSubaddresses() async {
try {
await txHistoryMutex.acquire();
+ if (currentWallet == null) {
+ return [];
+ }
txhistory = currentWallet!.history();
final txCount = txhistory!.count();
if (lastTxCount != txCount && lastWptr != currentWallet!.ffiAddress()) {Why this scored 32/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.