On the night of August 8, I recorded a series of targeted attacks on Lightning Network nodes deployed through the popular payment server BTCPay. The attackers gained unauthorized access to the nodes and completely drained their channels. BTCPay developers confirmed the exploitation of a critical vulnerability and strongly recommended that all LND server operators immediately update to version 2.4.2 or completely shut down their nodes until the circumstances are clarified.

The core issue: macaroon leakage

BTCPay Server is widely used by stores and services for self-custodial bitcoin acceptance without intermediaries, and integration with the Lightning Network enables processing micropayments. However, during my analysis, it turned out that the vulnerability is related to .macaroon authentication files, which provide applications with access to the LND node. Due to a configuration error, these files could be remotely retrieved without any authorization, giving the attacker full control over the node: closing channels, transferring funds, and manipulating balances.

It is important to emphasize: the issue affects exclusively configurations with LND — the most common software for Lightning nodes. Traditional hot bitcoin wallets in BTCPay were not affected, but funds held at the LND address are directly at risk, as the node is fully under the attacker's control.

Scope of the incident and first victims

The exact number of affected stores and the total damage have not yet been disclosed — the project team promises to provide a detailed report in the coming days. Nevertheless, at least two public confirmations of hacks are already known. Zack Herbert, CEO of hardware wallet manufacturer Foundation, reported that overnight his company lost all funds from the Lightning node deployed on BTCPay, while the on-chain wallet remained untouched. A similar incident was confirmed by the bitcoin publication Citadel21, whose node was also drained, although, according to its founder hodlonaut, the losses were insignificant thanks to foresight before activating BIP-110.

Notably, the vulnerability was discovered during an audit using artificial intelligence conducted by the volunteer organization Bitcoin Red Team. This group had previously launched a large-scale review of bitcoin project codebases using neural networks, generating thousands of reports on potential issues. It was their warning that partially mitigated the consequences, although it did not prevent the attacks.

My comment

This incident is another reminder that even the most popular self-custody solutions are not immune to code errors. Using AI for security audits is becoming not just a trend but a necessity, yet node operators should exercise heightened vigilance and respond promptly to updates. Against the backdrop of the recent theft of 594.48 BTC from Coldcard owners, the attack on BTCPay demonstrates that vulnerabilities can arise in the most unexpected places, and neglecting timely patches can be very costly.