arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.14419cs.SE
收藏

HoldSpec:支付授权冻结生命周期的机器可验证模型与一致性套件

HoldSpec: A Machine-Checked Model and Conformance Suite for the Payment Authorization Hold Lifecycle

Abhishek Sharma

AI总结:

该研究针对支付授权冻结生命周期,用TLA+构建状态机并生成一致性套件,可100%检测植入缺陷,还能发现不同支付提供商间的文档隐含差异。

摘要:

当商户授权卡片并后续收取资金时,资金会处于一种双方均无法完全控制的状态:冻结在持卡人账户中,尚未被收取,且将在卡组织设定的截止日期失效。商户对该冻结可执行的操作,如部分收取、再次收取、作废、提高金额、让其失效等,是每家支付服务提供商实现略有不同的业务逻辑,且没有任何一家提供正式规范。我们用TLA+为该生命周期构建了一个状态机,以提供商能力配置文件为参数,针对6个配置文件检查了8个安全不变量和3个活性属性,其中5个配置文件基于Stripe和Adyen的公开文档构建。我们从同一台机器生成了一个一致性套件,可针对提供商API运行黑盒测试。针对61个可与正确实现区分的植入缺陷,生成的套件检测到100%的缺陷,而具有相同调用预算的随机序列达到56%,手写集成套件达到69%;获得十倍预算的随机序列仍仅达到67%。在两个提供商之间运行同一套件时,比较变成了搜索,它返回了两个文档集所隐含但均未声明的差异的简短可执行见证,包括一个打破了“单个适配器接口可同时适配两者”这一常见假设的情况,因为关闭冻结并释放其剩余部分在一个提供商处是收取操作,而在另一个提供商处是取消操作。我们报告了无法完成的工作:没有可用的提供商沙盒凭证,因此此处的所有结果均涉及文档化行为,而将用于测试提供商本身的套件是我们发布的内容之一。

英文摘要:

When a merchant authorizes a card and captures the funds later, the money sits in a state that neither party fully controls: held on the cardholder's account, not yet taken, and due to lapse on a deadline set by the card network. What a merchant may do to that hold, capture part of it, capture again, void it, raise it, let it expire, is business logic that every payment service provider implements slightly differently and none of them specifies formally. We give the lifecycle a state machine in TLA+, parameterized by a provider capability profile, and check eight safety invariants and three liveness properties over 6 profiles, five of them built from Stripe's and Adyen's published documentation. From the same machine we generate a conformance suite that runs black-box against a provider API. Against 61 seeded defects that are distinguishishable from a correct implementation, the generated suite detects 100%, where random sequences with the same call budget reach 56% and a hand-written integration suite reaches 69%; random sequences given ten times the budget still reach only 67%. Running the same suite between two providers turns the comparison into a search, and it returns short executable witnesses for divergences the two documentation sets imply but neither states, including one that breaks the common assumption that a single adapter interface can sit over both, because closing a hold and releasing its remainder is a capture on one provider and a cancel on the other. We report what we could not do: no provider sandbox credentials were available, so every result here concerns documented behavior, and the suite that would test the providers themselves is part of what we release.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑