mpp pay always fails against mppx >= 0.15 servers: "MPP challenge changed after approval" (per-challenge nonce in opaque is not excluded from the comparison)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
Start in comparableChallenge in link-cli, which the issue identifies as neutralizing id and expires before the approved challenge is compared with a fresh probe. Read the challenge serialization and approval comparison flow, including payPinnedChallengeWithSpt and runMppPayFullFlow. Reproduce with an mppx 0.15 server and verify the same approved payment succeeds when only issuance metadata differs.
索引モデルが issue の本文から書いたものです。
説明
Summary
Against a seller using mppx 0.15.0 (Stripe SPT charge), link-cli mpp pay can never complete a payment. After the spend request is approved, link-cli re-probes the endpoint and compares the fresh 402 challenge to the approved one. mppx adds fresh random issuance metadata (_mppx_nonce) to every challenge's opaque field by design, so the comparison always fails:
Error: MPP challenge changed after approval; refusing to use the approved payment credential
The amount, currency, realm, method, intent, request, and description are identical between the two challenges. Only id, expires, and the nonce in opaque differ.
Versions
@stripe/link-cli0.30.0mppx0.15.0 (server:Mppxfrommppx/server/corewithstripe.spt(...)frommppx/stripe/server/spt)- Node.js 20 and 24, Stripe test mode,
--test
Steps to reproduce
- Run an MPP endpoint with mppx 0.15.0 and a Stripe SPT charge, for example
mppx.charge({ amount: '0.75', currency: 'usd', decimals: 2 })(request). link-cli mpp pay <url> --method POST --data '<json>' --test --context "<100+ chars>"- Approve the spend request in Link.
- Run the returned
_next.pay_argv(mpp pay <url> --spend-request-id <id> --approved-challenge '<challenge>' ...). - It fails with the error above. The interactive (TTY) flow fails the same way, because
runMppPayFullFlowalso ends inpayPinnedChallengeWithSpt(probe, spt, approvedChallenge).
Cause
comparableChallenge in link-cli only neutralizes id and expires:
function comparableChallenge(challenge) {
return Challenge2.serialize({ ...challenge, id: "approval-comparison", expires: void 0 });
}
mppx adds a fresh nonce to every issued challenge (server/internal/challengeMeta.js):
/** Reserved metadata key for HMAC-bound, per-issuance challenge randomness. */
const nonceKey = '_mppx_nonce';
export function withNonce(meta) { return { ...meta, [nonceKey]: Secp256k1.randomPrivateKey() }; }
/** Removes issuance-only metadata when comparing stable route requirements. */
export function routeMeta(meta) { const { [nonceKey]: _, ...rest } = meta ?? {}; ... }
withNonce is applied in server/Mppx.js when challenges are created, so two challenges for the same route are never byte-identical. mppx's own routeMeta() shows the intended comparison: strip _mppx_nonce.
Suggested fix
In comparableChallenge, also drop issuance-only metadata from opaque, specifically the _mppx_nonce key, mirroring mppx's routeMeta(). Alternatively, compare only the fields the shopper actually approved (realm, method, intent, decoded request: amount, currency, network ID, external ID).
Workaround
The approved token itself is valid. Retrieving it with spend-request retrieve <id> --include shared_payment_token and paying a fresh challenge with the mppx client (stripe.charge({ createToken: () => spt })) succeeds. The SPT's own limits (amount, network ID, expiry) still apply.
- 主要言語
- TypeScript
- スター
- 873
- フォーク
- 147
- 平均マージ
- 23時間 53分
- マージ済み PR(30日)
- 76
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stripe/link-cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
`balances list` renders non-USD balances with a `$` symbol and a fixed `/100`対応中かも @RaphaelFakhri が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
stripe/link-cli#479 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
stripe/link-cli の issue をすべて見る
似ている issue
-
calcite-ui-icons enhancement impact - p3 - not time sensitive needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Esri/calcite-design-system#15467 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
diegosouzapw/OmniRoute#18390 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
guilhermerodz/input-otp#157 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
davidjerleke/embla-carousel#1414 ·
メンテナーはふだん 4 日以内に返信