Repository navigation
fix(transport): pin Nostr verification-cache security fixes - #2912
Conversation
Reject tampered content and invalid signatures on SDK verification-cache hits by adopting the narrowly backported upstream fixes. Preserve all dependency and workspace versions. Related to mdk#2521; independent live-directory identity validation remains pending.
|
No actionable comments were generated in the recent review. WalkthroughThe workspace and adapter now pin a newer Nostr fork revision. The changelog describes its cached-event verification update and notes that the live-directory identity check remains pending. ChangesNostr SDK verification-cache update
Estimated code review effort: 2 (Simple) | ~8 minutes Possibly related issues
Possibly related PRs
Merge Risk:
|
Problem
MDK's pinned SDK accepts an event on a verification-cache hit without authenticating its current bytes or signature. A relay can reuse a verified ID with altered directory metadata or an invalid signature, affecting the live-directory boundary tracked in #2521.
Fix
Pin a fork revision that backports both upstream verification-cache fixes onto MDK's exact previous revision. Every event's content must match its ID, and skipping signature verification requires the exact previously verified signature; different valid signatures remain accepted. All dependency and workspace versions stay unchanged.
Verification
just precommitpassed.cargo fmt --all.just fast-ciran once; its Apple mock-build test fails with an inheritedCARGO_TARGET_DIR, reproduced on merge-basec4b60b2de. The other static gates passed.env -u CARGO_TARGET_DIR python3 crates/marmot-uniffi/test-release-profile.py ReleaseProfileTests.test_apple_builders_keep_symbols_and_builder_owned_profilepassed (mock Cargo only).just clippy test-convergence-policy-pincompleted the remaining fast-ci gates, including both workspace lint passes.cargo test -p transport-nostr-adapter --locked— 254 passed.cargo test -p transport-nostr-adapter --features sdk --locked— 467 passed.cargo nextest run -p transport-nostr --all-features --locked— 143 passed.cargo nextest run -p cgka-conformance-simulator --locked --test app_runtime_journeys --test process_orchestrator -E 'test(=public_app_03_late_join_and_messaging) | test(=engine_app_runtime_and_process_adapters_reach_equivalent_public_state)'— 2 passed.cargo nextest run -p wn-cli --locked --test cli --features test-policy-overrides -E 'test(=local_group_message_workflow_runs_through_the_dm_contract) | test(=daemon_start_status_execute_and_stop_are_user_facing_commands)'— 2 passed.46e214d6b, covering the MDK diff and the complete fork backport.Fork pin:
a8efab6d23846d044746def3dc2766fd1a7e227c, oncodex/mdk-verification-cache-security, based directly on48801bf6. Ports upstream0e08c306and mergeda991ff00(upstream #1508), retaining the fork's SharedState structure.Related to #2521. This PR leaves that issue open: MDK's independent live-directory identity check is still wanted.
Summary by CodeRabbit