Skip to content

fix(tempo): never push for a charge whose request sets a memo (specs#403) - #1366

Open
brendanjryan wants to merge 1 commit into
mainfrom
agricola/specs-403
Open

brendanjryan wants to merge 1 commit into
mainfrom
agricola/specs-403

Conversation

@brendanjryan

Copy link
Copy Markdown
Collaborator

Source: tempoxyz/mpp-specs#403 (merge commit aeaeb83)

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 sets methodDetails.memo, servers MUST reject type="hash" credentials whatever supportedModes contains, 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 a methodDetails.memo that other MPP servers set and could still pay such a challenge by push (a JSON-RPC account prefers push, and supportedModes defaults to pull and push). That payment settles on chain and the server must then reject it.

Summary

  • tempo.charge client: when the challenge's request sets methodDetails.memo, push is removed from the modes it considers, so it never pays by push (hash or Zone withdrawal) for that challenge.
  • An explicit mode: 'push' for such a challenge throws Challenge does not support push mode.; a push-only challenge throws Challenge supports no payment mode. before anything is signed or sent; a JSON-RPC account pays by pull instead.
  • Tests cover all three cases.

Key design considerations

  • Client-only: the mppx server request schema doesn't accept memo, so mppx servers never issue such a challenge and need no change.
  • No public API change; the memo still goes on the primary transfer as before.

Propagated from tempoxyz/mpp-specs#403 (aeaeb8378a38adcb5696f6de9d570c26c08d6197) by Agricola.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T15:22:32.558512Z edcbfa7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tempoxyz-bot

tempoxyz-bot commented Nov 25, 2026 •

Copy link
Copy Markdown

👁️ Cyclops Security Review

✅ Reviewed edcbfa7 (latest) · Coverage: partial · ⚠️ 1 open finding · report
⚠️ Not checked: The mpp-specs#403 text was not available in the bundle, so whether a present-but-empty 'methodDetails.memo' counts as a set memo, and whether clients must reject it outright, is not confirmed.
⚠️ Not checked: No evidence that any deployed MPP server emits a falsy non-nullish 'methodDetails.memo'; mppx servers cannot emit the field at all.
⚠️ Not checked: The funding callback is reachable before refusal, but no deployed funder, fee schedule, authorization policy or funding rate limit was supplied.
⚠️ 8 more unchecked questions are listed in the report
ℹ️ Not verifiable from the source alone (needs running code or deployed state): No repository test or build was executed: 'node_modules' is absent and the repository must not be modified. The finding rests on a source trace plus a standalone Node replica of the two expressions, n (4 more in the report)

# Severity Finding Introduced Status
1 🟢 Low Tempo charge client funds memo push-only challenges it then refuses edcbfa7 🟠 Open

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/mppx@1366

commit: edcbfa7

Comment on lines +159 to +165
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'))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍 / 👎.

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.

2 participants