Skip to content

test(solana): plain-text SignMessage signs without AdvancedMode - #106

Merged
BitHighlander merged 8 commits into
alphafrom
fix/solana-text-message-no-advanced-mode
Sep 19, 2026
Merged

BitHighlander merged 8 commits into
alphafrom
fix/solana-text-message-no-advanced-mode

Conversation

@BitHighlander

Copy link
Copy Markdown
Owner

Tests for BitHighlander/keepkey-firmware#816.

  • test_solana_sign_message_blocked_without_advanced_mode: the payload changes from b"Hello Solana!" to a binary tx-message header. Text is now allowed, and binary stays blocked on every firmware.
  • New test_solana_sign_plain_text_message_without_advanced_mode (gated at 7.16.0): a SIWS-style login signs with AdvancedMode off.

Branched from f5268a1, the commit firmware alpha currently pins, so the firmware pin bump carries only this change.

@BitHighlander
BitHighlander force-pushed the fix/solana-text-message-no-advanced-mode branch from 6aab51a to 91ac8bf Compare September 18, 2026 02:56
BitHighlander added a commit to BitHighlander/keepkey-firmware that referenced this pull request Sep 18, 2026
Raw SolanaSignMessage required AdvancedMode for every payload, so each
dApp login (SIWS / solana:signMessage) switched on session-wide blind
signing. A transaction signature only verifies when the signer's key is
in the message's static account keys, so printable text that never
contains the key cannot authorize a transaction. Such messages are now
reviewed as text without AdvancedMode; everything else keeps the gate
and the raw-bytes review.

Pins python-keepkey 91ac8bf (BitHighlander/python-keepkey#106).

Closes #816
31d8c27 regenerated messages_pb2.py and messages_ethereum_pb2.py with a
host protoc (builder-style, needs protobuf >= 3.20) instead of
docker_build_pb.sh. The firmware integration container runs Python
3.6.9 / protobuf 3.17.3, so every python-integration-tests job failed
at import: "cannot import name 'builder'".

Regenerated via build_pb.sh inside the CI-pinned firmware image
(protoc 3.5.1). Serialized descriptors are byte-identical to the
builder files (messages 14590 B, ethereum 3046 B, types 4686 B).
test_erc7730_protocol_bindings + test_message_signing_protocol_bindings:
8 passed on protobuf 3.17.3 (py3.6, CI image) and 3.20.3. setup.py
range narrowed to what was tested: protoc-3.5.1 code does not load on
protobuf >= 4.21.
The authoritative-network guard allowed loopback only. In firmware CI
the emulator is the compose service kkemu (KK_TRANSPORT_MAIN=
kkemu:11044), so all 616 emulator tests failed with 'attempted external
network access'. Allow exactly the KK_TRANSPORT_MAIN / KK_TRANSPORT_DEBUG
endpoints (and their resolved addresses), as the audit line does; every
other destination is still denied. test_tx_fixture_integrity: 5 passed.
@BitHighlander
BitHighlander force-pushed the fix/solana-text-message-no-advanced-mode branch from 91ac8bf to ef26cdf Compare September 18, 2026 06:11
BitHighlander added a commit to BitHighlander/keepkey-firmware that referenced this pull request Sep 18, 2026
Raw SolanaSignMessage required AdvancedMode for every payload, so each
dApp login (SIWS / solana:signMessage) switched on session-wide blind
signing. A transaction signature only verifies when the signer's key is
in the message's static account keys, so printable text that never
contains the key cannot authorize a transaction. Such messages are now
reviewed as text without AdvancedMode; everything else keeps the gate
and the raw-bytes review.

Pins python-keepkey ef26cdf (BitHighlander/python-keepkey#106).

Closes #816
- conftest: port pytest_collection_modifyitems from the audit line.
  Firmware CI passes KEEPKEY_SCREENSHOT_TESTS (188 report selectors); pyk
  alpha ignored it, so the screenshot phase ran all ~758 tests and the
  full-variant job hit its 30-minute limit.
- test_msg_zcash_transparent_shielding: bitcoin-only builds have no Zcash
  (KK_ZCASH_PRIVACY OFF) and answer "Unknown message"; skip the class
  there, closing the transport via addCleanup since skipTest in setUp
  bypasses tearDown.
Firmware alpha (6816915a3) replaced direct dice entry with a host-selected
mode and an on-device consent screen, then shows the device's 24 words
before any roll. That firmware pinned python-keepkey f00e62f; a later
re-pin to b44f1b3 (this alpha line) dropped the matching test, so
test_reset_device_dice acked the consent screen as roll input and the
device answered "Reset cancelled".

Rewrite the test body for consent -> device words -> rolls -> digest
confirm, and check the mnemonic against the published MIXED formula
(device words + rolls; EntropyAck bytes excluded). Seed helpers and the
requires_dice_modes capability gate come from f00e62f. Same test name,
same two captures the report declares.
Firmware refuses a 68-byte approve(spender, 2^256-1) with "Unlimited ERC20
approval is disabled" (release-line policy since 7.14.2). This alpha line
still expected signatures, so three tests failed on every full-variant run.
Take the audit-line versions (f00e62f) that assert the refusal:
test_approve_all, test_sign_uni_approve_liquidity_ETH, and the
erc20-approve-unlimited clear-sign flow. Adds common.firmware_at_least.
Firmware authenticates before showing the SignMessage confirm since
7.14.2; this alpha line still expected the old order. Take the audit-line
version (f00e62f), which gates the order on firmware_at_least.
The blocked-without-AdvancedMode case now uses a binary payload, so it
holds on every firmware. New 7.16.0 case: a SIWS-style text login signs
with AdvancedMode off (BitHighlander/keepkey-firmware#816).
@BitHighlander
BitHighlander force-pushed the fix/solana-text-message-no-advanced-mode branch from ef26cdf to bd69520 Compare September 19, 2026 02:56
BitHighlander added a commit to BitHighlander/keepkey-firmware that referenced this pull request Sep 19, 2026
Raw SolanaSignMessage required AdvancedMode for every payload, so each
dApp login (SIWS / solana:signMessage) switched on session-wide blind
signing. A transaction signature only verifies when the signer's key is
in the message's static account keys, so printable text that never
contains the key cannot authorize a transaction. Such messages are now
reviewed as text without AdvancedMode; everything else keeps the gate
and the raw-bytes review.

Pins python-keepkey bd69520 (BitHighlander/python-keepkey#106).

Closes #816
@BitHighlander
BitHighlander merged commit 52aed5d into alpha Sep 19, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant