Business Logic Race logo

Business Logic Race

Community
zhaji2333
business-logic-race

当目标存在支付/下单/退款/提现/转账/优惠券/积分/红包/会员/订阅/审批/库存/抽奖等业务功能,或发现状态可跳变、金额参数可控、并发可重放时调用。负责业务状态机建模、金额篡改、订单状态跳变、竞态条件与重放攻击深度挖掘。

Overview

Publisherzhaji2333
RepositoryCkSKILLS
Skill namebusiness-logic-race
Stars
123
Forks
16
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by zhaji2333 on GitHub. Read the source before you install it.

Installation

Install the Business Logic Race AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zhaji2333/CkSKILLS/tree/main/.agents/skills/business-logic-race
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zhaji2333/CkSKILLS.git /tmp/CkSKILLS
mkdir -p .claude/skills
cp -r /tmp/CkSKILLS/.agents/skills/business-logic-race .claude/skills/business-logic-race
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Business Logic Race in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Business Logic Race on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Business Logic Race is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

何时调用(触发条件)

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

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

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

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

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

重点建模场景:

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

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

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

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

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

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

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

四、并发与竞态专项

常见竞态场景

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

测试方法

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

修复方向

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

五、验证要点

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

六、修复建议

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

Frequently asked questions

What does the Business Logic Race AI skill do?

当目标存在支付/下单/退款/提现/转账/优惠券/积分/红包/会员/订阅/审批/库存/抽奖等业务功能,或发现状态可跳变、金额参数可控、并发可重放时调用。负责业务状态机建模、金额篡改、订单状态跳变、竞态条件与重放攻击深度挖掘。

Why use Business Logic Race on TypingMind?

Because you install it once and use it with any model. Business Logic Race is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Business Logic Race in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhaji2333/CkSKILLS/tree/main/.agents/skills/business-logic-race. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Business Logic Race?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Business Logic Race?

As many as you like. As long as a model supports skills, you can use Business Logic Race with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Business Logic Race AI skill free?

Yes. It is published on GitHub by zhaji2333 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇