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

musig_sessions: evict the oldest session when the storage is full

Public commit record

What the developer wrote

Authored by Salvatore Ingala

78/100 · Adequate
musig_sessions: evict the oldest session when the storage is full

Addresses the TODO by making sure that the oldest session is the evicted
one.

Each stored session now has a counter, larger than the counters of all
the other stored sessions; when there is no free slot, the session with
the smallest counter is evicted. To keep each session in a single 64-byte
NVRAM page, only the first 28 bytes of the psbt_session_id are stored.

The counter is enough for 2^32-1 sessions, so there is no practical risk
of overflow.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit changes how the Ledger Bitcoin app manages saved MuSig2 signing sessions in its limited persistent storage. Previously, when storage was full, the app would simply overwrite the first slot, which could discard a newer session instead of the oldest one. The fix adds an age counter so the oldest session is always evicted first. It also shrinks the stored session data to fit within a single memory page, storing only a 28-byte prefix of the session ID instead of the full 32 bytes. The commit itself treats this as a robustness improvement rather than a security fix, and there is no disclosed vulnerability or attacker benefit shown in the diff.

Recommended action

Treat as a normal code-quality and robustness improvement. Review whether the 28-byte prefix is acceptable for the application's collision resistance requirements, and confirm that counter persistence and NVRAM write wear are acceptable. No urgent security response is indicated by the supplied materials.

Security signals we found

01

Change in persistent storage eviction policy from first-slot overwrite to oldest-session eviction

02

Reduction of stored session identifier from 32 bytes to 28-byte prefix

03

Addition of monotonic counter to stored sessions

04

New regression test for storage-full eviction behavior

05

No mention of CVE, vulnerability, attacker, or security impact in commit message

Risk score

Why this scored 30/100

Our methodology →
Potential impact 8/30
Exploitability 4/25
Stealth signal 3/15
Affected reach 5/15
Confidence 7/10
Evidence quality 3/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.