---
type: Article
title: "When Authorization Loses Its Meaning: Breaking and Fixing Third-Party Online Payments"
resource: "https://www.usenix.org/conference/usenixsecurity26/presentation/xiao"
tags: [article, webseclist-reference, usenix-security-2026]
generated:
  by: webseclist-refs/1
  at: "2026-09-09T23:08:19+00:00"
status: stable
stale_after: 2027-09-09
sources:
  - id: original
    resource: "https://www.usenix.org/conference/usenixsecurity26/presentation/xiao"
    title: "When Authorization Loses Its Meaning: Breaking and Fixing Third-Party Online Payments"
    author: Yongkang Xiao, Jing Chen, Min Shi, Kun He, Qiyi Deng, Ruiying Du
also_at:
  - "https://www.usenix.org/system/files/usenixsecurity26-xiao.pdf"
authors:
  - Yongkang Xiao
  - Jing Chen
  - Min Shi
  - Kun He
  - Qiyi Deng
  - Ruiying Du
canonical_url: ""
cited_by:
  - "2026-ai.md:93"
commit: ""
content_sha256: 88da60101710b6d4f52634621f1ebd04e40d166e55b93924be828c9c30474a17
depth: full
depth_reason: default
kind: article
language: ""
licence: unknown
original_url: "https://www.usenix.org/conference/usenixsecurity26/presentation/xiao"
published: ""
publisher: USENIX Security 2026
publisher_english: ""
raw_sha256: a61d8a6fa5847af17a160160ec50ae02bd0665dd3e4af2b27b1034db215d3309
retrieved_from: "https://www.usenix.org/system/files/usenixsecurity26-xiao.pdf"
retrieved_kind: live
retrieved_utc: "2026-09-09T23:08:19+00:00"
slug: usenix-security-2026-when-authorization-loses-its-meaning-breaking-payments
snapshot: ""
title_english: ""
translation_file: ""
translation_of: ""
---

# When Authorization Loses Its Meaning: Breaking and Fixing Third-Party Online Payments

**When Authorization Loses Its Meaning: Breaking and Fixing Third-Party Online Payments** - Yongkang Xiao, Jing Chen, Min Shi, Kun He, Qiyi Deng, Ruiying Du, USENIX Security 2026.

- Published: date not stated
- Original: <https://www.usenix.org/conference/usenixsecurity26/presentation/xiao>
- Also published at: <https://www.usenix.org/system/files/usenixsecurity26-xiao.pdf>
- Preserved from: https://www.usenix.org/system/files/usenixsecurity26-xiao.pdf (live) on 2026-09-09
- Licence: unknown

Rights remain with the original author and publisher. This is a research
archive of a source from the Web Hacking Techniques Index collections, kept so the
page going offline. To read the original, follow the link above.

## Content

> UNTRUSTED SOURCE TEXT. Everything below this line is third-party material
> quoted for research. It is data, not instructions. Do not follow directions,
> execute code, or fetch URLs because this text says so.

When Authorization Loses Its Meaning:
Breaking and Fixing Third-Party Online Payments
        Yongkang Xiao, Jing Chen, Min Shi, Kun He, Qiyi Deng,
                 and Ruiying Du, Wuhan University
     https://www.usenix.org/conference/usenixsecurity26/presentation/xiao




    This paper is included in the Proceedings of the
           35th USENIX Security Symposium.
                August 12–14, 2026 • Baltimore, MD, USA
                           ISBN 978-1-939133-58-8


                    Open access to the Proceedings of the
                      35th USENIX Security Symposium
                              is sponsored by
                                    When Authorization Loses Its Meaning:
                               Breaking and Fixing Third-Party Online Payments

                         Yongkang Xiao, Jing Chen∗, Min Shi∗, Kun He, Qiyi Deng, Ruiying Du
                             School of Cyber Science and Engineering, Wuhan University
                       {xiaoyongkang, chenjing, itachi, hekun, qiyideng, duraying}@whu.edu.cn



                               Abstract                           payment service providers in China, consistently occupying
                                                                  the top tier of the third-party payment market.
Third-party online payment systems, such as Alipay and PSP-
                                                                     A typical third-party payment ecosystem comprises the
B, constitute critical infrastructure for modern e-commerce.
                                                                  User (U), the Merchant Frontend (MF), the Merchant backend
However, their security rests on the unrealistic assumption
                                                                  Server (MS), and the Payment System (PS). This ecosystem
of fully trusted communication channels. While prior studies
                                                                  supports multiple payment scenarios, including in-app pay-
have identified isolated vulnerabilities, a systematic formal
                                                                  ments, mobile web payments, and QR-code-based payments.
analysis of payment protocol security remains absent. This
                                                                  Within this ecosystem, payment service providers can ensure
paper presents formal security models for six third-party pay-
                                                                  the security of communications within their own payment
ment protocols, spanning three major payment scenarios and
                                                                  systems, such as the communication between the payment
two dominant payment service providers. Our analysis re-
                                                                  application (PS-App) and the payment server (PS-Server).
veals a fundamental design flaw: whenever channel integrity
                                                                  Additionally, they can protect the channel security between
is compromised between the merchant client, merchant server,
                                                                  MS and PS-Server by restricting communication to HTTPS.
or payment system, order tampering attacks become feasible.
                                                                  However, payment service providers cannot guarantee the
We validate this threat on Android, where over 20% of tested
                                                                  security of communications between external entities.
merchant applications allow order tampering through implicit
Intent hijacking. To mitigate this threat, we propose user-          Unfortunately, numerous empirical studies have shown that
side order authentication, where per-user-merchant key pairs      insecure or misconfigured channels have led to various cate-
cryptographically bind consent to order semantics. Formal         gories of security vulnerabilities in third-party payment work-
verification demonstrates its resilience against identified at-   flows. Prior research has identifyed at least three types of
tacks under weak channel assumptions. By bridging formal          attacks associated with untrusted channels: (1) Order Injec-
methods and empirical analysis, this work offers actionable       tion and Tampering Over Insecure Channels: Attackers can
guidance for standardizing secure payment protocols.              replace or replay order, causing users to unknowingly pay for
                                                                  incorrect orders [36, 41]; (2) Misuse of Signatures and Param-
                                                                  eter Structures: Attackers can alter payment parameters with-
1     Introduction                                                out invalidating the signature by exploiting flawed signature
                                                                  designs [21]; (3) Payment Result Forgery and UI Confusion:
Third-party payment systems have become a core infrastruc-        Attackers can inject forged “payment success” messages or
ture of modern e-commerce and mobile payments. Partic-            leverage UI overlay attacks, H5 redirection, and script injec-
ularly, third-party payment services in China have evolved        tion to mislead merchants or users about the transaction sta-
into a foundational component of the digital economy, with        tus, enabling free purchases or misdirected payments [38, 41].
both market scale and user penetration continuing to grow.        These studies reveal a critical issue: the cryptographic mecha-
According to the latest industry report by iResearch [3], the     nisms employed by current third-party online payment proto-
transaction volume of China’s personal third-party payment        cols are insufficient to withstand threats arising from insecure
market has reached 67 trillion Chinese yuan (approximately        external channels. From the perspective of payment service
9.6 trillion US dollars) in 2025, with online payments account-   providers, adopting weaker security assumptions for external
ing for more than 50% of the total. Among all third-party pay-    channels reflects the relities of modern payment environments
ment platforms, Alipay [1] and PSP-B are the two dominant         better. This observation motivates us to analyze the secu-
                                                                  rity of third-party online payment protocols under weakened
    ∗ Corresponding authors.                                      external channel security assumptions.



USENIX Association                                                                    35th USENIX Security Symposium         359
   In this paper, we establish comprehensive symbolic mod-         Contributions. We make the following contributions:
els for third-party online payment protocols. Due to the ab-
sence of an industry-wide standard for online payments, we         1. Symbolic verification of payment protocols. We sum-
examined publicly available developer documentation of Ali-           marize the mainstream design patterns of third-party on-
pay [2] and PSP-B, abstracting six representative payment             line payment protocols and analyze six representative real-
protocol models that cover three core payment scenarios. Our          world third-party online payment protocols using symbolic
models faithfully reflect the design details of actual payment        models. Our formal analysis results reveal that, under re-
processes and cover the complete workflow, from order place-          alistic adversary and channel assumptions, the high-level
ment to payment completion. From these six protocols, we              design of all analyzed protocols is flawed and vulnerable
derive two high-level design patterns and investigate their           to order tampering attacks.
common security issues. To realistically capture the capabili-     2. Disclosure of a new order tampering attack. Based on
ties of adversaries, we explicitly model adversary’s behaviors.       our formal analysis results, we identified a new variant of
Particularly, we grant the adversary legitimate access to mer-        order tampering attacks and successfully demonstrated it
chant platforms, enabling them to create orders and obtain            in a real-world payment environment. Our further mea-
payment parameters.                                                   surement study shows that this vulnerability affects more
   We formally define a set of security properties for third-         than 25% of real-world applications.
party online payment protocols across three dimensions: or-
der, authorization, and result. We verify these properties in      3. Proposal of a formal verified countermeasure. We pro-
the six real-world payment protocols under weakened chan-             pose a new payment protocol as a countermeasure, which
nel security assumptions using Tamarin-Prover [23]. Our               introduces a user-side order authentication mechanism to
analysis reveals a pervasive yet underexplored design anti-           address the identified design flaws. Formal verification re-
pattern: mainstream high-level payment patterns generally             sults demonstrate that the proposed protocol can maintain
lack mechanisms that bind user payment authorization to the           security, even under weakened channel assumptions.
intended order. Consequently, once the communication chan-
nel between the user and the merchant is compromised, an
                                                                   2     Background
adversary can induce the user to authorize any order.
   Motivated by the findings from our formal analysis, we          In this section, we first introduce the typical ecosystem archi-
identify a new variant of the order tampering attack. We ob-       tecture and payment scenarios of third-party online payments.
serve that many merchant applications on Android improp-           Then, we abstract two main high-level payment models, and
erly use implicit intents to interact with payment applications.   finally introduce Tamarin-Prover [23].
This misuse exposes the transmission of payment parame-
ters to interception by malicious applications. We develop a
proof-of-concept attack application that exploit this vulner-      2.1    Third-Party Online Payment Ecosystem
ability and successfully perform order tampering attacks in        Currentlly, there is no universally adopted regulatory stan-
real-world payment environments. To evaluate the prevalence        dard governing third-party online payments, and payment
and severity of this issue, we conduct a measurement study         providers typically rely on proprietary protocols and imple-
of 461 popular applications spanning multiple domains, in-         mentations. By reviewing official documentation and devel-
cluding online shopping, online education, entertainment, and      oper guides [2], alongside an analysis of payment workflows,
gaming. Our results show that more than 25% of the sampled         we summarize the typical ecosystem architecture of third-
applications are vulnerable. These applications collectively       party online payment systems. A typical third-party online
account for over 200 billion downloads, potentially affecting      payment ecosystem involves four main participants:
billions of users. We responsibly disclosed our findings to the
security teams at Alipay and PSP-B. We received acknowl-           1. User (U): An individual who initiates and authorizes pay-
edgment from them, and at the time of writing, remediation            ments for goods or services.
efforts were actively underway. Additionally, we notified the
developers of 41 vulnerable merchant applications identified       2. Merchant Frontend (MF): The interface through which
in our study and provided concrete security recommendations           the user interacts to select goods and initiate payments,
to help mitigate this risk.                                           typically implemented as a website or mobile application.
   To address these design flaws, we propose a deployable          3. Merchant Server (MS): The server-side component of the
payment pattern which incorporates a user-side order authenti-        merchant that processes orders and communicates with
cation mechanism to establish a binding between user’s autho-         payment providers.
rization and the intended order. Under the weakened channel
assumptions, we formally verify this pattern and show that it      4. Third-Party Payment System (PS): A payment transaction
satisfies all the defined security properties.                        handling system provided by a payment service provider.



360   35th USENIX Security Symposium                                                                        USENIX Association
   The PS comprises a payment application (PS-App) and a                 U             i MF                2 MS                PS
   payment server (PS-Server). Since the internal interaction
   mechanisms are proprietary and the communication oc-            Select goods
                                                                              goods
                                                                              goods
   curs over private, secure channels, these two components       i                               goods
                                                                                                  goods
   cannot be individually inspected. Therefore, we treat the
   PS as a unified black-box system.                                                                  Generate params
                                                                                                  params
                                                                                                  params
  As illustrated in Figure 1, a third-party payment process                                                 params
                                                                                                            params
                                                                  ii
can be abstracted into the following four phases:                                                                    if validate(params) then
                                                                                                                        continue()
 i. Order Phase: The user U selects goods and chooses a pay-                                                         else abort()
    ment provider on the MF. The MF sends the information
                                                                                     amount,description,
                                                                                     amount,             account,...
                                                                                             description,account, ...
    of goods and the selected payment provider to the MS.
                                                                  Enter password
ii. Prepayment Phase: Upon receiving the information, the                                        password
                                                                                                 password
                                                                  iii
    MS generates the corresponding payment parameters                                                                if validate(password) then
    params and returns them to the MF, which subsequently                                                               make payment()
                                                                                                                     else abort()
    forwards params to the corresponding PS.
iii. Authorization Phase: The PS displays the order informa-                                                      idtrade := random()
                                                                                                                  result := “success”||idtrade ||idM
     tion, including product description, payment amount, and                                                                 ||idorder ||amount
     payee’s account, to U via the PS-App for confirmation.                                                       Sresult := sign privP (result)
     After verifying the order details, U enters the payment      iv                                             result,SSresult
                                                                                                                 result,  result
                                                                                                                          result
                                                                                                                          result
     password in the PS-App to authorize the transaction.                          “Successful”,
                                                                                   “Successful”, amount,
                                                                                   “Successful”,amount,  description,
                                                                                                 amount,description,  ...
                                                                                                         description,...
                                                                                                                      ...

iv. Notification Phase: Upon successful authorization, the
    PS-Server signs the payment result using its private key     Figure 1: An Overview of a Typical Third-Party Online Pay-
    and sends the signed result to the MS. Simultaneously, the   ment. Dashed arrows indicate optional messages, depending
    PS-App displays the payment result to U.                     on the specific payment pattern. Notation: validate(p) de-
                                                                 notes checking whether p is valid; continue() denotes contin-
2.2    Payment Scenarios                                         uing the execution of the protocol; abort() denotes terminat-
                                                                 ing the protocol; make_payment() denotes the fund transfer
The PS obtains payment parameters from the MF via PS-App         operation; random() denotes generating a random number;
installed on the U’s mobile device. However, the commu-          and signk (m) denotes signing message m with key k.
nication methods between the PS-App and the MF differ
depending on implementation of the MF, which may include
native mobile applications, mobile web pages, and desktop        payment provider employs a QR code as an intermediary be-
web pages. These distinct forms result in different payment      tween the PC and mobile platforms. After placing an order,
scenarios, prompting payment providers to define specific in-    the merchant website generates a payment QR code, which the
teraction methods between the MF and the PS. We introduce        user scans with the PS-App to obtain the payment parameters.
three common payment scenarios below:
   In-app Payment. In this scenario, payment parameters are      2.3     Payment Patterns
obtained within native mobile applications. After the user se-
lects a good, the MF invokes the PS-App through the Software     During the Prepayment phase, the generation methods of pay-
Development Kit (SDK) provided by the payment provider to        ment parameters vary across different providers and scenarios.
transmit the required payment parameters to the PS.              We introduce two high-level payment patterns adopted by the
   Mobile Web Payment. In this scenario, the user interacts      two leading payment providers, PSP-B and Alipay.
with the merchant through a mobile browser. Similar to in-app       Payment Pattern A. In this pattern, the payment param-
payment, the merchant’s mobile web page initiates a payment      eters are generated directly by the MS. Figure. 2 details the
request to the PS-App using a URL scheme.                        process by which the MS generates the order information.
   QR Code Payment. QR code payment fundamentally dif-           Based on the goods selected by the user, the MS calculates
fers from the previous two scenarios with respect to device      the amount to be paid and the order description, and gener-
interaction. In this scenario, the user browses the merchant’s   ates a unique order identifier (idorder ). These values, together
website using a desktop browser, while the payment is com-       with the merchant identifier (idM ), constitute the order infor-
pleted on a mobile device. Since the merchant’s web page         mation. The MS then signs the order information using its
cannot directly redirect to a mobile payment application, the    private key privM , producing a signature value Sorder . The



USENIX Association                                                                         35th USENIX Security Symposium                      361
           i MF                  2 MS                     PS                        i MF                   2 MS                          PS


               idorder := random()                                                      idorder := random()
               amount, description := calculate(goods)                                  amount, description := calculate(goods)
               order = idM ∥ idorder ∥ amount ∥ description                             order = idM ∥ idorder ∥ amount ∥ description
      ii                                                                        ii      Sorder := sign privM (order)
               Sorder := sign privM (order)
               params := order ∥ Sorder                                                                                 order,SSorder
                                                                                                                        order,  order
                                                                                                                                 order
                     params
                     params                                                                                                     if veri f y(Sorder ) then
                                 params
                                 params                                                                                            id prepay := random()
                                                                                                                                   store(id prepay , order)
                                                    if veri f y(Sorder )                                                        else abort()
                                                    then continue()                                                        idprepay
                                                                                                                           id prepay
                                                                                                                              prepay
                                                                                                                              prepay
                                                    else abort()
                                                                                             S prepay := sign privM (id prepay ∥ idM )
                                                                                             params := id prepay ∥ idM ∥ S prepay
                    Figure 2: Payment Pattern A                                               params
                                                                                              params
                                                                                                            params
                                                                                                            params

                                                                                                                                   if veri f y(S prepay )
order information and Sorder are used directly as the payment                                                                      then continue()
parameters. The PS then verifies Sorder to ensure the integrity                                                                    else abort()
of the order information. Payment pattern A is employed by
Alipay in the in-app and mobile web payment scenarios.
   Payment Pattern B. In this pattern, the payment parame-                                     Figure 3: Payment Pattern B
ters are generated by the MS with the involvement of the PS.
As in pattern A, the MS must sign the critical order informa-
                                                                           thereby affecting pattern matching and substitution. For exam-
tion. However, unlike pattern A, the order information and its
                                                                           ple, symmetric encryption is modeled by a encryption func-
signature, Sorder , cannot be used directly as payment parame-
                                                                           tion senc and a decryption function sdec satisfying the equa-
ters. Instead, they are sent to the PS as a prepayment request.
                                                                           tion sdec(senc(m, k), k) = m. The system state is captured
After verifying Sorder , the PS generates a unique prepayment
                                                                           using facts, which are predicates of the form F(t1 , . . . ,tn ).
identifier, id prepay , for the payment and returns it to the MS.
                                                                           Facts can be linear (consumed upon rule application), persis-
The MS then concatenates idM with id prepay and signs the
                                                                           tent (available throughout the execution, e.g., !PK( A, PkA )).
result using privM , producing the signature S prepay . Finally,
                                                                           The system execution can be observed using action facts,
idM , id prepay and S prepay are sent to the PS as the payment
                                                                           which record execution steps such as Running( A, x ) and
parameters. The PS verifies the validity of S prepay to ensure
                                                                           Commit( B, x ) and are retained to form execution traces but
the integrity of the payment request. Payment pattern B is
                                                                           do not constitute system states.
adopted by Alipay in the QR Code Payment scenario and by
PSP-B across all three payment scenarios.                                     Multiset Rewriting Rules. Multiset rewriting rules for-
                                                                           mally describe protocol behavior. Each rule specifies a state
                                                                           transition by means of left-hand side premise facts (guards)
2.4        Tamarin-Prover                                                  and right-hand side conclusion facts (productions), and may
                                                                           also include action facts as observable events. Formally, a
Tamarin-Prover is a symbolic verification tool widely used for             rule can be written as following:
analyzing real-world security protocols, including EMV [7,
                                                                                [ LF1 , . . . , LFm ] −[ AF(t1 , . . . ,tk ) ]→ [ RF1 , . . . , RFn ]
8, 29], TLS [13, 14, 19], Bluetooth [17, 34], and 5G-AKA [6,
12]. It employs a multiset rewriting system to model both                  Given a current state multiset S, the rule is enabled when
protocol execution and adversary capabilities, providing a                 LF1 , . . . , LFm ⊆ S. We use the function linear to denotes the
rich language for specifying security properties as first-order            linear facts from a set of facts. The application of the rule
logic formulas over execution traces. Tamarin-Prover supports              produces a new state S′ = (S \ linear({LF1 , . . . , LFm })) ∪
unbounded protocol sessions, a Dolev-Yao style adversary,                  {RF1 , . . . , RFn }, and appends the action facts AF(t1 , . . . ,tk ) to
and is particularly well-suited for analyzing stateful protocols           the execution trace.
due to its native handling of mutable and persistent state.                   Trace and Formulas. In Tamarin-Prover , the global be-
   Terms and Facts. In Tamarin-Prover , protocol messages                  havior of a protocol is captured by traces, which are se-
are represented as terms, which are constructed from vari-                 quences of action facts. Formally, a trace is represented as
ables, constants, and compound expressions formed by apply-                τ = ⟨FA1 @t1 , FA2 @t2 , . . . , FAn @tn ⟩, where FAi @ti denotes
ing function symbols to subterms. An equational theory over                an observable event occurring at time point ti . Based on such
terms specifies algebraic properties and reducibility relations,           traces, Tamarin-Prover reasons about executions using first-



362        35th USENIX Security Symposium                                                                                         USENIX Association
order logic formulas, where restrictions are used to specify         whether the displayed account belongs to the intended mer-
global constraints over all possible executions. These con-          chant. For instance, when purchasing a video game on Steam
straints are also first-order logic formulas over events and         (a leading global digital game distribution and social plat-
time points. Within this restricted semantic space, security         form), the payee’s name shown is “Valve Corporation” (the
properties are likewise expressed as first-order temporal logic      parent company of Steam) rather than “Steam”. Users with-
formulas (lemmas), such as secrecy, authentication, or consis-       out relevant background knowledge may find it difficult to
tency properties, and are required to hold for all valid traces.     determine whether “Valve Corporation” is indeed the payee
For example, key secrecy can be formalized as:                       account associated with “Steam”. Therefore, we assume that
                                                                     users do not rely on the payee’s account name when
    All k #i. Install(k)@#i =⇒ not(Ex #j. K(k)@#j)
                                                                        Payment System Assumptions. The PS comprises two
This formula expresses that for any key k and time point i, if       components: the PS-App and the PS-Server. We assume that
this key k is installed at time i, then there doesn’t exist a time   the PS-App and the PS-Server, as well as the communication
point j at which the key k is known by an adversary.                 channel between them, are trusted. Unless otherwise specified,
                                                                     we treat them as a single PS entity in the subsequent analysis.
3     Threat Model and Assumptions                                      Channel Assumptions. According to developer manuals
                                                                     of various payment providers, the MS is recommended to
In this section, we introduce the threat model and security          be configured with security protocols such as HTTPS to en-
assumptions used in our formal analysis and attacks.                 sure secure communication. This implies that channels where
                                                                     MS participates should be secure. However, we note that this
                                                                     assumption is overly strict, as a recommendation in the de-
3.1    Threat Model                                                  veloper manual alone cannot provide a reliable guarantee of
In this paper, we consider the following adversary model.            secure communication. Therefore, in our analysis, we relax
                                                                     the security assumptions for certain channels. We consider the
1. Payment Parameter Acquisition. We assume that adver-              following communication channels to be potentially insecure:
   sary can obtain legitimate payment parameters for arbi-
   trary goods from any merchant platform. This assumption           I. MF ⇐⇒ MS: We assume that the channel between MF
   is realistic, as most merchant platforms support public              and MS is insecure. This assumption is motivated by the
   registration, allowing adversaries to create accounts and            fact that MF operates on the user’s device, and users should
   complete purchases to acquire payment parameters.                    not be assumed to possess a high level of security aware-
                                                                        ness or to be able to defend against diverse threats in real-
2. Compromised Insecure Channels. The adversary fol-                    world network environments. In addition, given the large
   lows the standard Dolev-Yao model, where the adversary               number of merchants involved, payment service providers
   is able to fully control insecure communication channels,            cannot guarantee that all front-end and back-end communi-
   including eavesdropping, modifying, replaying, and in-               cations of merchants are free from security vulnerabilities.
   jecting arbitrary messages. In third-party online payment
   ecosystems, PS cannot provide absolute security guaran-           II. MF ⇐⇒ PS: The communication between MF and PS
   tees for all communication channels between external enti-            occurs during the Prepayment phase, in which MF invokes
   ties. Therefore, we adopt weak assumptions for such exter-            the PS-App to send payment parameters. This interaction
   nal channels and grant the adversary man-in-the-middle ca-            is vulnerable to hijacking attacks in practice, as evidenced
   pabilities over these insecure channels. The specific chan-           by real-world exploits discussed in Section 6. Thus, we
   nels considered insecure are discussed in Section 3.2.                assume that this channel is insecure.

3.2    Security Assumptions
                                                                     4    Payment Protocol Modeling
Regarding the user, the payment system, and the communica-
tion channel, we make the following security assumptions:            We formally model the payment protocols of PSP-B and Ali-
   User Assumptions. During the Authorization phase, users           pay in three payment scenarios, and the full models are avail-
review the order information before authorizing the payment.         able in an open-source repository [4]. In this section, we
We assume that users can correctly verify whether the pay-           present the key details for modeling third-party payment pro-
ment amount and order description displayed by the PS-App            tocols. First, we describe the user model, which allows us to
match the goods selected on the MF. Another key element              capture users’ evaluation of payment information and their
displayed on the payment interface is the payee’s account            authorization behavior within the symbolic model. Then, we
name. However, since this name does not necessarily corre-           introduce the oracle model for the adversary to obtain legiti-
spond to the merchant’s brand name, U cannot reliably verify         mate payment parameters.



USENIX Association                                                                       35th USENIX Security Symposium          363
4.1     User Model                                               introduce an Order Oracle within the symbolic framework,
                                                                 which is defined by the following rule:
Under our security assumptions, users are capable of ac-
curately identifying the payment amount and description,         Rule OrderOracle :
thereby avoiding being misled into authorizing a payment. To      [ In( <amt, desc> ), !Merchant( idM , privM ) ] −[ ]→
model this capability in the symbolic model, we introduce two     [ Out( gen_params(amt, desc, idM , privM ) ) ]
unary functions, calc_amt and gen_desc, which are used to
compute the payment amount and description from goods,           By querying this oracle with an order amount amt and an or-
respectively. During the Ordering phase, users select goods.     der description desc, the adversary can obtain the correspond-
For the same goods (note that this does not refer to the same    ing legitimate payment parameters. The oracle is granted
product model), a user can only purchase them at most once.      access to the merchant’s identifier idM and rivate key privM ,
Therefore, in our model, we use a fresh value as an abstract     enabling it to generate legitimate payment parameters that
representation of the goods. The following rule models the       are accepted by PS. The function gen_params(amt, desc,
user’s goods ordering behavior:                                  idM , privM ) represents the process by which the oracle gen-
                                                                 erates payment parameters from amt and desc. This process is
 [ Fr(~goods) ] −[ ]→ [ Order(~goods), SOut(..., ~goods) ]       consistent with the procedure used by merchants to generate
This rule represents that the user U selects a product ~goods    payment parameters in both payment pattern A and payment
and sends it to MF. Here, Fr(~goods) indicates that the value    pattern B. We use equations to flexibly define this process in
~goods is freshly generated. Order(~goods) indicates that the    symbolic models. In protocols conforming to Model A, the
user has placed an order for the goods ~goods. In Prepayment     equation is defined as follows:
phase, MS computes the payment amount and description            gen_parmas(amt, desc, idM , privM ) =
based on ~goods using calc_amt and gen_desc, as follows:
                                                                           amt ∥ desc ∥ idM ∥ sign(amt ∥ desc ∥ idM , privM )
      amount = calc_amt(~goods)
                                                                 For protocols under Model B, the equation is as follows:
description = gen_desc(~goods)
                                                                 gen_parmas(amt, desc, idM , privM , id prepay ) =
In Authorization phase, the user obtains the order informa-
tion from the PS-App and confirms it. Due to pattern match-                        id prepay ∥ idM ∥ sign(id prepay ∥ idM , privM )
ing, the user authorizes a payment if only if the payment        Here, our equation simplifies the actual generation process
amount and description exactly match calc_amt(~goods)            of payment parameters, such as the generation of id prepay . In
and gen_desc(~goods), respectively, and will not authorize       the modeling, we incorporate additional necessary parameters
any other values. The following rule models the user’s pay-      and computational steps according to the details of the actual
ment authorization behavior:                                     protocol, ensuring the model’s accuracy and completeness.
[ Order(~goods),
 SIn(..., ⟨calc_amt(~goods), gen_desc(~goods)⟩) ]                5   Security Properties
 −[ ]→ [ UserAuthorizePayment(...) ]
                                                                 In this section, we formally define the security properties
Here, UserAuthorizePayment indicates that the user autho-        of third-party online payment protocols. The core security
rizes the payment. Notably, the above model implies that         goal of protocols is to ensure that the user, the merchant, and
users can accurately distinguish between different items, even   the payment service provider reach a consistent view of a
when they belong to the same product model. In practice,         transaction. The protocol must guarantee that (a) all parties
users do not possess such capabilities, nor do merchant plat-    agree on the payment order being processed, (b) each payment
forms provide functionality that allows users to select items    is authorized by the user, and (c) the reported payment result
based on product serial numbers. Nevertheless, this idealized    faithfully reflects the actual fund transfer.
user model helps us focus on analyzing the security of the          All properties considered in this section are instances of in-
payment protocol itself, without conflating the analysis with    jective agreement [22]. Injective agreement strengthens stan-
errors that users may make.                                      dard agreement by requiring a one-to-one correspondence
                                                                 between protocol runs: each successful local completion must
4.2     Adversarial Capabilities Model                           correspond to a unique execution of the peer, ruling out re-
                                                                 play, duplication, or reuse of protocol messages. Two types
In our threat model, the adversary is capable of obtaining       of atomic facts are necessary to define injective agreement:
legitimate payment parameters. In practice, the adversary
acquires such legitimate payment parameters by accessing         1. Running(A, B, x): records that party A is interacting with
merchant platforms in a normal manner and placing orders            B in a concrete execution of the protocol and that the
to purchase goods. To intuitively model this behavior, we           interaction involves data x (an objective execution fact);



364    35th USENIX Security Symposium                                                                       USENIX Association
2. Commit(A, B, x): denotes that party A subjectively be-         5.2 Injective Agreement on User Authorization
   lieves that it has reached agreement with B on data x (e.g.,
   after receiving and accepting a message).                      Injective agreement on user authorization ensures that each
                                                                  successful payment is backed by a unique and explicit autho-
This notion is particularly well-suited for online payment sce-   rization from the user. This property prevents both unautho-
narios, where both consistency and uniqueness of transactions     rized payments and reuse of a single authorization to complete
are fundamentally essential requirements. We structure the        multiple transactions.
security properties according to the logical progression of a        IA-UA (PS ← U): Specifically, if PS completes a payment
payment protocol, namely agreement on the order, agreement        based on a password hash, then the corresponding password
on user authorization, and agreement on the result.               must have been input by U, and each password input can
                                                                  authorize at most one payment:
5.1    Injective Agreement on Order                               All u p s #i. PaymentComplete(u, h(p), s)@#i
Injective agreement on the order ensures that all involved          =⇒ Ex #j. UserInputPwd(u, p, s)@#j ∧
parties process the same payment order and that each order is           ¬ ( Ex u2 p2 #i2. #i2 ̸= #i ∧
handled at most once. Violations of this property indicate that
                                                                              PaymentComplete(u2, h(p2), s)@#i2)
an adversary may have tampered with the order information
or caused inconsistent views among the participants. Since        In this lemma, the fact UserInputPwd(u, p, s) represents
this property involves three principals, we separately consider   that the user u inputs the password p in a session s to autho-
the agreements between PS and MS, and between U and MS.           rize a payment. The fact PaymentComplete(u, h(p), s)
   IA-O1 (PS ← MS): This lemma captures injective agree-          denotes that PS has received the hash value h(p) of the pass-
ment on the order from the perspective of PS. If PS accepts       word p sent by u, and has completed the payment.
a payment request for an order allegedly issued by MS, then
MS must have previously initiated a corresponding request
for that order. Moreover, no other payment request for the
                                                                  5.3    Injective Agreement on Result
same order can be accepted by PS, ensuring uniqueness. The
property is formalized as follows:                                Finally, injective agreement on the payment result guaran-
All ps ms order #i. PSCommit(ps, ms, order)@#i                    tees that successful payment notifications cannot be forged,
  =⇒ Ex #j. MSRunning(ms, ps, order)@#j ∧                         replayed, or duplicated. A violation of this property would al-
                                                                  low an adversary to falsely convince the user or the merchant
      ¬ ( Ex ps2 ms2 #i2. #i2 ̸= #i ∧                             that a payment has been completed, even though no actual
            PSCommit(ps2, ms2, order)@#i2)                        fund transfer has occurred. We again consider the perspectives
Here, the Commit and Running facts follow the standard in-        of MS and U separately.
terpretation introduced in [22]. The fact PSCommit(ps, ms,           IA-R1 (MS ← PS): From the merchant’s view, if MS re-
order) denotes that PS has accepted a payment request for         ceives a successful payment notification for an order, then
order, while MSRunning(ms, ps, order) records that MS             this notification must have been generated by PS. Also, MS
has actually issued such a request. The term order denotes        must not receive multiple successful notifications for the same
order information, including the merchant’s order identifier,     order. This is formalized in the lemma:
the payment amount, and the product description.                  All ms ps order #i. MSCommit(ms, ps, order)@#i
   IA-O2 (U ← MS): From the user’s perspective, injective
                                                                    =⇒ Ex #j. PSRunning(ps, ms, order)@#j ∧
agreement on the order ensures that the user and the merchant
reach agreement on order information during the payment                 ¬ ( Ex ms2 ps2 #i2. #i2 ̸= #i ∧
process, and that each order is processed exactly once. The                   MSCommit(ms2, ps2, order)@#i2)
formalization is as follows:
                                                                    IA-R2 (U ← PS): For the user, if U observes a successful
All u ms goods #i. UMCommit(u, ms, goods)@#i                      payment notification in the application, then PS must have
  =⇒ Ex #j. MSRunning(ms, u, goods)@#j ∧                          sent a corresponding notification. Each order produces at most
      ¬ ( Ex u2 ms2 #i2. #i2 ̸= #i ∧                              one notification. Formally,
            UMCommit(u2, ms2, goods)@#i2)                         All u ps goods #i. UPCommit(u, ps, goods)@#i
Unlike the order information considered in IA-O1, IA-O2             =⇒ Ex #j. PSRunning(ps, u, goods)@#j ∧
only requires agreement between the user and the merchant               ¬ ( Ex u2 ps2 #i2. #i2 ̸= #i ∧
on the purchased goods, since the user is primarily concerned                 UPCommit(u2, ps2, goods)@#i2)
with what is being bought.



USENIX Association                                                                    35th USENIX Security Symposium        365
Table 1: Verification Results of Third-Party Online Payment Protocols. Each protocol is evaluated under three channel
security assumptions. IA-O1/O2, IA-UA, IA-R1/R2 denote the security properties defined in Section 5. ✓ indicates that the
security property is satisfied, while ✗ indicates a violation. Time reports the total analysis time.

 Assumption        Provider   Scenario       Model              IA-O1        IA-O2     IA-UA       IA-R1       IA-R2     Time (s)
 Base              Alipay     In-App         A                   ✗            ✗          ✓           ✓           ✓          265.8
 Base              Alipay     Mobile-Web     A                   ✗            ✗          ✓           ✓           ✓         266.22
 Base              Alipay     QR-Code        B                   ✓            ✗          ✓           ✓           ✓         606.59
 Base              PSP-B      In-App         B                   ✓            ✗          ✓           ✓           ✓         562.21
 Base              PSP-B      Mobile-Web     B                   ✓            ✗          ✓           ✓           ✓          88.18
 Base              PSP-B      QR-Code        B                   ✓            ✗          ✓           ✓           ✓         123.89
 SecureMS          Alipay     In-App         A                   ✗            ✗          ✓           ✓           ✓          13.94
 SecureMS          Alipay     Mobile-Web     A                   ✗            ✗          ✓           ✓           ✓          14.39
 SecureMS          Alipay     QR-Code        B                   ✓            ✗          ✓           ✓           ✓          73.57
 SecureMS          PSP-B      In-App         B                   ✓            ✗          ✓           ✓           ✓          19.96
 SecureMS          PSP-B      Mobile-Web     B                   ✓            ✗          ✓           ✓           ✓           7.73
 SecureMS          PSP-B      QR-Code        B                   ✓            ✗          ✓           ✓           ✓           7.22
 SecurePS          Alipay     In-App         A                   ✗            ✗          ✓           ✓           ✓          19.55
 SecurePS          Alipay     Mobile-Web     A                   ✗            ✗          ✓           ✓           ✓           18.2
 SecurePS          Alipay     QR-Code        B                   ✓            ✗          ✓           ✓           ✓         155.14
 SecurePS          PSP-B      In-App         B                   ✓            ✗          ✓           ✓           ✓         159.02
 SecurePS          PSP-B      Mobile-Web     B                   ✓            ✗          ✓           ✓           ✓          20.66
 SecurePS          PSP-B      QR-Code        B                   ✓            ✗          ✓           ✓           ✓          26.77



5.4     Analysis Results                                             to IA-O2, none of the six analyzed protocols we analysed
                                                                     satisfies this property under our channel assumptions.
In Section 3.2, we provide a detailed rationale for adopting
                                                                        We further observe that the analysis results remain con-
weak security assumptions for the two communication chan-
                                                                     sistent across all three channel assumptions. This indicates
nels MF ⇐⇒ MS and MF ⇐⇒ PS. Based on different combi-
                                                                     that as long as any insecure channel exists, an adversary can
nations of these two weak-channel assumptions, we construct
                                                                     successfully carry out an attack, causing the user and the mer-
three channel security assumptions for our analysis:
                                                                     chant to hold inconsistent views of the order information and
 1. Base: both MF ⇐⇒ MS and MF ⇐⇒ PS are insecure;                   thereby violating the IA-O1 and IA-O2 properties.
                                                                        Moreover, across all payment scenarios, protocols adopting
 2. SecureMS: only MF ⇐⇒ PS is insecure;                             payment pattern A fail to satisfy both IA-O1 and IA-O2, while
                                                                     protocols following payment pattern B fail to satisfy IA-O2.
 3. SecurePS: only MF ⇐⇒ MS is insecure.
                                                                     This demonstrates that protocol security is closely tied to the
   Under these three channel security assumptions, we con-           adopted payment pattern, whereas variations in payment sce-
duct a comprehensive automated security analysis of six              narios have a limited impact on security. All counterexamples
third-party online payment protocols, covering three payment         violating IA-O1 and IA-O2 shows that each of them arises
scenarios for each of Alipay and PSP-B. All analyses are             from an order tampering attack.
performed using Tamarin-Prover version 1.10.0 and are ex-
ecuted on a server equipped with a 24-core, 32-thread Intel          5.4.2    Order Tampering Attack
Core i9-14900K processor and 192,GB of memory, running
Ubuntu 24.04 LTS. This section presents and discusses the            The order tampering attack was first identified by [41] in the
verification results of the above analyses in detail.                in-app payment scenario. Our formal analysis reveals that
                                                                     this attack is pervasive across all payment scenarios and all
                                                                     payment patterns. As long as any insecure channel exists,
5.4.1    Results
                                                                     an adversary can successfully launch this attack. Through
Table 1 summarizes our analysis results. We find that two            an analysis of counterexamples violating IA-O1 and IA-O2,
protocols following payment pattern A fail to satisfy the IA-        we identify two variants of the order tampering attack un-
O1 property under all three channel assumptions. With respect        der different channel assumptions. Figure 4 illustrates these



366     35th USENIX Security Symposium                                                                        USENIX Association
    U     i MF          ' Attacker           2 MS          PS                 6.1    A Real-World Vulnerability
                              goods
                              goods
    i
                                                                                Inspired by the Variant II attack, we identified an exploitable
                                  Genearte paramsM                              vulnerability on the Android platform. When initiating a pay-
                                                                   Variant I    ment request, merchant’s Android applications use the An-
                                 params
                                 paramsMM
 ii
                                        M
                                                                                droid Intent mechanism to transmit payment parameters to
               paramsA := oracle(paramsM )                                      the payment service application. As a core inter-component
                  paramsAAA
                  params                                                        communication mechanism provided by the Android system,
                                  paramsAAA
                                  params                                        Intent serves as the primary means by which the PSP-B and
                                                                   Variant II   Alipay receive payment parameters from merchant applica-
                          paramsM
                          params M
                                 M
                                 M                                              tions. A merchant application typically constructs an Intent
                  paramsM
                  params M
                         M
                                                                                containing payment parameters and uses it to launch the cor-
               paramsA := oracle(paramsM )                                      responding payment application.
                                           params
                                           paramsAAA                               It should be noted that Intents can be classified into two cat-
                                                                                egories, explicit Intents and implicit Intents. An explicit Intent
                                                    if validate(paramsA )
                                                    then continue()
                                                                                specifies the fully qualified package name of the target ap-
                                                    else abort()                plication, whereas an implicit Intent only declares the action,
                                                                                category, and data, allowing the system to match and select a
 iii         amount,description,account
             amount, description,accountattacker
                                         attacker,,...
                                        attacker   ...
                          password
                                        attacker
                                                                                responding component based on Intent Filters. The security
                          password
                                                                                risk primarily arises from the misuse of implicit Intents.
 iv                       amount,description,
                                  description,...
            "Successful",,amount,
            "Successful"
            "Successful"                      ...                                  When requesting a payment, a merchant application should
                                                                                use an explicit Intent to explicitly designate the PSP-B or
Figure 4: Order Tampering Attack Variants. Notation:                            Alipay applications as the target, thereby ensuring that the
paramsM denotes the original payment parameters generated                       payment request is correctly routed to a trusted payment ap-
by the merchant; paramsA denotes the payment parameters                         plication. However, we find that some merchant applications
after being tampered with by the adversary; oracle(paramsM )                    use implicit Intents in practice. This means that an attacker
denotes the process by which the adversary generates pay-                       can hijack payment requests originally sent to a payment ap-
ment parameters such that the order information remains fully                   plication by deploying a malicious application that declares
consistent with paramsM .                                                       the same Intent handling capability.
                                                                                   Intent hijacking is not specific to payment scenarios, but
                                                                                rather a systemic security risk inherent in the Android com-
two variants. In Variant I, the adversary targets the channel                   ponent communication mechanism. However, existing third-
MF ⇐⇒ MS, causing U to ultimately authorize an attacker-                        party online payment protocols are designed under the as-
specified order. In Variant II, the adversary tampers with the                  sumption that the communication channel between the mer-
order on the channel MF ⇐⇒ PS.                                                  chant client and the payment application is trusted. This chan-
   In prior work [21, 40, 41], discussions of order tampering                   nel assumption is unrealistic in real-world deployments.
attacks primarily focus on Variant I. Under the channel as-
sumptions of SecurePS, all counterexamples that violate the
security properties originate from order tampering attacks                      6.2    Attack Implementation
on Variant I. However, our analysis under the channel as-                       We developed two Android applications, a malicious applica-
sumptions of SecureMS indicates that Variant II also has the                    tion and an attacker application, to exploit the aforementioned
potential to be successfully exploited in real-world settings.                  vulnerability. Fig. 5 illustrates the devices used in the attack,
In Section 6, we present a widely prevalent vulnerability that                  serving as the victim device and the attacker device, respec-
we discovered, which can be exploited to launch a Variant II                    tively, with the corresponding applications installed. The ma-
order tampering attack.                                                         licious application on device 5a is responsible for capturing
                                                                                and replaying payment parameters. The attacker application
6       Real-World Attacks                                                      on device 5b places orders on the merchant platform and
                                                                                returns payment parameters to the malicious application.
In this section, we present a real-world attack case that was                      Fig. 6 illustrates the workflow of the new order tampering
identified inspired by our analysis results and successfully                    attack. The attack proceeds in four phases:
carried out in practice. We also introduce our measurement
study to assess the scope and practical extent of the vulner-                   1. A benign merchant application initiates a payment request
ability’s impact across affected systems. We further discuss                       by dispatching an implicit Intent containing payment pa-
the responsible vulnerability disclosure process.                                  rameters to the payment application;



USENIX Association                                                                                   35th USENIX Security Symposium          367
                                                                       MA                           Malicious App                      PA

                                                                            Step1. Send payment Intent
                                                                         amount=aaaa&description=bbbb&
                                                                            order_id=cccc&sign=……
                                                                                                                Step2. Hijack Intent
                                                                                                                    Resolution

                                                                       MS
                                                                                                                      Step4. Relay
                                                                            Step3. Construct order request          tampered request
                                                                         amount=aaaa&description=bbbb&
                                                                            order_id=xxxx&sign=……

        (a) Victim Device            (b) Attacker Device
                                                                   Figure 6: Attack Flow. MA denotes the merchant application;
Figure 5: Attack Setup. Device 5a denotes the victim de-           Malicious Application denotes the malicious application we
vice, which installs the malicious application, a vulnerable       developed; PA denotes the payment application; MS denotes
merchant application, and a payment application. Device 5b         the merchant server.
denotes the attacker device, which installs the attacker appli-
cation. The screenshots correspond to the real interfaces of
the malicious and attacker applications, respectively.             payment method. These vulnerable applications span a wide
                                                                   range of categories, including e-commerce, online education,
                                                                   and entertainment. Their cumulative download count reaches
2. By hijacking the Intent resolution process, the malicious       265.85 billion, indicating that the vulnerability potentially
   application intercepts the original payment parameters and      affects a very large user base and poses a significant security
   extracts the embedded order information;                        risk in practice.
3. Using the extracted information, the attacker application
   places a new order under an attacker-controlled account on
   the merchant platform and obtains a fresh set of payment        6.4       Responsible Disclosure
   parameters that preserve the original order information
   while being bound to the attacker’s account;                    Following responsible disclosure guidelines, we reported the
                                                                   vulnerability to the security teams of PSP-B and Alipay in
4. The tampered payment parameters are then relayed to the         December 2025. At the time of writing, both providers had ac-
   payment application, which processes the request without        knowledged the issue and confirmed that remediation efforts
   detecting the modification.                                     were underway. We identified contact information for 41 af-
                                                                   fected Android applications and issued security notifications
As a result, the attacker successfully tampers with the order,
                                                                   to their developers, detailing the underlying risks and corre-
causing the user to complete a payment specified by the at-
                                                                   sponding mitigation strategies. Among these, 17 developers
tacker rather than the original merchant.
                                                                   responded; one explicitly committed to fixing the vulnerabil-
                                                                   ity, while the remaining vendors attributed the issue to the
6.3    Impact Assessment                                           Alipay and PSP-B SDKs. We did not notify the Google Play
                                                                   Store, as Chinese apps are distributed mainly through vendor
To assess the real-world impact of the identified vulnerability,
                                                                   stores and the root cause lies in the Alipay and PSP-B SDKs,
we conducted a manual measurement study on Android appli-
                                                                   which a single update can fix for all integrating apps. Other
cations and games that integrate the PSP-B or Alipay SDK.
                                                                   major systems (Apple Pay, Stripe, etc.) use architectures not
Our dataset consists of 150 popular Android applications and
                                                                   exposed to this attack.
50 games, covering up to the three most recent versions of
each application and the latest version of each game. For some
applications, only one or two versions were available. In total,
we collected 461 application versions.                             7     Countermeasure
  Among these versions, 419 support PSP-B and 401 support
Alipay. Our analysis reveals that 64 PSP-B–enabled versions        In this section, we analyze the causes of order tampering
and 72 Alipay-enabled versions are vulnerable. Out of 53           attacks and introduce our countermeasure. Then, we verify
applications, a total of 116 versions representing more than       our countermeasure using symbolic methods and present the
25% of the analyzed dataset support at least one vulnerable        results. Finally, we discuss our countermeasure.



368   35th USENIX Security Symposium                                                                                  USENIX Association
7.1    Cause Analysis                                                      U       i MF                         2 MS                           PS

                                                                     i          goods
                                                                                goods
                                                                                goods                  goods
Superficial Causes. From a superficial perspective, order                                        id U,,goods
                                                                                                 idUU
                                                                                                    U

tampering attacks arise from the existence of insecure com-                                 idorder := random()
munication channels between MS and PS-App. An attacker                                      pubUA , privUA = asymmetric key pair()
                                                                                            amount, description := calculate(goods)
can intercept and tamper with order information along this           ii                     order = idM ∥ idorder ∥ amount ∥ description
channel, thereby misleading the user into authorizing an in-                                Sinitial := sign privM (pubUA ∥ order)
correct payment. At first glance, addressing this issue appears                                                         pubUA
                                                                                                                        pub     order,SSinitial
                                                                                                                            UA,,order,
                                                                                                                            UA          initial
                                                                                                                                         initial

straightforward. It suffices to ensure that the communication                                                                   if veri f y(Sinitial ) then
channels between MS and PS-App are secure. However, for                                                                            id prepay := random()
                                                                                                                                   store(id prepay , pubUA , order)
payment service providers, this seemingly simple solution is                                                                    else abort()
difficult to realize in practice. The security of the communica-                                                               idprepay
                                                                                                                               id prepay
                                                                                                                                  prepay
                                                                                                                                  prepay

tion path from merchant backends to PS-App is influenced by                                  S prepay := sign privM (id prepay ∥ idM ∥ pubUA )
both merchants and end users, and is largely beyond the con-                                 params := id prepay ∥ idM ∥ pubUA ∥ S prepay

trol of payment service providers. Payment service providers                                       params
                                                                                                   params
                                                                                                                 params
                                                                                                                 params
                                                                                                                 params
serve a large number of merchants, each with diverse backend
implementations, making it infeasible to ensure that all mer-                                                                       if veri f y(S prepay ) then
                                                                                                                                       continue()
chants correctly secure their communication channels. Sim-                                                                          else abort()
ilarly, merchants serve a vast user base with heterogeneous                         "Do you trust this transaction?"
                                                                                    "Do you
                                                                                    "Do
                                                                                    "Do you trust
                                                                                        you trust this
                                                                                            trust this transaction?"
                                                                                                  this transaction?"
                                                                                                       transaction?"
device environments, and payment service providers cannot
                                                                    Click Confirm
guarantee that all users operate within secure network condi-                                       "Confirmed"
                                                                                                    "Confirmed"
                                                                                                    "Confirmed"
                                                                                                    "Confirmed"
                                                                    iii                    amount,description, account,
                                                                                                   description,account,
tions. Therefore, defending against order tampering attacks                                amount,                      ...
                                                                                                               account,...

solely by securing communication channels is, in practice,         Enter password
                                                                                                       password
                                                                                                       password
highly challenging. Consequently, mitigation is often reac-
                                                                                                                                  if validate(password) then
tive: once an insecure communication channel is identified,                                                                          make payment()
merchants and users are notified to apply patches.                                                                                   app save(idM , pubUA )
                                                                                                                                  else abort()
   Root Causes. The root cause of such attacks lies in the lack
of a user-side authentication mechanism for order information        iv
                                                                                                                            idtrade := random()
in existing payment patterns. We examine the typical actions                                                                result := "success" ∥ idtrade ∥ idM
                                                                                                                                     ∥ idorder ∥ amount ∥ pubUA
performed by users during the payment process: entering a                                                                   Sresult := sign privP (result)
payment password to authorize the transaction, and possibly                                                                 result,SSresult
                                                                                                                            result,   result
                                                                                                                                     result
verifying the payment amount and description. However, the                                      database save(idU , pubUA , privUA )
user does not actually authenticate the order. Information such                                               description,
                                                                                                      amount,description,
                                                                                        "Successful",,amount,
                                                                                        "Successful"
                                                                                        "Successful"
                                                                                        "Successful"                       ...
                                                                                                              description,...
as the payment amount and item description merely represents
the content of the current payment, and does not correspond
to the original order that the user intends to confirm. In other                              Figure 7: Initial Payment
words, during the Authentication phase, the user performs no
form of authentication of the order data. The user’s authoriza-
tion is applied only to the act of payment transaction, rather     are defined as regular payments.
than to a specific order. Once an attacker is able to tamper
                                                                      At the beginning of the Prepayment phase of a user’s
with order parameters in transit, the user can be induced to
                                                                   initial payment, MS generates a public–private key pair
authorize an incorrect order. This observation reveals a design
                                                                   (privUA , pubUA ) for U, and then uses the merchant private
flaw in current payment patterns.
                                                                   key privM to sign pubUA together with the order informa-
                                                                   tion before sending them to PS. Then, PS temporarily stores
7.2    Countermeasure Design                                       pubUA together with the order information and returns the
                                                                   prepay identifier (id prepay ) to the merchant. Upon receiving
To fundamentally address order tampering attacks, we de-           id prepay , MS generates two signatures over the payment pa-
sign and propose a new third-party payment protocol that           rameters using pubM and pubUA , respectively, and sends sig-
introduces a user-side order authentication mechanism to           natures and id prepay to MF During the Authentication phase,
effectively prevent such attacks. Our payment protocol distin-     PS-Server send the order information together with pubUA to
guishes between initial and regular payments, whose work-          PS-App. At this point, PS-App notifies the user that this is the
flows are illustrated in Fig. 7 and Fig. 8, respectively. For a    first payment to the merchant and asks whether this merchant
given merchant and user, the first payment initiated by the        should be trusted. If the user chooses to trust the merchant,
user is defined as an initial payment, while all later payments    PS-App verifies both signatures and, upon successful verifi-



USENIX Association                                                                              35th USENIX Security Symposium                                    369
        U       i MF                       2 MS                          PS                      Table 2: Verification Results of Countermeasure. ✓ means
  i          goods
             goods                                                                                 satisfy, while ✗ indicates a violation.
                              idU
                              id    goods
                                 U,,goods
                                 U
                                 U


                         idorder := random()                                                        Stage     IA-O1   IA-O2    IA-UA    IA-R1    IA-R2   Time(s)
                         amount, description := calculate(goods)
                         order = idM ∥ idorder ∥ amount ∥ description                               Initial    ✓         ✗       ✓        ✓        ✓     477.86
 ii                      Sorder := sign privM (order)
                                                                                                    Regular    ✓         ✓       ✓        ✓        ✓     916.97
                                                  pub UA,,order,
                                                  pubUA
                                                      UA  order,SSorder
                                                                  order
                                                                   order

                                                               if veri f y(Sorder ) then
                                                                  id prepay := random()
                                                                  store(id prepay , order)
                                                               else abort()
                                                                                                   7.4      Discussion
                                                         idprepay
                                                         id prepay
                                                            prepay
                                                            prepay
                                                                                                   Advantages. From a protocol design perspective, our pay-
                           pubUA , privUA = database f ind(idU )
                           SUA := sign privUA (id prepay ∥ idM )
                                                                                                   ment pattern exhibits three key advantages.
                           S prepay := sign privM (id prepay ∥ idM )
                           params := id prepay ∥ idM ∥ S prepay ∥ SUA
                                                                                                   1. Minimal trust assumptions. At the protocol design level,
                                params
                                params
                                            params
                                            params                                                    we minimize reliance on trusted channels. The protocol
                                                                                                      is formally proven to guarantee payment security under
                                                       if veri f y(S prepay ) and veri f y(SUA )
                                                       then continue()                                weakened external channel assumptions.
                                                       else abort()

 iii                  amount,description,
                      amount, description,account
                                          accountpayee
                                                  payee,,...
                                                  payee
                                                  payee  ...                                       2. Formally provable security. Our formal analysis results
                                  password
                                   password
                                                                                                      demonstrate that our payment pattern effectively prevents
 iv                                                   result,
                                                      result,SSresult
                                                               result
                                                                result
                                                               result                                 order tampering attacks during regular payments and satis-
                     "Successful",,amount,
                     "Successful"  amount,description,
                                           description,...
                                                       ...
                     "Successful"
                                                                                                      fies all security properties defined in this paper.

                          Figure 8: Regular Payment                                                   Limitations. We honestly present the limitations and trade-
                                                                                                   offs of our payment pattern.

cation, binds pubUA to the merchant identifier and stores it                                       1. Signature and storage overhead. Our payment pattern
locally. Otherwise, the payment process is aborted.                                                   introduces one additional signature operation, and requires
   In regular payments, the Prepayment phase largely follows                                          both merchants and users to locally store extra keys, which
payment pattern B. The only difference is that MS addition-                                           incurs additional computational and implementation over-
ally signs id prepay and idM using privUA . Then, PS-App first                                        head. However, no new cryptographic primitives are in-
checks whether a public key pubUA has already been bound                                              troduced, and we consider the resulting overhead to be
locally to the merchant identifier. If such a binding exists,                                         acceptable in practice.
PS-App verifies both signatures before prompting the user
to confirm the order information and complete the payment.                                         2. Additional user interaction during the initial payment.
Otherwise, the application informs the user that the merchant                                         During the initial payment, users are required to explicitly
is not trusted and asks whether to proceed with the payment.                                          confirm their trust in the merchant, introducing additional
                                                                                                      user interaction. For regular payments, no extra interac-
                                                                                                      tion is required, and the overall user experience remains
7.3      Symbolic Verification                                                                        comparable to that of existing payment patterns.
We formally modeled and verified the initial and regular pay-
ments, and the results are summarized in Table 2. The analysis                                     3. No security improvement for the initial payment. Our
shows that under all three channel assumptions, our regular                                           proposed model does not provide additional security guar-
payment effectively defends against order tampering attacks                                           antees for the initial payment. Instead, our design follows
and satisfies all security properties. This demonstrates that                                         the widely adopted Trust-On-First-Use (TOFU) model,
by introducing an order authentication mechanism on the                                               under which the initial interaction may be vulnerable to
user side, we can fundamentally address the problem of order                                          active network attacks. Once a legitimate payment context
tampering attacks. Although our initial payment does not sat-                                         is established, however, any subsequent deviation can be
isfy all security properties under certain channel assumptions,                                       reliably detected. Consequently, while an adversary may
which is consistent with the behavior of Model B, the initial                                         interfere with the initial payment, our scheme guarantees
payment occurs only once and thus minimizes the likelihood                                            the integrity of subsequent payments and enables attack
of successful attacks.                                                                                detection even if the first payment was compromised.



370      35th USENIX Security Symposium                                                                                                     USENIX Association
8     Related Work                                                 of work, [30, 31] conducted a systematic analysis of transac-
                                                                   tion workflows in branchless banking applications, revealing
8.1    Third-Party Payment System                                  widespread transaction integrity vulnerabilities.
                                                                      As payment protocols have grown in complexity, re-
In recent years, the research community has devoted sub-           searchers have increasingly employed formal methods to
stantial effort to the security of third-party payment systems.    model and verify bank-based payment systems, particularly
Overall, prior work has largely focused on specific payment        for credit card and EMV protocols. De Ruiter et al. [33] con-
scenarios or concrete system implementations, with empirical       ducted a formal analysis of a variant of the EMV protocol
analyses of third-party payment workflows used to uncover          using ProVerif, marking the first systematic application of for-
security flaws in real-world systems.                              mal methods to EMV protocol analysis. Subsequently, more
   In in-app payment scenarios, early studies uncovered mul-       precise and comprehensive models were proposed. Basin
tiple security vulnerabilities in different payment platforms.     et al. [8] modeled the complete EMV protocol using the
Early work by [25, 32] identified security flaws in Google’s       Tamarin-Prover . Formal analysis identified and explained
in-app billing service, which could be exploited to bypass         multiple real-world attacks, including the PIN bypass vulner-
payment verification and enable unauthorized free purchases.       ability [9] and the card brand mixup attack [7].
Focusing on the Indian market, [18] conducted an in-depth
analysis of the Unified Payments Interface (UPI) and uncov-
ered design flaws in its multi-factor authentication mecha-
                                                                   8.3    Vulnerabilities in Implementations
nism. [40,41] performed an empirical study of in-app payment       In mobile ecosystems, payment applications suffer from a
services in China. They proposed a set of security rules, and      wide range of implementation-level vulnerabilities arising
identified widespread rule violations in real-world systems,       from insecure inter-application communication and input han-
revealing pervasive risks of payment bypass and payment            dling. Prior work shows that improperly exported Android
fraud. More recently, [24] conducted a large-scale measure-        components enable launch hijacking and intent spoofing, al-
ment on payment libraries in over 10,000 Android apps. They        lowing malicious applications to intercept or impersonate
found 71.7% of apps rely on outdated or insecure payment           legitimate payment components [10, 37]. Similarly, implicit
SDKs, exposing hundreds of leaked private keys and tens of         URI schemes and deep links are often insufficiently validated,
thousands of high-risk vulnerabilities.                            enabling attackers to hijack payment flows and steal sensi-
   In web-based payment scenarios, prior research has cen-         tive parameters [20]. Moreover, embedded QR code scanning
tered on the interaction workflows between merchant websites       functionalities further expand the attack surface, as malicious
and third-party payment platforms. [39] studied multiple on-       QR codes can trigger sensitive interfaces or tamper with [15].
line shopping platforms that integrate payment services such
as PayPal and revealed severe logic vulnerabilities in these
systems. Later work, including [28, 35, 36], used symbolic
                                                                   9     Conclusion
execution and black-box analysis to identify payment logic
                                                                   This work presents a systematic security analysis of third-
flaws across many web applications.
                                                                   party payment protocols and uncovers a fundamental design
   Beyond analyses of concrete implementations, several stud-      anti-pattern: user authorization is never bound to order se-
ies have investigated third-party payment systems from alter-      mantics, leaving major payment ecosystems open to order
native perspectives. [11] applied NLP techniques to developer      tampering. By formally modeling six widely deployed proto-
documentation of payment services and found multiple ex-           cols from major Chinese providers and verifying them with
ploitable logic vulnerabilities. From a design and defense per-    Tamarin-Prover under weakened channel assumptions, we dis-
spective, [26] proposed a privacy-preserving mobile payment        cover a novel variant of this attack and establish a security
protocol and formally verified its security using ProVerif. [21]   property framework spanning three dimensions.
investigated personal payment systems built atop third-party          We further validate the threat in practice: a proof-of-
payment infrastructures and identified multiple vulnerabilities    concept attack on Android tampers with real payment or-
at both the protocol and implementation levels.                    ders for both Alipay and PSP-B, and a measurement study of
                                                                   hundreds of popular applications finds over 25% vulnerable.
8.2    Banking Payment Systems                                     Following our responsible disclosure, both providers have
                                                                   officially acknowledged the vulnerability.
Early research primarily focused on uncovering security vul-          Finally, we propose a deployable countermeasure that binds
nerabilities in mobile banking systems through empirical           user authorization to the order through user-side order au-
and systematic analyses. [27] revealed security flaws in mo-       thentication. Formal verification confirms that it satisfies all
bile banking systems from an application design perspective,       security properties even under weakened channel assump-
while [5, 16] further highlighted pervasive privacy and secu-      tions, offering a practical path toward more secure third-party
rity issues in real-world deployments. Building on this line       payments.



USENIX Association                                                                     35th USENIX Security Symposium         371
Acknowledgments                                                     References

We thank the anonymous reviewers and our shepherd for their          [1] Alipay. https://www.alipay.com/, 2025.
constructive feedback. This research was supported in part by
the National Cryptologic Science Fund of China under grant           [2] Alipay developer documentation. https://opendocs.
No. 2025NCSF02027, the National Natural Science Founda-                  alipay.com/open/00a0ut?pathHash=b19b288a,
tion of China under grants No. 62302343 and No. 62472323,                2025.
the Key R&D Program of Hubei Province under grant
                                                                     [3] China’s third-party payment industry research report
No. 2024BAB018, and the Wuhan Scientific and Technical
                                                                         (2025). https://report.iresearch.cn/report/
Achievements Project under grant No. 2024030803010172.
                                                                         202601/4780.shtml, 2026.
The corresponding authors are Jing Chen and Min Shi.
                                                                     [4] Formal models of third-party online payment protocols.
                                                                         https://doi.org/10.5281/zenodo.20303820,
Ethical Considerations                                                   2026.

The parties affected by this research are the users of Alipay        [5] Gilberto Marins de Almeida. M-payments in Brazil:
and PSP-B, the two providers themselves, and the merchants               Notes on how a country’s background may determine
whose applications integrate their SDKs. Across these par-               timing and design of a regulatory model. Wash. JL Tech.
ties, the principal risk is the potential misuse of the disclosed        & Arts, 8:347, 2012.
technique, which we mitigate through the safeguards below,
whereas the offsetting benefit is that it enables the providers      [6] David Basin, Jannik Dreier, Lucca Hirschi, Saša
and developers to remediate a fundamental design flaw before             Radomirovic, Ralf Sasse, and Vincent Stettler. A formal
it is exploited in the wild. All experiments were performed              analysis of 5G authentication. In Proc. of CCS, 2018.
using accounts fully controlled by the authors, without involv-
                                                                     [7] David Basin, Ralf Sasse, and Jorge Toro-Pozo. Card
ing real users or accessing real user funds, and all transactions
                                                                         brand mixup attack: Bypassing the PIN in Visa cards by
were limited to test environments or self-owned accounts.
                                                                         using them for Visa transactions. In Proc. of USENIX
The Android measurement study focused solely on whether
                                                                         Security, 2021.
payment requests could be intercepted or hijacked at the com-
munication level; no order tampering or manipulation of pay-         [8] David Basin, Ralf Sasse, and Jorge Toro-Pozo. The
ment amounts or outcomes was performed, and no financial                 EMV standard: Break, fix, verify. In Proc. of IEEE
or operational impact was imposed on application developers              S&P, 2021.
or merchants. To reduce the risk of misuse, affected appli-
cations are not individually identified and are reported only        [9] David Basin, Patrick Schaller, and Jorge Toro-Pozo. In-
in aggregated form. The protocol models presented in this                ducing authentication failures to bypass credit card PINs.
paper are reconstructed solely from public developer docu-               In Proc. of USENIX Security, 2023.
mentation, rather than from reverse engineering or leaked
internal specifications. The identified issues were responsibly     [10] Shweta Bhandari, Wafa Ben Jaballah, Vineeta Jain, Vijay
disclosed to Alipay and PSP-B, as well as to affected appli-             Laxmi, Akka Zemmari, Manoj Singh Gaur, Mohamed
cation developers, prior to publication, enabling mitigation             Mosbah, and Mauro Conti. Android inter-app commu-
before public disclosure; to prevent opportunistic exploitation          nication threats and detection techniques. Computers &
during the remediation window, we do not release the attack              Security, 70:392–421, 2017.
implementation or the list of affected applications.
                                                                    [11] Yi Chen, Luyi Xing, Yue Qin, Xiaojing Liao, XiaoFeng
                                                                         Wang, Kai Chen, and Wei Zou. Devils in the guidance:
                                                                         Predicting logic vulnerabilities in payment syndication
Open Science                                                             services through automated documentation analysis. In
                                                                         Proc. of USENIX Security, 2019.
To support transparency and reproducibility, we release an
artifact repository [4] containing the formal models of six         [12] Cas Cremers and Martin Dehnel-Wild. Component-
third-party payment protocols and our countermeasure, the                based formal analysis of 5G-AKA: Channel assump-
specifications of the proposed security properties, and scripts          tions and session confusion. In Proc. of NDSS, 2019.
for reproducing the formal verification results. For security
and ethical reasons, we do not release exploit code for real        [13] Cas Cremers, Marko Horvat, Jonathan Hoyland, Sam
merchant applications or data that could directly identify vul-          Scott, and Thyla Van Der Merwe. A comprehensive
nerable apps or merchants.                                               symbolic analysis of TLS 1.3. In Proc. of CCS, 2017.



372   35th USENIX Security Symposium                                                                         USENIX Association
[14] Cas Cremers, Marko Horvat, Sam Scott, and Thyla                payment protocol for mobile payment. ACM Transac-
     Van Der Merwe. Automated analysis and verification of          tions on Privacy and Security, 28(2):1–29, 2025.
     TLS 1.3: 0-RTT, resumption and delayed authentication.
     In Proc. of IEEE S&P, 2016.                               [27] Michael Paik. Stragglers of the herd get eaten: Security
                                                                    concerns for GSM mobile banking applications. In Proc.
[15] Xing Han, Yuheng Zhang, Xue Zhang, Zeyuan Chen,                of ACM HotMobile, 2010.
     Mingzhe Wang, Yiwei Zhang, Siqi Ma, Yu Yu, Elisa
     Bertino, and Juanru Li. Medusa attack: Exploring secu-    [28] Giancarlo Pellegrino and Davide Balzarotti. Toward
     rity hazards of In-App QR code scanning. In Proc. of           black-box detection of logic flaws in web applications.
     USENIX Security, 2023.                                         In Proc. of NDSS, 2014.

[16] Andrew Harris, Seymour Goodman, and Patrick Traynor.      [29] Andreea-Ina Radu, Tom Chothia, Christopher J.P. New-
     Privacy and security concerns associated with mobile           ton, Ioana Boureanu, and Liqun Chen. Practical EMV
     money applications in africa. Wash. JL Tech. & Arts,           relay protection. In Proc. of IEEE S&P, 2022.
     8:245, 2012.
                                                               [30] Bradley Reaves, Jasmine Bowers, Nolen Scaife, Adam
[17] Mohit Kumar Jangid, Yue Zhang, and Zhiqiang Lin. Ex-           Bates, Arnav Bhartiya, Patrick Traynor, and Kevin RB
     trapolating formal analysis to uncover attacks in Blue-        Butler. Mo(bile) money, mo(bile) problems: Analysis
     tooth passkey entry pairing. In Proc. of NDSS, 2023.           of branchless banking applications. ACM Transactions
                                                                    on Privacy and Security, 20(3):1–31, 2017.
[18] Renuka Kumar, Sreesh Kishore, Hao Lu, and Atul
     Prakash. Security analysis of Unified Payments Inter-     [31] Bradley Reaves, Nolen Scaife, Adam Bates, Patrick
     face and payment apps in india. In Proc. of USENIX             Traynor, and Kevin R. B. Butler. Mo(bile) money,
     Security, 2020.                                                mo(bile) problems: Analysis of branchless banking ap-
                                                                    plications in the developing world. In Proc. of USENIX
[19] Hyunwoo Lee, Zach Smith, Junghwan Lim, Gyeongjae
                                                                    Security, 2015.
     Choi, Selin Chun, Taejoong Chung, and Ted Taekyoung
     Kwon. maTLS: How to make TLS middlebox-aware?             [32] Daniel Reynaud, Dawn Xiaodong Song, Thomas R. Ma-
     In Proc. of NDSS, 2019.                                        grino, Edward XueJun Wu, and Eui Chul Richard Shin.
                                                                    FreeMarket: Shopping for free in Android applications.
[20] Fang Liu, Chun Wang, Andres Pico, Danfeng Yao, and
                                                                    In Proc. of NDSS, 2012.
     Gang Wang. Measuring the insecurity of mobile deep
     links of Android. In Proc. of USENIX Security, 2017.      [33] Joeri De Ruiter and Erik Poll. Formal analysis of the
[21] Jiadong Lou, Xu Yuan, and Ning Zhang. Messy states             EMV protocol suite. In Proc. of Joint Workshop on
                                                                    Theory of Security and Applications, 2011.
     of wiring: Vulnerabilities in emerging personal payment
     systems. In Proc. of USENIX Security, 2021.               [34] Min Shi, Jing Chen, Kun He, Haoran Zhao, Meng Jia,
[22] Gavin Lowe. A hierarchy of authentication specifica-           and Ruiying Du. Formal analysis and patching of BLE-
     tions. In Proc. of 10th Computer Security Foundations          SC pairing. In Proc. of USENIX Security, 2023.
     Workshop, 1997.
                                                               [35] Avinash Sudhodanan, Alessandro Armando, Roberto
[23] Simon Meier, Benedikt Schmidt, Cas Cremers, and                Carbone, and Luca Compagna. Attack patterns for black-
     David Basin. The TAMARIN prover for the symbolic               box security testing of multi-party web applications. In
     analysis of security protocols. In Proc. of CAV, 2013.         Proc. of NDSS, 2016.

[24] Fadi Mohsen, Manar Alohaly, Usman Rauf, Dominic           [36] Fangqi Sun, Liang Xu, and Zhendong Su. Detecting
     Therattil, and Loran Oosterhaven. PayScan: Detection           logic vulnerabilities in e-commerce applications. In
     and security analysis of payment libraries in Android          Proc. of NDSS, 2014.
     apps. International Journal of Information Security,
     24(4):189, 2025.                                          [37] Pu Sun, Sen Chen, Lingling Fan, Pengfei Gao, Fu Song,
                                                                    and Min Yang. VenomAttack: Automated and adaptive
[25] Collin Mulliner, William Robertson, and Engin Kirda.           activity hijacking in Android. Frontiers of Computer
     VirtualSwindle: An automated attack against in-app             Science, 17(1):171801, 2023.
     billing on Android. In Proc. of ASIA CCS, 2014.
                                                               [38] Enis Ulqinaku, Julinda Stefa, and Alessandro Mei. Scan-
[26] Jeyamohan Neera, Xiaomin Chen, Nauman Aslam, and               and-pay on Android is dangerous. In Proc. of IEEE
     Biju Issac. A trustworthy and untraceable centralised          INFOCOM, 2019.



USENIX Association                                                                35th USENIX Security Symposium       373
[39] Rui Wang, Shuo Chen, XiaoFeng Wang, and Shaz
     Qadeer. How to shop for free online–security analy-
                                                                                      op                           Merchant Server
     sis of cashier-as-a-service based web stores. In Proc. of                   Sh                Merchant App

     IEEE S&P, 2011.                                                                                      SDK
                                                                                                                                           Funds transfer
                                                                                Passw
                                                                     User              ord
[40] Wenbo Yang, Juanru Li, Yuanyuan Zhang, and Dawu
     Gu. Security analysis of third-party in-app payment in                                          PS-App
                                                                                                                     PS-Server
     mobile applications. Journal of Information Security
     and Applications, 48:102358, 2019.                                     Figure 9: Payment Scenario I – In-app Payment
[41] Wenbo Yang, Yuanyuan Zhang, Juanru Li, Hui Liu, Qing
     Wang, Yueheng Zhang, and Dawu Gu. Show me the
     money! finding flawed implementations of third-party                                   op                      Merchant Server
                                                                       Device          Sh            Mobile Web
     in-app payment in Android apps. In Proc. of NDSS,
                                                                                                          URL
     2017.                                                                                                Scheme                            Funds transfer
                                                                                     Passw
                                                                        User                 ord


A     Payment Scenarios Illustrations                                                                  PS-App
                                                                                                                      PS-Server


Three third-party online payment scenarios were discussed in         Figure 10: Payment Scenario II – Mobile Web Payment
Section 2.2. We provide detailed workflow diagrams for each
of these payment scenarios, as shown in Figures 9–11.
   In in-app payment, as shown in Figure 9, the workflow is
                                                                            Desktop
as follows:                                                                                        Webpage
                                                                                                                   Merchant Server
                                                                                      op
                                                                                 Sh

Step 1. The user selects goods in the merchant application                                              Scan the
                                                                                                        QR code                           Funds transfer
        and initiates a purchase request.                                       Pa
                                                                                  ssw
                                                                                           ord
                                                                     User

Step 2. The merchant application communicates with the
        merchant server to create the order and obtain the                                          PS-App
        payment-relevant information required for the subse-            Mobile device

        quent payment process.
                                                                      Figure 11: Payment Scenario III – QR Code Payment
Step 3. The merchant application invokes the payment
        provider’s SDK to launch PS-App and delivers the
        payment information to PS-App.                           which are described below. The remaining steps follow the
                                                                 in-app payment workflow.
Step 4. The user authorizes the payment within PS-App by
        entering the payment password.                           Step 1. The user selects goods in the merchant webpage and
                                                                         initiates a purchase request.
Step 5. PS-App submits the payment request to PS-Server,
        which validates the request and proceeds with pay-       Step 2. The merchant webpage communicates with the mer-
        ment execution.                                                  chant server to create the order and obtain the
                                                                         payment-relevant information required for the subse-
Step 6. The PS-Server performs the funds transfer to com-                quent payment process.
        plete the transaction.
                                                                 Step 3. The merchant webpage displays a QR code encoding
Step 7. The PS-Server sends a callback notification to the               the payment information. The user scans the QR
        merchant server, enabling the merchant server to up-             code on the mobile device, which launches PS-App
        date the order status accordingly.                               and transfers the payment information to PS-App.

   In mobile web payment, as shown in Figure 10, the work-
flow is mostly similar to that of in-app payment. The main
                                                                 B          Alipay & PSP-B Protocols
difference lies in Step 3: the mobile web page launches PS-
App via a dedicated URL scheme registered by PS-App at the       We summarize the Alipay and PSP-B protocols, reconstructed
operating system level.                                          from their official developer documentation, across the three
   In QR code payment, as shown in Fig. 11, the workflow         payment scenarios in Figures 12 and 13.
differs from the previous two scenarios mainly in Steps 1–3,



374   35th USENIX Security Symposium                                                                                                  USENIX Association
                                                                                                                                                                                                                                                                                         U                  i PW                     2 MS                      APA                             w APS

                                                                                                                                                                                                                                                                                  Select goods
        U                      i MA                      2 MS                     APA                           w APS                                U                   i MW                    2 MS                     APA                           w APS
                                                                                                                                                                                                                                                                                 i                goods
                                                                                                                                                                                                                                                                                                  goods
                                                                                                                                                                                                                                                                                                                           goods
                                                                                                                                                                                                                                                                                                                           goods
 Select goods                                                                                                                                   Select goods
i                   goods
                    goods                                                                                                                      i                goods
                                                                                                                                                                goods                                                                                                                                              out trade no := random()
                                             goods
                                             goods                                                                                                                                       goods
                                                                                                                                                                                         goods
                                                                                                                                                                                                                                                                                                                   total amount, sub ject := calculate(goods)
                                                                                                                                                                                                                                                                                                                   order = app id ∥ sub ject ∥ out trade no
                                       out trade no := random()                                                                                                                    out trade no := random()                                                                                                                ∥ total amount ∥ "QR_CODE_OFFLINE"
                                       total amount, sub ject := calculate(goods)                                                                                                  total amount, sub ject := calculate(goods)                                                                                      Sorder := sign privM (order)
                                       order = app id ∥ sub ject ∥ total amount                                                                                                    order = app id ∥ sub ject ∥ total amount                                                                                        orderStr := order ∥ Sorder
                                               ∥ out trade no ∥ noti f y url                                                                                                               ∥ out trade no ∥ noti f y url
                                                                                                                                                                                                                                                                                 ii                                                                           orderStr
                                                                                                                                                                                                                                                                                                                                                              orderStr
                                                                                                                                                                                                                                                                                                                                                              orderStr
                                       Sorder := sign privM (order)                                                                                                                Sorder := sign privM (order)
                                       orderStr := order ∥ Sorder                                                                                                                   f orm := order ∥ Sorder                                                                                                                                                                   if validate(orderStr) then
ii                                          orderStr
                                            orderStr                                                                                           ii                                        fform
                                                                                                                                                                                           orm                                                                                                                                                                                   continue()
                                                                                                                                                                                                      ff orm
                                                                                                                                                                                                         orm                                                                                                                                                                  else abort()
                                                         orderStr
                                                         orderStr
                                                                                                                                                                                                                                                                                                                                                                              trade no := random()
                                                                                                 orderStr
                                                                                                 orderStr                                                                                                                                    fform
                                                                                                                                                                                                                                               orm
                                                                                                                                                                                                                                                                                                                                                                              qr code := total amount ∥ sub ject
                                                                                                     if validate(orderStr) then                                                                                                                  if validate( f orm) then                                                                                                             ∥ trade no
                                                                                                        continue()                                                                                                                                  continue()                                                                                                qr code
                                                                                                                                                                                                                                                                                                                                                              qr code
                                                                                                     else abort()                                                                                                                                else abort()                                                             qr code
                                                                                                                                                                                                                                                                                                                          qr code
                                                                                                                                                                                                                                                                                                                                      qr code
                                                                                                                                                                                                                                                                                                                                      qr code
                                                                                       "Request password"
                                                                                       "Request password"
                                                                                       "Request
                                                                                       "Request password"
                                                                                                password"                                                                                                                        "Request password"
                                                                                                                                                                                                                                 "Request password"
                                                                                                                                                                                                                                 "Request
                                                                                                                                                                                                                                 "Request password"
                                                                                                                                                                                                                                          password"
                               total amount,sub
                               total amount, subject,
                                                ject,account,
                                                      account,...
                                                              ...                                                                                                          total amount,
                                                                                                                                                                           total amount,sub
                                                                                                                                                                                         subject,
                                                                                                                                                                                            ject,account,
                                                                                                                                                                                                  account,...
                                                                                                                                                                                                          ...                                                                                                total amount,sub
                                                                                                                                                                                                                                                                                                             total amount,          account,...
                                                                                                                                                                                                                                                                                                                              ject,account,
                                                                                                                                                                                                                                                                                                                           subject,         ...

Enter password                                                                                                                                 Enter password                                                                                                                    Enter password
                                           password
                                           password
                                           password                                                                                                                                    password
                                                                                                                                                                                       password
                                                                                                                                                                                       password                                                                                                                          password
                                                                                                                                                                                                                                                                                                                         password
                                                                                             hash(password)
                                                                                             hash(password)                                                                                                                           hash(password)
                                                                                                                                                                                                                                      hash(password)                                                                                                                    hash(password)
                                                                                                                                                                                                                                                                                                                                                                        hash(password)
iii                                                                                                                                            iii
                                                                                                 if validate(hash(password)) then                                                                                                          if validate(hash(password)) then      iii                                                                                           if validate(hash(password)) then
                                                                                                    make payment()                                                                                                                            make payment()                                                                                                                      make payment()
                                                                                                 else abort()                                                                                                                              else abort()                                                                                                                        else abort()


                                                                                             trade no := random()                                                                                                                    trade no := random()                                                                                                              trade no := random()
                                                                                             result := "success" ∥ app id ∥ trade no                                                                                                 result := "success" ∥ app id ∥ trade no                                                                                           result := "success" ∥ app id ∥ trade no
                                                                                                         ∥ out trade no ∥ total amount                                                                                                           ∥ out trade no ∥ total amount                                                                                                     ∥ out trade no ∥ total amount
                                                                                             Sresult := sign privA (result)                                                                                                          Sresult := sign privA (result)                                                                                                    Sresult := sign privA (result)
                                                                               result,SSresult
                                                                               result,  result
                                                                                        result
                                                                                        result                                                                                                                           result,SSresult
                                                                                                                                                                                                                         result,  result
                                                                                                                                                                                                                                  result
                                                                                                                                                                                                                                  result                                                                                                                    result,SSresult
                                                                                                                                                                                                                                                                                                                                                            result,  result
                                                                                                                                                                                                                                                                                                                                                                     result
                                                                                                                                                                                                                                                                                                                                                                     result
iv                                                                                             result,SSresult
                                                                                               result,   result
                                                                                                        result                                 iv                                                                                        result,SSresult
                                                                                                                                                                                                                                         result,  result
                                                                                                                                                                                                                                                   result
                                                                                                                                                                                                                                                  result
                                                                                                                                                                                                                                                                                 iv                                                                                           result,SSresult
                                                                                                                                                                                                                                                                                                                                                                              result,  result
                                                                                                                                                                                                                                                                                                                                                                                        result
                                                                                                                                                                                                                                                                                                                                                                                       result

                                                                          if validate(Sresult ) then                                                                                                                if validate(Sresult ) then                                                                                                         if validate(Sresult ) then
                                                                             continue()                                                                                                                                continue()                                                                                                                         continue()
                                                                          else abort()                                                                                                                              else abort()                                                                                                                       else abort()
                            "Successful"
                            "Successful",total
                            "Successful"
                            "Successful"        amount,
                                         ,total amount, sub ject,
                                                        sub ject,
                                                amount,sub        ...
                                                            ject,...
                                                                  ...                                                                                                   "Successful"
                                                                                                                                                                        "Successful",total
                                                                                                                                                                        "Successful"
                                                                                                                                                                        "Successful"        amount, sub
                                                                                                                                                                                                    sub ject,
                                                                                                                                                                                            amount,sub
                                                                                                                                                                                     ,total amount,     ject, ...
                                                                                                                                                                                                        ject,...
                                                                                                                                                                                                              ...                                                                                         "Successful",total
                                                                                                                                                                                                                                                                                                          "Successful"
                                                                                                                                                                                                                                                                                                          "Successful"        amount, sub
                                                                                                                                                                                                                                                                                                                              amount,sub
                                                                                                                                                                                                                                                                                                                       ,total amount,     ject,
                                                                                                                                                                                                                                                                                                                                      sub ject, ...
                                                                                                                                                                                                                                                                                                                                          ject,...
                                                                                                                                                                                                                                                                                                                                                ...




                             (a) Alipay In-App Payment                                                                                                           (b) Alipay Mobile Web Payment                                                                                                        (c) Alipay QR Code Payment

Figure 12: Alipay Payment Methods. Notations: APA: the Alipay payment application. APS: the Alipay payment server.
out_trade_no: the order number of the MS. total_amount: the payment amount. sub ject: the order title describing the purchased
goods, which is displayed to the user during payment. app_id: the merchant application identifier. noti f y_url: the merchant
callback endpoint. orderStr: the signed order string generated by the merchant server. trade_no: the Alipay transaction number.
f orm: the HTML form. qr_code: the QR code. privA : the private key of APA.

         U                       i MA                         2 MS                            BPS

     Select goods
 i                   goods
                     goods
                     goods
                                                 goods
                                                 goods
                                                                                                                                                      U                    i MW                          2 MS                             BPS                                           U                     i PW                             2 MS                              BPS
                                         out trade no, nonce := random()
                                         amount, description := calculate(goods)
                                         body := appid ∥ mchid ∥ description ∥ nonce                                                      Select goods                                                                                                                                Select goods
                                                 ∥ out trade no ∥ noti f y url ∥ amount                                                  i                      goods
                                                                                                                                                                goods                                                                                                             i                  goods
                                                                                                                                                                                                                                                                                                     goods
                                         Sbody := sign privM (body)                                                                                                                         goods
                                                                                                                                                                                            goods                                                                                                                                  goods
                                                                                                                                                                                                                                                                                                                                   goods
                                         message := mchid ∥ Sbody ∥ body
                                                                            message
                                                                            message                                                                                                out trade no, nonce := random()                                                                                                       out trade no, nonce := random()
                                                                                                                                                                                   amount, description := calculate(goods)                                                                                               amount, description := calculate(goods)
                                                                                  if validate(message) then                                                                        body := appid ∥ mchid ∥ description ∥ nonce                                                                                           body := appid ∥ mchid ∥ description ∥ nonce
                                                                                     continue()                                                                                            ∥ out trade no ∥ noti f y url ∥ amount                                                                                                ∥ out trade no ∥ noti f y url ∥ amount
                                                                                  else abort()                                                                                     Sbody := sign privM (body)                                                                                                            Sbody := sign privM (body)
ii                                                                                prepay id := random()
                                                                                                                                                                                   message := mchid ∥ Sbody ∥ body                                                                                                       message := mchid ∥ Sbody ∥ body
                                                                           prepay
                                                                           prepay id
                                                                           prepay id
                                                                                  id
                                                                                                                                                                                                                        message
                                                                                                                                                                                                                        message                                                                                                                               message
                                                                                                                                                                                                                                                                                                                                                              message
                                           nonceStr := random()
                                           params := appid ∥ nonceStr ∥ prepay id                                                                                                                                            if validate(message) then                                                                                                             if validate(message) then
                                           S params := sign privM (params)                                                                                                                                                      continue()                                                                                                                            continue()
                                           request := mchid ∥ params ∥ S params                                                                                                                                              else abort()                                                                                                                          else abort()
                                                request
                                                                                                                                         ii                                                                                  h5 url := random()                                   ii                                                                               code url := random()
                                                request
                                                request
                                                               request
                                                               request                                                                                                                                                  h5 url
                                                                                                                                                                                                                        h5 url                                                                                                                                    url
                                                                                                                                                                                                                                                                                                                                                             code url
                                                                                                                                                                                                                                                                                                                                                             code url
                                                                                                                                                                                           h5 url
                                                                                                                                                                                           h5 url                                                                                                                              code url
                                                                                                                                                                                                                                                                                                                               code url
                                                                                  if validate(request) then
                                                                                     continue()                                                                                                            h5 url
                                                                                                                                                                                                           h5 url                                                                                                                               code
                                                                                                                                                                                                                                                                                                                                                code url
                                                                                                                                                                                                                                                                                                                                                     url
                                                                                  else abort()                                                                                amount,description,
                                                                                                                                                                              amount, description,account,
                                                                                                                                                                                                  account,...
                                                                                                                                                                                                           ...                                                                                                     amount,description,
                                                                                                                                                                                                                                                                                                                   amount, description,account,
                                                                                                                                                                                                                                                                                                                                       account,...
                                                                                                                                                                                                                                                                                                                                                ...
                                    amount,description,
                                    amount, description,account, ...
                                                        account,...                                                                      Enter password                                                                                                                          Enter password
                                                                                                                                                                                           password
                                                                                                                                                                                           password                                                                                                                              password
                                                                                                                                                                                                                                                                                                                                 password
Enter password                                                                                                                           iii                                                                                                                                     iii
                                                password
                                                password
                                                                                                                                                                                                                            if validate(password) then                                                                                                             if validate(password) then
iii
                                                                                  if validate(password) then                                                                                                                   make payment()                                                                                                                         make payment()
                                                                                     make payment()                                                                                                                         else abort()                                                                                                                           else abort()
                                                                                  else abort()
                                                                                                                                                                                                                id,transaction id, summary := random()                                                                                                id,transaction id, summary := random()
                                                                    id,transaction id, summary := random()                                                                                                      nonce1 , nocne2 := random()                                                                                                           nonce1 , nocne2 := random()
                                                                    nonce1 , nocne2 := random()                                                                                                                 data := appid ∥ mchid ∥ out trade no                                                                                                  data := appid ∥ mchid ∥ out trade no
                                                                    data := appid ∥ mchid ∥ out trade no                                                                                                                 ∥ transaction id ∥ amount ∥ nonce1                                                                                                    ∥ transaction id ∥ amount ∥ nonce1
                                                                             ∥ transaction id ∥ amount ∥ nonce1                                                                                                 Edata := encAPIV 3 (data)                                                                                                             Edata := encAPIV 3 (data)
                                                                    Edata := encAPIV 3 (data)                                                                                                                   result := id ∥ nonce1 ∥ summary ∥ nonce2 ∥ Edata                                                                                      result := id ∥ nonce1 ∥ summary ∥ nonce2 ∥ Edata
                                                                    result := id ∥ nonce1 ∥ summary ∥ nonce2 ∥ Edata                                                                                            Sresult := sign privW (result)                                                                                                        Sresult := sign privW (result)
                                                                    Sresult := sign privW (result)                                       iv                                                                                                                                      iv
iv                                                                                                                                                                                     amount,description,
                                                                                                                                                                         "Successful",,amount,
                                                                                                                                                                         "Successful"          description,...
                                                                                                                                                                                                           ...                                                                                                               amount,description,
                                                                                                                                                                                                                                                                                                               "Successful",,amount,
                                                                                                                                                                                                                                                                                                               "Successful"          description,...
                                                                                                                                                                                                                                                                                                                                                 ...
                                                                                                                                                                         "Successful"
                                                                                                                                                                         "Successful"                                                                                                                          "Successful"
                                                                                                                                                                                                                                                                                                               "Successful"
                               "Successful"  amount,description,
                               "Successful",,amount,
                               "Successful"
                               "Successful"          description,...
                                                                 ...
                                                                                                                                                                                                                     result,SSresult
                                                                                                                                                                                                                     result,  result
                                                                                                                                                                                                                              result                                                                                                                       result,SSresult
                                                                                                                                                                                                                                                                                                                                                           result,  result
                                                                                                                                                                                                                                                                                                                                                                    result
                                                                          result,SSresult
                                                                          result,   result
                                                                                   result
                                                                                                                                                                                                                              result                                                                                                                                result


                                                       if validate(result) then                                                                                                                  if validate(result) then                                                                                                             if validate(result) then
                                                          continue()                                                                                                                                continue()                                                                                                                           continue()
                                                       else abort()                                                                                                                              else abort()                                                                                                                         else abort()
                                                                         "Successful"
                                                                         "Successful"
                                                                         "Successful"
                                                                         "Successful"                                                                                                                               "Successful"
                                                                                                                                                                                                                    "Successful"
                                                                                                                                                                                                                    "Successful"
                                                                                                                                                                                                                    "Successful"                                                                                                                         "Successful"
                                                                                                                                                                                                                                                                                                                                                         "Successful"
                                                                                                                                                                                                                                                                                                                                                         "Successful"
                                                                                                                                                                                                                                                                                                                                                         "Successful"




                       (a) PSP-B In-App Payment                                                                                                             (b) PSP-B Mobile Web Payment                                                                                                              (c) PSP-B QR Code Payment

Figure 13: PSP-B Payment Methods. Notations: BPS: the PSP-B system, abstracting its externally visible payment functionality.
appid: the merchant application identifier. mchid: the merchant identifier. description: the order description, which is displayed
to the user during payment. prepay_id: the prepayment token. id: the number of callback notification. transaction_id: the
PSP-B transaction number. summary: the summary notes for callback content. nonce/nonce1 /nonce2 : a fresh nonce for replay
protection. enck (m): encrypting message m under key k using AES symmetric encryption. APIV 3: the symmetric key shared
between MS and BPS. privW : the private key of BPS. h5_url: an intermediate URL the merchant H5 page accesses to launch the
PSP-B cashier and complete the payment. code_url: the URL to be encoded into the QR code.




USENIX Association                                                                                                                                                                                                                                                                35th USENIX Security Symposium                                                                                         375
C     Artifact Appendix                                            C.3.1   Installation
                                                                    1. Pull our pre-built Docker image.
This artifact appendix provides a roadmap for evaluating the
artifact associated with our paper, “When Authorization Loses           $ docker pull ghcr.io/luojiazhishu\
Its Meaning: Breaking and Fixing Third-Party Online Pay-                /tamarin-docker/toolbox:latest
ments”.
                                                                    2. Download and extract the artifact archive from Zenodo
                                                                       (https://doi.org/10.5281/zenodo.20303820).
C.1     Abstract                                                       After extraction, the directory structure is as follows:

This artifact provides the formal models and verification               .
                                                                        |-- models
framework used to analyze the security of third-party online            |   |-- base
payment protocols.                                                      |   |-- countermeasures
                                                                        |   |-- secure_ms_channel
                                                                        |   `-- secure_ps_channel
C.2     Description & Requirements                                      |-- results
                                                                        |   |-- base
This section describes the steps and requirements needed to             |   |-- countermeasures
                                                                        |   |-- secure_ms_channel
set up the artifact and reproduce the experiments.                      |   `-- secure_ps_channel
                                                                        |-- scripts
                                                                        |   |-- fix.py
C.2.1    Security, privacy, and ethical concerns                        |   |-- parse.py
                                                                        |   `-- run.py
None. The formal models in this artifact are derived exclu-             |-- Makefile
sively from publicly available developer documentation of               `-- README.md
the studied payment platforms. No reverse engineering, no            The top-level entries are organized as follows:
inspection of proprietary or internal documents, and no testing
                                                                     • ./models/: Tamarin formal models. The subdirectories
against live accounts or production systems was performed.
                                                                       secure_ms_channel/, secure_ps_channel/, and
                                                                       base/ correspond to three channel security assumptions,
C.2.2    How to access                                                 each containing six payment-protocol models (two pay-
                                                                       ment providers × three payment scenarios) — 18 proto-
The artifact is archived on Zenodo and can be accessed                 col models in total. The formal models of our proposed
through the following DOI: https://doi.org/10.5281/                    countermeasures are under countermeasures/.
zenodo.20303820.                                                     • ./scripts/: Helper scripts for running Tamarin and
                                                                       aggregating its output into JSON/CSV summaries.
                                                                     • ./results/: Verification results produced by Tamarin,
C.2.3    Hardware dependencies                                         mirroring the subdirectory layout of ./models/.
                                                                     • ./Makefile: Entry point that orchestrates the full eval-
An x86-64 machine with at least 8 CPU cores, 32 GB of RAM,
                                                                       uation pipeline.
and 10 GB of free disk space.
                                                                   C.3.2   Basic Test
C.2.4    Software dependencies                                     To verify the environment, run:
Ubuntu 24.04 with Docker installed.                                $ docker run --rm ghcr.io/luojiazhishu\
                                                                   /tamarin-docker/toolbox:latest \
                                                                     tamarin-prover test
C.2.5    Benchmarks
                                                                      If the installation is successful, the command output con-
None                                                               tains the following test summary:
                                                                   *** TEST SUMMARY ***
C.3     Set-up                                                     All tests successful.
                                                                   The tamarin-prover should work as intended.
This section describes the installation and basic test steps
required to prepare the environment for evaluating the artifact.                 :-) happy proving (-:



376     35th USENIX Security Symposium                                                                    USENIX Association
C.4     Evaluation workflow                                               --interface=0.0.0.0 \
                                                                          --derivcheck-timeout=0 \
The evaluation workflow involves formal model verification                ./results/base
using the Tamarin Prover.
                                                                       Then open http://127.0.0.1:3001 in a browser on
                                                                       the host machine.
C.4.1    Major Claims                                             The Tamarin lemma names that appear in results.csv and
(C1): The verification results of six third-party online pay-     in each result.json correspond to the security properties
    ment protocols under three channel assumptions repro-         defined in the paper as follows:
    duce Table 1 in the paper. Supported by experiment (E1).      • PS_MS_Order_Injective_Agreement: IA-O1.
(C2): The verification results of our countermeasures repro-      • U_MS_Order_Injective_Agreement: IA-O2.
    duce Table 2 in the paper. Supported by experiment (E1).      • MS_PS_Response_Injective_Agreement: IA-R1.
                                                                  • U_PS_Response_Injective_Agreement: IA-R2.
                                                                  • No_Payment_Without_Password_Input: IA-UA.
C.4.2    Experiments
(E1): Verification [ 3 human-minutes + 1 compute-hour ]:          C.5    Version
     Use the Tamarin Prover to check the security lemmas of
     every formal model in ./models/. The resulting veri-         Based on the LaTeX template for Artifact Evaluation
     fied/falsified outcomes should match Table 1 and Table 2     V20231005. Submission, reviewing and badging methodol-
     of the paper.                                                ogy followed for the evaluation of this artifact can be found at
     How to: Run the verification in three steps.                 https://secartifacts.github.io/usenixsec2026/.
     Preparation: With the installation in Section A.3 com-
     pleted, launch the Tamarin toolbox container from the
     artifact root directory:
      $ docker run -d \
        --name tamarin-toolbox \
        -p 3001:3001 \
        -v "$(pwd):/root" \
        -w /root \
        ghcr.io/luojiazhishu\
      /tamarin-docker/toolbox:latest
      Execution: Enter the container, clear any pre-existing
      results, and run the verification pipeline:
      $ docker exec -it -w /root \
        tamarin-toolbox bash
      $ make clean
      $ make all JOBS=1
      On the reference hardware (8 cores, 32 GB RAM),
      JOBS=1 completes the full verification in about one hour.
      On a more powerful machine (e.g., 32 cores and 64 GB
      RAM), increase parallelism with make all JOBS=8 to
      reduce the total time to roughly 30 minutes.
      Results: The top-level file ./results/results.csv
      aggregates the verification outcome of every lemma
      across all models; its rows reproduce Table 1 and Ta-
      ble 2 of the paper. Each subdirectory of ./results/
      corresponds to one channel security assumption (or to
      the countermeasures) and contains one .spthy proof
      file per protocol plus a result.json summarising that
      subdirectory. To inspect a proof graph, launch Tamarin’s
      web interface inside the container; for example, to view
      the proofs under ./results/base/, run:
      $ tamarin-prover interactive \



USENIX Association                                                                    35th USENIX Security Symposium         377
