CkSKILLS: Skill for Claude Code

.agents/skills/business-logic-race/SKILL.md

business-logic-race is a skill for Claude Code, Codex from zhaji2333/CkSKILLS. It costs 94 tokens per session (1,331 once invoked), scanned A, original, MIT.

A security review method for business workflows such as payments, refunds, transfers, stock, coupons, and subscriptions. It maps allowed state changes and checks whether those rules can be bypassed or repeated.

In plain words
What is it for?
Use it to assess payment and account flows, test permissions and invalid steps, and look for amount tampering, duplicate actions, race conditions, and replay attacks.
Why use it?
It helps find flaws that ordinary input checks may miss, such as changing an unpaid order to paid, altering amounts, receiving a benefit twice, or exploiting simultaneous requests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is zhaji2333/CkSKILLS's own configuration. It tells Claude Code and Codex how to work on CkSKILLS itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything CkSKILLS configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zhaji2333/CkSKILLS. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zhaji2333/CkSKILLS/main/.agents/skills/business-logic-race/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/zhaji2333/CkSKILLS

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for business-logic-race

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhaji2333/ckskills/business-logic-race/github.svg)](https://agentmods.dev/skills/zhaji2333/ckskills/business-logic-race)
Your own site
<a href="https://agentmods.dev/skills/zhaji2333/ckskills/business-logic-race"><img src="https://agentmods.dev/badge/skills/zhaji2333/ckskills/business-logic-race/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for business-logic-race

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhaji2333/ckskills/business-logic-race"><img src="https://agentmods.dev/badge/skills/zhaji2333/ckskills/business-logic-race.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,331 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00094 $0.01331
Opus 5 $0.00047 $0.00665
Sonnet 5 $0.00019 $0.00266
Haiku 4.5 $0.00009 $0.00133

Measured 13d ago against content hash 81c6781d64c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

business-logic-race scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/business-logic-race/SKILL.md · 102 lines

What it actually says

business-logic-race — 业务逻辑与并发竞态专项深度挖掘

何时调用(触发条件)

  • 支付流程:下单→支付→回调→发货→退款→提现
  • 资金相关:金额、数量、折扣、优惠券、积分、余额、红包
  • 状态流转:订单状态、审批状态、权益状态可被篡改/跳过
  • 并发场景:库存扣减、优惠券领取、提现、转账、兑换
  • 业务复杂:状态机不清晰、一致性校验位置不明

一、业务逻辑建模(先理解再测试)

原则:不理解业务就不可能发现业务逻辑漏洞。

测试任何功能前,必须先回答:

  1. 这个功能的完整状态机是什么?(所有状态+所有转换条件)
  2. 每个状态转换谁有权执行?(角色矩阵)
  3. 哪些转换不应该被允许?(非法路径)
  4. 数据在各环节的一致性校验在哪里做的?(前端/后端/数据库)
  5. 并发场景下会不会出问题?(竞态条件)

重点建模场景:

  • 支付流程:下单→支付→回调→发货→退款→提现(每个箭头都是攻击点)
  • 认证流程:注册→登录→找回密码→绑定→解绑(每个步骤的凭证传递)
  • 权限模型:角色→权限→资源(每个绑定关系是否可篡改)
  • 审批流程:提交→审核→通过/驳回(能否跳过/重放/篡改状态)

二、支付/资金类场景表(全景)

场景 漏洞类型 挖掘要点
商品下单 金额篡改/数量篡改 价格参数可控、负数/0元/小数精度
优惠券/积分/红包 无限领取/超额使用/叠加 并发领取、ID遍历、多券叠加
支付回调 签名绕过/金额不一致 回调验签缺失、金额未二次校验
退款流程 重复退款/超额退款 并发退款、退款金额可控
提现/转账 越权提现/金额篡改 提现账户可控、余额校验绕过
会员/订阅 越权开通/无限试用 会员等级可控、试用次数绕过
虚拟货币/积分 积分盗刷/负数充值 并发兑换、金额类型混淆
分销/返佣 自推自/刷单 邀请关系可控、返佣逻辑缺陷

三、业务逻辑漏洞攻击套路

支付类:
  - 金额参数篡改(0.01、负数、小数精度)
  - 优惠券/积分/余额叠加
  - 订单状态跳变(未支付→已支付)
  - 并发重放(多次到账)
  - 退款不扣库存

权益类:
  - 无限领取/次数限制绕过
  - 试用→正式状态跳过
  - 会员等级参数可控

流程类:
  - 跳步(绕过前置节点)
  - 重放(同一步骤多次执行)
  - 状态回退/覆盖

四、并发与竞态专项

常见竞态场景

  • 库存扣减:并发下单是否超卖
  • 优惠券领取:并发领取是否多发
  • 提现/转账:并发操作余额是否被重复扣
  • 兑换:积分并发兑换是否重复到账
  • 退款:并发退款是否超额

测试方法

  • 同一请求并发发送(xargs -P / Burp Turbo Intruder / 脚本线程池)
  • 在关键操作(支付回调、发货、领券)同时重放请求
  • 观察数据库/业务结果的最终一致性

修复方向

  • 幂等键:请求唯一标识,重复请求直接返回
  • 数据库约束:唯一索引、余额非负约束、乐观锁
  • 分布式锁 / 事务隔离
  • 服务端二次校验:回调金额与订单金额比对,状态校验原子化

五、验证要点

  • 每个状态转换测试:正常路径、跳过、回退、重放、并发
  • 数据一致性校验位置:前端传参 vs 服务端计算
  • 金额/数量:负数、0、小数精度、类型替换(字符串/数组)
  • 支付回调:验签缺失、金额未二次校验、notify_url 可控
  • 并发结果必须有证据:多次成功响应/数据库记录差异

六、修复建议

  • 金额/价格以服务端为准,禁止信任前端传参
  • 状态转换服务端校验合法性(状态机表驱动)
  • 幂等、唯一约束、分布式锁
  • 回调验签 + 金额二次校验 + 回调防重放
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 102 lines · 94 tokens per session scan A 81c6781d64c7

Subscribe to this mod's changes

business-logic-race is a skill published in the GitHub repository zhaji2333/CkSKILLS (81 stars, last pushed 12d ago), licensed MIT. It adds 94 tokens to every session and 1,331 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.