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

feat(core): add extended formatting capabilities to snprintf

Public commit record

What the developer wrote

Authored by cepetr

62/100 · Adequate
feat(core): add extended formatting capabilities to snprintf

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
The short version

What changed, and why it matters

This commit replaces Trezor's small, home-grown printf-style string formatter with a more capable third-party library (eyalroz/printf). The change is described as adding 'extended formatting capabilities' and is marked with '[no changelog]'. The new library supports more format specifiers, including the %n specifier, which can write back into caller-provided memory. Trezor's configuration enables %n support. Because this is a low-level runtime component used across bootloader, firmware, kernel, secure monitor, and production-test builds, any bug in the new formatter could have broad consequences. However, the commit itself does not fix a known vulnerability, and there is no vendor statement that this change is security-relevant.

Recommended action

Treat this as a significant runtime change requiring focused review and testing. Audit all call sites that pass user-influenced or untrusted format strings or arguments to mini_snprintf/mini_vsnprintf (now backed by eyalroz/printf). Verify that enabling %n is intentional and that no attacker-controlled pointer can reach it. Run the project's formatter test suite against the new implementation, including edge cases for width, precision, length modifiers, and %n. Consider disabling %n if it is not required. Review whether the new floating-point code paths, though disabled, could be enabled by future configuration changes or build mistakes.

Security signals we found

01

Replacement of a minimal, auditable snprintf implementation with a larger third-party library increases attack surface and code complexity.

02

New printf_config.h explicitly enables PRINTF_SUPPORT_WRITEBACK_SPECIFIER (%n), which can write to caller-supplied pointers and is historically considered dangerous.

03

Floating-point support is disabled in config, but the source still contains extensive floating-point parsing/formatting code that could be compiled if config macros change.

04

The change touches every firmware variant (boardloader, bootloader, bootloader_ci, bootloader_emu, firmware, kernel, prodtest, prodtest_emu, secmon, unix), so any formatter bug has wide reach.

05

No changelog entry and no security disclosure in commit message or diff.

Risk score

Why this scored 39/100

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