What changed, and why it matters
This commit only updates a code comment. It corrects an estimated memory figure from 600 KB to 650 KB and removes an outdated claim that the cache limit protects against malicious memory exhaustion. The actual code behavior and the cache limit value (1000 derivations) do not change. There is no functional security fix or vulnerability being patched.
No action required. Reviewers may optionally verify that the 650 KB estimate is accurate, but the change is non-functional.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is purely documentation-only in src/seedsigner/models/psbt_parser.py. The MAX_CACHED_DERIVATIONS constant remains 1000 and no logic is modified. The comment is revised to more accurately describe memory usage (~650 KB instead of ~600 KB) and to drop the previous framing that the cap is a security boundary against malicious PSBT memory exhaustion, noting instead that the device is airgapped and stateless so the worst outcome is a power cycle. This is a clarification, not a code change.
Changed components
src/seedsigner/models/psbt_parser.py (comment only)Inspect captured patch +3 / −6
### src/seedsigner/models/psbt_parser.py
@@ -34,12 +34,9 @@ class PSBTParser():
"""
# Upper bound on how many levels of derivation a single parse will cache. 1000 is
- # just slightly under a 3-of-5 multisig consolidating 200 inputs and holds the cache
- # to a max of about 600 kilobytes. A psbt that requires more levels will still parse
- # correctly, but may have to derive some levels more than once. Capping the cache at
- # a realistic upper bound protects against a maliciously crafted psbt that would
- # otherwise consume unbounded memory while still providing cache wins for even
- # atypically large real-world psbts.
+ # just slightly under a 3-of-5 multisig consolidating 200 inputs, which costs roughly
+ # 650 kilobytes. A psbt that needs more levels than that still parses correctly; it
+ # just stops getting cache hits once the cache is full.
MAX_CACHED_DERIVATIONS = 1000
Why this scored 15/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.