chore: init otp-display-grant plan#84
Draft
lwin-kyaw wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
chore: document OTP display grant plan for untrusted connections
Description
ADDED:
requireOtpDisplayGrantflow for untrusted dapp-wallet connections.handshake-offer, and complete a session if the user enters an OTP matching the attacker-controlled offer.CHANGED:
Issue
In the current untrusted flow, the wallet displays the OTP before the dapp has accepted a specific
handshake-offer. In a same-room scenario, an attacker can scan the same QR code, front-run the real wallet with an attacker-controlled offer, and potentially cause the dapp to bind to the attacker session if the user enters an OTP matching that offer.Solution
The proposed strict flow adds an opt-in
requireOtpDisplayGrantmode. When enabled, the wallet generates the OTP but does not display it immediately. The wallet sends ahandshake-offerindicating OTP display grant support, and the dapp sends an encryptedotp-display-grantonly to the accepted provisional session channel. The wallet displays the OTP only after receiving that grant.This means a front-running attacker may still cause a timeout or denial of service, but the real wallet will not reveal an OTP for a session the dapp did not accept, preventing the practical OTP-copy session hijack.
New Strict Flow
SessionRequestwithcapabilities.otpDisplayGrant = true.display_otp.handshake-offerwithotpDisplayGrantRequired: true.requireOtpDisplayGrantis true and the offer lacksotpDisplayGrantRequired, dapp rejects.otp-display-grantto the wallet's proposed session channel.display_otp.handshake-ack.Checklist