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

attestation: misc cleanups

Public commit record

What the developer wrote

Authored by Jon Griffiths

75/100 · Adequate
attestation: misc cleanups

- fix SENSITIVE_POP in attestation_initialise()
- fix attestation_can_be_initialised() with CONFIG_DEBUG_MODE
- avoid uneeded reloads of attestation data
- ensure keys are always initialized before being freed
- allocate attestation data on the heap to avoid stack overflow

Co-authored-by: Daniel Newton <dnewton@blockstream.com>
✓ Descriptive subject✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit is a cleanup of the device attestation code in Blockstream Jade, which is the cryptographic proof that the device is genuine. The changes fix a memory-management bug where sensitive key data could be cleared in the wrong order, correct a logic issue when debug mode is enabled, avoid repeatedly reloading attestation data from storage, ensure cryptographic keys are initialized before being freed, and move a large attestation data structure from the stack to the heap to prevent a possible stack overflow. Most changes are defensive hardening, but the SENSITIVE_POP ordering and the debug-mode logic fix are genuine security-relevant corrections.

Recommended action

Treat as a security-hardening commit with at least one concrete bug fix (SENSITIVE_POP ordering and debug-mode logic). Review whether the old SENSITIVE_POP ordering could have left hmac_key material uncleared on error paths, and confirm that the debug-mode-only build now correctly reports attestation state. No immediate emergency response is warranted, but the commit should be included in the next firmware release.

Security signals we found

01

fix SENSITIVE_POP in attestation_initialise() - sensitive-data handling ordering

02

fix attestation_can_be_initialised() with CONFIG_DEBUG_MODE - conditional compilation logic

03

ensure keys are always initialized before being freed - mbedtls_pk_init added

04

allocate attestation data on the heap to avoid stack overflow

05

avoid uneeded reloads of attestation data - reduces attack surface and TOCTOU exposure

Risk score

Why this scored 42/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/15
Affected reach 7/15
Confidence 6/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.