gabriel / muse public
BREAKING dev
AI Agent gabriel · 162 days ago · Apr 17, 2026 · Diff

security: mnemonic_to_seed returns bytearray; zero seeds at all call sites

- mnemonic_to_seed() return type bytes -> bytearray so callers can wipe the 64-byte root seed from heap after use (previously immutable, never zeroable) - All auth.py call sites zero operator_seed, agent_sub_seed, and seed immediately after last use (generate_hd_keypair / derive_agent_sub_seed) - Add tests/test_seed_zeroing.py (5 tests: return type, mutability, determinism, length, passphrase variant) — RED before this commit - Add tests/test_agent_sub_seed_zeroing.py (5 tests: return type, mutability, intermediates zeroed, determinism, length) — validates prior commit too

sha256:1b7335af1da84059c62c6657ca0925e250ead304ce925c7b7ad469ad5501ecd4 sha
+31 ~5 symbols
sha256:8f1d86346b2e89393e5d570a22bbc05e16ae92051fbe6b498059aa3e404c6d1b snapshot
+31
symbols added
~5
symbols modified
0
dead code introduced
Semantic Changes 36 symbols
~ tests/test_agent_sub_seed_zeroing.py .py 19 symbols added
+ TestCallerCanZero class class TestCallerCanZero L67–73
+ test_II1_returned_bytearray_is_mutable method method test_II1_returned_bytearray_is_mutable L68–73
+ TestCorrectness class class TestCorrectness L118–129
+ test_IV1_deterministic method method test_IV1_deterministic L119–124
+ test_IV2_length_64 method method test_IV2_length_64 L126–129
+ TestIntermediatesZeroed class class TestIntermediatesZeroed L80–111
+ test_III1_all_derived_keys_zeroed_on_return method method test_III1_all_derived_keys_zeroed_on_return L81–111
+ TestReturnType class class TestReturnType L54–60
+ test_I1_returns_bytearray method method test_I1_returns_bytearray L55–60
+ _MNEMONIC variable variable _MNEMONIC L43–46
+ _SEED variable variable _SEED L47–47
+ DOMAIN_IDENTITY import import DOMAIN_IDENTITY L40–40
+ DerivedKey import import DerivedKey L41–41
+ annotations import import annotations L34–34
+ call import import call L36–36
+ derive_agent_sub_seed import import derive_agent_sub_seed L40–40
+ mnemonic_to_seed import import mnemonic_to_seed L39–39
+ patch import import patch L36–36
+ pytest import import pytest L37–37
~ tests/test_seed_zeroing.py .py 12 symbols added
+ TestCallerCanZero class class TestCallerCanZero L56–62
+ test_II1_returned_bytearray_is_mutable method method test_II1_returned_bytearray_is_mutable L57–62
+ TestCorrectness class class TestCorrectness L69–87
+ test_III1_deterministic method method test_III1_deterministic L70–74
+ test_III2_length_64 method method test_III2_length_64 L76–79
+ test_III3_passphrase_produces_different_seed method method test_III3_passphrase_produces_different_seed L81–87
+ TestReturnType class class TestReturnType L43–49
+ test_I1_returns_bytearray method method test_I1_returns_bytearray L44–49
+ _MNEMONIC variable variable _MNEMONIC L33–36
+ annotations import import annotations L27–27
+ mnemonic_to_seed import import mnemonic_to_seed L31–31
+ pytest import import pytest L29–29
~ muse/core/bip39.py .py 1 symbol modified
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:1b7335af1da84059c62c6657ca0925e250ead304ce925c7b7ad469ad5501ecd4 --body "your comment"