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

Use write! in UnknownAddressTypeError display

Public commit record

What the developer wrote

Authored by Mitchell Bagot

73/100 · Adequate
Use write! in UnknownAddressTypeError display

The write_err! macro is intended to provide source information for
errors in no_std environments. Where an error type does not have a
source, the write! macro should be used instead.
For UnknownAddressTypeError specifically, the use of write_err! causes
a stack overflow as it recurses infinitely to attempt to display self
as the source in write_err! in no_std builds.

Replace use of write_err! with write! in UnknownAddressTypeError
Display impl.
✓ 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 fixes a bug where displaying a specific error message in Bitcoin address parsing could cause the program to crash with a stack overflow. The crash only happens in 'no_std' builds (a special configuration without the standard library). The fix replaces an incorrect macro with the correct one so the error message is shown without trying to endlessly include itself as its own source.

Recommended action

Apply the patch and audit other Display implementations for similar misuse of write_err! where no source error exists, especially in no_std code paths. Consider adding a regression test that formats UnknownAddressTypeError in a no_std build.

Security signals we found

01

Denial of service via stack overflow

02

Infinite recursion in error Display implementation

03

no_std-specific vulnerability

04

Error-handling path triggered by malformed/unrecognized address type input

Risk score

Why this scored 35/100

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