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

SFT-8249: escape PSBT error text before displaying it

Public commit record

What the developer wrote

Authored by Jack

81/100 · Strong
SFT-8249: escape PSBT error text before displaying it

Labels render with LVGL recolor enabled, so a literal '#' in displayed text
opens a colour tag and the characters after it are consumed as a hex code
without being drawn. psbt.py raises a dozen messages shaped like "... for
input #3", and the index is the most useful part of them.

deef57bc escaped the transaction warnings for SFT-6782 and did not sweep the
error paths beside them, so 'Invalid PSBT: {}'.format(e) still lost characters.
Both sites now route through invalid_psbt_text(), which gives the escaping one
owner in this flow and makes it testable the way render_output() already is.

Scope is deliberately narrow. ErrorPage has 141 call sites, many passing
variables, so escaping inside ErrorPage would change behaviour across the whole
module tree at once. Error text arguably should never carry markup, but that is
a separate change and a separate review.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a display bug in the Passport hardware wallet where error messages about Bitcoin transaction files (PSBTs) could have important text hidden from the user. The device's screen library treats a '#' character as the start of a color command, so an error like 'problem with input #3' would show only 'problem with input ' and hide the number. The fix escapes the '#' so the full message appears. It is a user-interface reliability fix rather than a direct theft-of-funds vulnerability, but missing error details could mislead a user during transaction signing.

Recommended action

Treat this as a low-severity UI hardening fix. Merge the patch, then consider a broader audit of ErrorPage and other label text paths for similar unescaped '#' or markup characters, as the commit deliberately narrows scope to avoid behavior changes across 141 call sites.

Security signals we found

01

UI markup injection / display corruption via unescaped '#' in LVGL recolor mode

02

Loss of security-relevant numeric context (input index) in PSBT error messages

03

Prior partial fix (deef57bc) left additional error path unescaped

04

New centralized escaping helper improves testability and maintainability

05

Unit tests added for escaping behavior

Risk score

Why this scored 38/100

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