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

fix(core): don't reuse `FORBIDDEN_KEY_PATH` exception object

Public commit record

What the developer wrote

Authored by Roman Zeyde

85/100 · Strong
fix(core): don't reuse `FORBIDDEN_KEY_PATH` exception object

Following https://github.com/trezor/trezor-firmware/issues/5472#issuecomment-3174382038.

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a subtle bug where the same error object was reused every time a forbidden key path was accessed. In Python/MicroPython, reusing a single exception instance can cause problems if something later modifies or inspects the raised error, because the same object carries state from one error site to another. The fix creates a fresh exception object each time, which is safer and more correct, but the commit message and diff do not clearly describe an active security vulnerability.

Recommended action

Treat as a low-risk defensive fix. Review the linked GitHub issue comment for any additional context, and verify that no other singleton exception objects are reused elsewhere in the firmware. No urgent user action is indicated.

Security signals we found

01

Reused mutable exception singleton replaced with per-call instance creation

02

Change affects path validation and key derivation access control

03

References GitHub issue comment, suggesting prior discussion of the pattern

04

No changelog entry, consistent with minor/internal fix

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.