This image has an empty alt attribute; its file name is attacksafe-software-logo-1024x213.png
This image has an empty alt attribute; its file name is attacksafe-software-logo-1024x213.png

This article discusses the Bitcoin Lightning Wallet (BLW) mobile application for iOS and Android, which supports fast payments via the Lightning Network. Unfortunately, many standalone nodes of this app, as well as the LNbits Node Manager and Core Lightning, are at high risk of losing all funds due to various vulnerabilities.

Developer David Shares from the Japanese company Bitcoin Portal has published numerous documents on this topic.

LNbits is a free account management system for various mobile applications that interact with cryptocurrency wallets. The LNbits Node Manager has become especially popular thanks to the development of the Bitcoin Lightning Wallet (BLW) and the creation of non-custodial standalone nodes for Bitcoin SPV, designed for Android and iPhone with Node.js support. By using standalone nodes, users have full control over their funds and are solely responsible for their security, unlike other mobile wallets.

The open-source LNbits Node Manager solves several tasks:

  • Collecting data on the exchange rates of various cryptocurrencies (BTC, ETH, LTC, USDT, XLM, BNB, etc.)
  • Maintaining a list of public LNbits nodes used by BLW to open payment channels
  • Partial payment routing
  • Storing encrypted backups of payment channels

LNbits Node Manager works with various services. For example, following the example of Salvador Guerrero, many LNbits users can run a full Bitcoin node on a Raspberry Pi to send and receive bitcoins without fees, provided all LNbits wallets operate within a single Core Lightning instance.

David Shares also published a timeline showing that the Lightning Network faces numerous technical issues, bugs, and exploits. This technology does not yet deliver the promised decentralization and is not completely safe for users.

Vulnerability in the Quasar Framework

After reviewing all the materials, it was found that the vulnerability is related to the operation of the Quasar framework and the quasar.umd.js file. Quasar is an open-source framework based on Vue.js that allows the creation of responsive websites and mobile applications for cryptocurrency wallets.

According to the Snyk Vulnerability Database, recent versions of Vue.js have vulnerabilities that allowed LNbits v0.11.0 to trigger cyclic errors in the quasar.umd.js code. The problem lies in the use of a weak pseudo-random number generator (PRNG), which makes it possible to obtain the SEED and recover the wallet’s private key, since the lib.getRandomValues method does not provide sufficient cryptographic strength.

Practical Part: Extracting the Private Key

For a practical demonstration, Jupyter Notebook or Google Colab is used.

  1. Google Colab is opened via a link and a new notebook is created.
  2. The Ruby language and necessary libraries for working with Bitcoin and cryptography are installed:
    • bitcoin-ruby – for interacting with the Bitcoin network
    • ecdsa – implementation of the ECDSA algorithm on elliptic curves
    • base58 – for converting numbers to base58 format
    • crypto – for basic cryptographic operations
    • config-hash – for working with large datasets
  3. The Metasploit Framework is installed, and the MSFVenom tool is used to create a payload.
  4. The vulnerable quasar.umd.js file is opened and the ExploitDarlenePRO exploit is downloaded.
  5. The IP address of the virtual machine (LHOST) for the attack is determined.
  6. MSFVenom is used to create a payload for the selected Bitcoin wallet (for example, 1qzgi39y33HrM7mHsZ6FaNspHCraJe62F).
  7. The result of the exploit is a binary string, which is saved to a file named binary.txt.
  8. The binary data is converted to hexadecimal (HEX) format to obtain the private key.
  9. The correspondence between the private key and the Bitcoin address is verified using the bitcoin library for Python.
  10. Result: the private key is successfully found and matches the wallet address, where a theft of $11,032.77 (0.30412330 BTC) was previously recorded.

Verification and Confirmation

To verify the correspondence of the private key, address, and WIF format, you can use the bitaddress service or a Blockchain Explorer.

This material was prepared for the CRYPTO DEEP TECH portal to improve financial security and protect data using elliptic curve cryptography secp256k1 against weak ECDSA signatures in the Bitcoin network. The developers are not responsible for the use of this material.

Source

Telegram: https://t.me/cryptodeeptech

Video: https://youtu.be/ZpflbzENAAw

Source: https://cryptodeeptech.ru/bitcoin-lightning-wallet-vulnerability


This image has an empty alt attribute; its file name is attacksafe-software-logo-1024x213.png
This image has an empty alt attribute; its file name is attacksafe-software-logo-1024x213.png