fix(core): adding SECMON_MONOTONIC_VERSION counter to DISC2
What changed, and why it matters
This commit adds a new secure-monotonic version counter (SECMON_MONOTONIC_VERSION) to the Trezor Model Safe 3 (D002) hardware wallet's secret storage layout. Monotonic counters are used to prevent rollback attacks, where an attacker tries to downgrade the device to older, vulnerable firmware or bootloader. The change itself is a defensive hardening patch, not an exploitable vulnerability. However, because the commit is marked [no changelog] and provides minimal context, we cannot fully assess whether it fixes an incomplete earlier implementation or responds to a known security issue.
Treat as a hardening/fix commit. Review related secure-monitor code to confirm SECMON_MONOTONIC_VERSION is incremented and verified during boot, and ensure factory/upgrade migration handles the new counter region. Request a changelog or security note from the vendor because the change is security-relevant and [no changelog] reduces transparency.
Security signals we found
Addition of anti-rollback monotonic version counter for secure monitor
Secret storage layout change for hardware wallet secure element/secret area
No changelog entry provided despite security-relevant hardening
Additive patch; does not remove or modify existing counter region
Evidence from the diff
The patch defines SECRET_MONOTONIC_COUNTER_2_OFFSET/LEN in secret_layout.h and adds SECMON_MONOTONIC_VERSION in versions.h for the D002 model. This reserves a second monotonic-counter region in secret storage and initializes a dedicated version counter for the secure monitor (SECMON). Monotonic counters are typically incremented on firmware/bootloader updates and checked during secure boot to enforce anti-rollback. The change is small and additive; it does not alter existing offsets for SECRET_MONOTONIC_COUNTER_1, SECRET_BHK, or other secrets, so it appears backward-compatible for fresh devices. It is unclear from the diff alone whether existing devices need migration or whether the absence of this counter previously created a rollback gap.
Changed components
Trezor Core firmwareModel D002 (Safe 3) secret storage layoutSecure monitor (SECMON) boot/rollback logicInspect captured patch +4 / −0
diff --git a/core/embed/models/D002/secret_layout.h b/core/embed/models/D002/secret_layout.h
index 5db2ed5f..2e776a39 100644
--- a/core/embed/models/D002/secret_layout.h
+++ b/core/embed/models/D002/secret_layout.h
@@ -31,6 +31,9 @@
#define SECRET_MONOTONIC_COUNTER_1_OFFSET (0x410)
#define SECRET_MONOTONIC_COUNTER_1_LEN 0x400
+#define SECRET_MONOTONIC_COUNTER_2_OFFSET 0x810
+#define SECRET_MONOTONIC_COUNTER_2_LEN 0x400
+
// second page: refreshed on wallet wipe
#define SECRET_BHK_OFFSET 0x2000
#define SECRET_BHK_LEN 0x20
diff --git a/core/embed/models/D002/versions.h b/core/embed/models/D002/versions.h
index 42408b3d..8b93f26c 100644
--- a/core/embed/models/D002/versions.h
+++ b/core/embed/models/D002/versions.h
@@ -1,3 +1,4 @@
#define BOOTLOADER_MONOTONIC_VERSION 1
#define FIRMWARE_MONOTONIC_VERSION 1
+#define SECMON_MONOTONIC_VERSION 1
Why this scored 29/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.