Summary Two coupled gaps in MPP.Methods.Tempo.KeyAuthorization / MPP.Methods.Tempo.Subscription, both closed upstream by mppx #882 (commit 43ec92c, 2026-09-09, "fix: bind subscription authorizations…
Description
Two coupled gaps in MPP.Methods.Tempo.KeyAuthorization / MPP.Methods.Tempo.Subscription, both closed upstream by mppx #882 (commit 43ec92c, 2026-09-09, "fix: bind subscription authorizations to challenges"):
- No challenge binding (security). The payer signs a Tempo
KeyAuthorizationover[chainId, keyType, keyId, expiry, limits, scopes]only. Our verifier (KeyAuthorization.verify/3) pins chain id, access key, key type, expiry, limit and scopes against the subscription request, andSubscription.activate/4dedups activations by challenge id (activation_key/2—lib/mpp/methods/tempo/subscription.ex). The access key is a static per-endpoint server key (subscription_access_key_private_key), so the same signed authorization verifies against every challenge the server issues for the same subscription terms. Anyone who captures thekeyAuthorizationcredential (MITM on a non-TLS hop, a log, a compromised intermediary, the client's own retry buffer) can present it under a fresh challenge: the dedup key differs,claim_activationsucceeds,SubscriptionTransaction.build+ broadcast runs again, and the payer's wallet is charged a new first-period settlement and (re-)authorizes the server key. Bound only bysubscriptionExpiresand the chain's own keychain semantics for re-installing an existing key (not verified — treat as no guard). - Wire interop (functional, same fix). ox/tempo's
KeyAuthorizationtuple is[chainId, keyType, keyId, expiry, limits, calls, witness?, isAdmin?, account?](verified againstwevm/oxsrc/tempo/KeyAuthorization.tsfromTuple/AuthorizationTuple, fetched 2026-09-11 viagh api repos/wevm/ox/contents/src/tempo/KeyAuthorization.ts). Ourparse_authorization/1matches exactly six elements, so any authorization carrying the 32-bytewitness— which mppx clients now always emit for subscriptions (getSubscriptionChallengeWitness(challenge.id),src/tempo/subscription/KeyAuthorization.ts) — is rejected with "keyAuthorization contains unsupported or missing fields". Current mppx subscription clients cannot activate against our server.
mpp-rs has no subscription implementation, so ox + mppx are the only reference; ox is the Tempo wire authority.
Affected code
lib/mpp/methods/tempo/key_authorization.ex—parse_authorization/1(6-element match),verify/3(no witness / challenge check),wallet_params/2andfrom_rpc/1(no witness on the RPC path).lib/mpp/methods/tempo/subscription.ex—activate/4/activation_key/2(challenge-keyed dedup with a static access key).test/mpp/methods/tempo/subscription_test.exscovers replay for the same challenge only ("rejects a replayed activation credential for the same challenge"); there is no cross-challenge test.
Fix to port (mppx #882 shape)
- Codec: accept the trailing optional
witness(32 bytes),isAdmin(strictly0x01when present),account(20 bytes) elements per oxfromTuple; keep the signed digest = keccak(RLP(full authorization tuple)) —verify_signature/2already hashes the list as-is, so accepting 7+ elements makes the witness part of the signed payload automatically. - Verifier: require
authorization.witness == base64url-decode(challenge.id)(32 bytes; our challenge ids are HMAC-SHA256 so the size holds) and fail with "keyAuthorization challenge mismatch"; rejectisAdmin/account-bearing authorizations on the subscription path (not a subscription shape). - Wallet path: include
witnessinwallet_params/2and carry it throughfrom_rpc/1so server-drivenwallet_authorizeAccessKeyflows produce bound authorizations. - Tests: cross-challenge replay rejected; a real mppx-signed authorization (QuickBEAM
:cross_validation) verifies; Moderato integration activation with a witness-bound key. - Until the client side is updated, our built-in client (if/when it signs subscriptions) must emit the witness too.
Severity
Medium: requires capture of a credential in transit or at rest (AC:H), then causes repeated on-chain settlement against the payer (I:H on the payer's funds, bounded by the subscription limit per period and by subscriptionExpires). Suggested CVSS 3.1: AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N (5.9).
Disclosure
Draft until the fix ships; publish with the patched release per SECURITY.md. Found by the 2026-09-11 sdk-delta-watch sweep (mppx #882).