Repository navigation
fix(tempo): never push for a charge whose request sets a memo (specs#403) - #1366
brendanjryan wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
👁️ Cyclops Security Review✅ Reviewed edcbfa7 (latest) · Coverage: partial ·
|
commit: |
| const requiredMemo = (methodDetails as { memo?: string | undefined } | undefined)?.memo | ||
| const supportedModes = ( | ||
| (methodDetails?.supportedModes as readonly Methods.ChargeMode[] | undefined) ?? [ | ||
| 'pull', | ||
| 'push', | ||
| ] | ||
| ).filter((mode) => !(requiredMemo && mode === 'push')) |
There was a problem hiding this comment.
Low (exposure unconfirmed): Tempo charge client funds memo push-only challenges it then refuses
The PR removes push from a Tempo charge's modes when the request sets a memo, but only inside createCredential. canHandleChallenge and the spending assert hook still accept a positive charge with a memo and supportedModes ['push'], so authorize and every funder run before the client throws 'Challenge supports no payment mode.'
Valid? React with 👍 / 👎.
Motivation
mpp-specs#403 defines the Tempo charge attribution memo and makes it required for push (
type="hash") payments. It also says that when a challenge's request setsmethodDetails.memo, servers MUST rejecttype="hash"credentials whateversupportedModescontains, and clients MUST NOT use them: a memo the server sets is shared by every payer of the route, so it can't bind a transfer the client broadcast to the client that claims it.mppx servers already follow the rest of the change (attribution memo layout, memo required for push, other-challenge attribution memos rejected for pull, the shared accepted-transfer record, access-key status), and they never issue
methodDetails.memo. But the client honors amethodDetails.memothat other MPP servers set and could still pay such a challenge by push (a JSON-RPC account prefers push, andsupportedModesdefaults to pull and push). That payment settles on chain and the server must then reject it.Summary
tempo.chargeclient: when the challenge's request setsmethodDetails.memo,pushis removed from the modes it considers, so it never pays by push (hash or Zone withdrawal) for that challenge.mode: 'push'for such a challenge throwsChallenge does not support push mode.; a push-only challenge throwsChallenge supports no payment mode.before anything is signed or sent; a JSON-RPC account pays by pull instead.Key design considerations
memo, so mppx servers never issue such a challenge and need no change.Propagated from tempoxyz/mpp-specs#403 (aeaeb8378a38adcb5696f6de9d570c26c08d6197) by Agricola.