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

cbor: avoid passing null to memcpy with len 0 in tinycbor

Public commit record

What the developer wrote

Authored by Jon Griffiths

50/100 · Thin
cbor: avoid passing null to memcpy with len 0 in tinycbor

Found by asan.
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a low-level memory-handling issue in Blockstream Jade's CBOR encoding helper. When adding an empty byte string to a data map, the code previously could pass a null pointer to a memory-copy routine. The fix substitutes a dummy non-null pointer when the data length is zero, avoiding undefined behavior detected by AddressSanitizer. It is a defensive hardening change rather than a confirmed exploitable vulnerability.

Recommended action

Treat as a hardening fix. Merge the patch and consider whether the same pattern exists elsewhere when encoding zero-length byte strings. No immediate incident response is warranted absent evidence of exploitable behavior beyond the undefined-behavior sanitizer finding.

Security signals we found

01

Null pointer passed to memcpy-like routine with zero length (undefined behavior)

02

Fix gated by CONFIG_LIBJADE build flag

03

Detected by AddressSanitizer (asan)

04

Defensive hardening in CBOR RPC serialization path

Risk score

Why this scored 31/100

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