Install
$ agentstack add skill-zhaji2333-ckskills-business-logic-race ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
business-logic-race — 业务逻辑与并发竞态专项深度挖掘
何时调用(触发条件)
- 支付流程:下单→支付→回调→发货→退款→提现
- 资金相关:金额、数量、折扣、优惠券、积分、余额、红包
- 状态流转:订单状态、审批状态、权益状态可被篡改/跳过
- 并发场景:库存扣减、优惠券领取、提现、转账、兑换
- 业务复杂:状态机不清晰、一致性校验位置不明
一、业务逻辑建模(先理解再测试)
原则:不理解业务就不可能发现业务逻辑漏洞。
测试任何功能前,必须先回答:
- 这个功能的完整状态机是什么?(所有状态+所有转换条件)
- 每个状态转换谁有权执行?(角色矩阵)
- 哪些转换不应该被允许?(非法路径)
- 数据在各环节的一致性校验在哪里做的?(前端/后端/数据库)
- 并发场景下会不会出问题?(竞态条件)
重点建模场景:
- 支付流程:下单→支付→回调→发货→退款→提现(每个箭头都是攻击点)
- 认证流程:注册→登录→找回密码→绑定→解绑(每个步骤的凭证传递)
- 权限模型:角色→权限→资源(每个绑定关系是否可篡改)
- 审批流程:提交→审核→通过/驳回(能否跳过/重放/篡改状态)
二、支付/资金类场景表(全景)
| 场景 | 漏洞类型 | 挖掘要点 | |---|---|---| | 商品下单 | 金额篡改/数量篡改 | 价格参数可控、负数/0元/小数精度 | | 优惠券/积分/红包 | 无限领取/超额使用/叠加 | 并发领取、ID遍历、多券叠加 | | 支付回调 | 签名绕过/金额不一致 | 回调验签缺失、金额未二次校验 | | 退款流程 | 重复退款/超额退款 | 并发退款、退款金额可控 | | 提现/转账 | 越权提现/金额篡改 | 提现账户可控、余额校验绕过 | | 会员/订阅 | 越权开通/无限试用 | 会员等级可控、试用次数绕过 | | 虚拟货币/积分 | 积分盗刷/负数充值 | 并发兑换、金额类型混淆 | | 分销/返佣 | 自推自/刷单 | 邀请关系可控、返佣逻辑缺陷 |
三、业务逻辑漏洞攻击套路
支付类:
- 金额参数篡改(0.01、负数、小数精度)
- 优惠券/积分/余额叠加
- 订单状态跳变(未支付→已支付)
- 并发重放(多次到账)
- 退款不扣库存
权益类:
- 无限领取/次数限制绕过
- 试用→正式状态跳过
- 会员等级参数可控
流程类:
- 跳步(绕过前置节点)
- 重放(同一步骤多次执行)
- 状态回退/覆盖
四、并发与竞态专项
常见竞态场景
- 库存扣减:并发下单是否超卖
- 优惠券领取:并发领取是否多发
- 提现/转账:并发操作余额是否被重复扣
- 兑换:积分并发兑换是否重复到账
- 退款:并发退款是否超额
测试方法
- 同一请求并发发送(
xargs -P/ Burp Turbo Intruder / 脚本线程池) - 在关键操作(支付回调、发货、领券)同时重放请求
- 观察数据库/业务结果的最终一致性
修复方向
- 幂等键:请求唯一标识,重复请求直接返回
- 数据库约束:唯一索引、余额非负约束、乐观锁
- 分布式锁 / 事务隔离
- 服务端二次校验:回调金额与订单金额比对,状态校验原子化
五、验证要点
- 每个状态转换测试:正常路径、跳过、回退、重放、并发
- 数据一致性校验位置:前端传参 vs 服务端计算
- 金额/数量:负数、0、小数精度、类型替换(字符串/数组)
- 支付回调:验签缺失、金额未二次校验、notify_url 可控
- 并发结果必须有证据:多次成功响应/数据库记录差异
六、修复建议
- 金额/价格以服务端为准,禁止信任前端传参
- 状态转换服务端校验合法性(状态机表驱动)
- 幂等、唯一约束、分布式锁
- 回调验签 + 金额二次校验 + 回调防重放
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: zhaji2333
- Source: zhaji2333/CkSKILLS
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.