AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 56 Bitcoin

Avoid re-locking same UTXO future

Public commit record

What the developer wrote

Authored by Elias Rohrer

68/100 · Adequate
Avoid re-locking same UTXO future

UtxoLookup implementations may cache and return the same async future
for repeated requests for a short channel id. When a replacement channel
announcement arrives while that future is in-flight, the pending-entry
comparison may point back to the future state already held by the async
path.

Detect that case with Arc::ptr_eq inside check_replace_previous_entry
and compare against the held messages instead of taking the mutex again.
This keeps duplicate-announcement filtering intact while letting
replacement announcements update the pending entry without re-entering
the lock.

Co-Authored-By: HAL 9000

This finding was discovered by Project Loupe
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a potential deadlock in how Lightning Dev Kit handles repeated lookups of the same short channel ID. When a custom UTXO lookup service returns the same in-flight future object for repeated requests, and a replacement channel announcement arrives during that lookup, the code could try to lock the same data twice. The patch detects when the pending entry refers to the already-held future state and compares messages without re-acquiring the lock, preventing deadlock while still filtering duplicate announcements.

Recommended action

Review and merge the patch, then ensure any downstream users running custom UtxoLookup implementations with async futures update to this version. No immediate incident response is indicated, but denial-of-service via deadlock should be considered in threat models for nodes using custom UTXO sources.

Security signals we found

01

Potential self-deadlock in async UTXO lookup path

02

Re-entrant mutex lock on same Arc<Mutex<UtxoMessages>>

03

Custom UtxoLookup returning cached future could trigger lock ordering violation

04

Replacement channel announcement handling interacts with pending async state

05

Regression test added for deadlock avoidance

Risk score

Why this scored 56/100

Our methodology →
Potential impact 18/30
Exploitability 10/25
Stealth signal 8/15
Affected reach 9/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.