Logo de Auditing Payment State Machine And Idempotency

Auditing Payment State Machine And Idempotency

Organização
UnboundCompute
auditing-payment-state-machine-and-idempotency

Audit payment and checkout state machines for transitions an attacker can drive out of order or replay for value: an order marked paid before the charge is confirmed, a step that can be skipped or repeated so goods ship without settlement, a non-idempotent charge or fulfillment endpoint that double-processes on a retried or replayed request, and a refund or cancel that returns value while the underlying charge stays captured. Covers checkout, charge, fulfillment, and refund flows where money and goods change hands across a sequence of state transitions. Use when a purchase moves through ordered payment states and the transitions and their idempotency are the boundary. The out-of-order or replayed transition is the source, the value released without settlement is the sink, and the skippable step or non-idempotent handler that allows it is the bug.

Visão geral

Publicado porUnboundCompute
Repositóriosecurity-agent-skills
Nome da habilidadeauditing-payment-state-machine-and-idempotency
Estrelas
27
Forks
8
Arquivos incluídos
Somente instruções
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por UnboundCompute no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Auditing Payment State Machine And Idempotency no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-payment-state-machine-and-idempotency
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-payment-state-machine-and-idempotency .claude/skills/auditing-payment-state-machine-and-idempotency
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Auditing Payment State Machine And Idempotency em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Auditing Payment State Machine And Idempotency automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Auditing Payment State Machine And Idempotency não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Auditing payment state machine and idempotency: value must not move faster than settlement

A checkout is a state machine, and money moves through it in a strict order: an order is placed, a charge is authorized, the charge settles, and only then are goods fulfilled; refunds and cancels run the sequence backward. The bugs are transitions that break the order or repeat for value. An order marked paid before the charge is actually confirmed lets fulfillment run against a payment that never settles. A step that can be skipped, so fulfillment triggers without a completed charge, or repeated, so one payment yields multiple fulfillments, releases value the sequence did not authorize. A charge or fulfillment endpoint that is not idempotent double-processes when a request is retried or deliberately replayed, so a network retry or an attacker's repeat becomes two charges or two shipments. And a refund or cancel that returns value while the charge stays captured pays out twice. The audit walks the state machine and tries to move value ahead of, or more than once per, settlement. You audit this by driving transitions out of order and replaying the ones that release value.

When to use

  • A purchase moves through ordered payment states (placed, authorized, settled, fulfilled, refunded).
  • Fulfillment may trigger before a charge is confirmed, or a paid state may be set ahead of settlement.
  • Charge, fulfillment, or refund endpoints may not be idempotent under retry or replay.

Scope check

Test payment flows only against systems you own or are authorized to assess, on non-production or sandbox payment paths. Driving transitions and replays moves real value on a live system, so use sandbox payment credentials and test accounts and never trigger a real charge, refund, or fulfillment that is not yours. If you can't name the authorization, stop.

The loop

  1. Establish the intended state machine first. Map the legal states and the only transitions allowed between them, and which transition each value-releasing action (fulfillment, refund, payout) requires as its precondition. This is the false-positive killer: a flow where fulfillment requires a confirmed settled charge, every transition validates its precondition server-side, and every value-releasing handler is idempotent is correct. Name the intended sequence, then test deviations.

  2. Check the paid-state precondition. Confirm the state that gates fulfillment is set only after the charge is confirmed settled by the payment provider, not on client assertion or on authorization alone. An order marked paid before settlement, or on a client-supplied status, lets goods ship against a payment that may never complete.

  3. Test step skipping and out-of-order transitions. Attempt to reach a value-releasing state without the transitions that should precede it: trigger fulfillment without a completed charge, jump past a verification step, or set a later state directly. Confirm each transition validates its precondition on the server and refuses an out-of-order jump. A state reachable without its prerequisites is a skip.

  4. Test replay and idempotency of value-releasing handlers. Replay the charge, fulfillment, and payout requests, and retry them with and without any idempotency key. Confirm each is idempotent: a repeated request for the same logical operation processes once, not once per delivery. A non-idempotent handler turns a retry or a deliberate replay into a double charge or double fulfillment.

  5. Check refund and cancel symmetry. Confirm a refund or cancel only returns value that was actually captured, moves the state consistently, and cannot be repeated to pay out more than once or run while the charge remains captured. A refund that credits without reversing the charge, or that replays, is a payout primitive.

  6. Confirm and record. Confirm by releasing value without settlement, a fulfillment on an unconfirmed charge, a skipped step reaching a paid state, a replayed handler double-processing, or a repeated refund, all on sandbox payment paths and without moving real money. Kill the lead if every value-releasing action requires its settled precondition validated server-side and every such handler is idempotent under retry and replay. Record the out-of-order or replayed transition, the value-released sink, and the skippable step or non-idempotent handler.

Where payment state trust leaks

  • Paid set before settlement. Marking an order paid on authorization alone or on client-supplied status ships goods against a charge that may never settle.
  • A skippable step reaches fulfillment. A value-releasing state reachable without its preceding transitions lets fulfillment run without a completed charge.
  • A non-idempotent handler double-processes. A charge, fulfillment, or payout endpoint that acts once per request rather than once per operation doubles on retry or replay.
  • A repeatable refund pays out twice. A refund or cancel that can be replayed, or that credits without reversing the capture, returns more value than was taken.
  • Client-driven state transitions. Trusting a client to assert the next state, rather than deriving it from server-confirmed events, lets an attacker set the state that releases value.

Worked example (a confirm and a kill)

Confirm. A checkout marks the order paid and triggers fulfillment when the browser posts back a success status after redirect from the payment page, before the server confirms settlement with the provider. Posting the success callback directly, without any real payment, drives the order to paid and ships the goods. Separately, replaying the fulfillment request produces a second shipment for one order. Confirmed payment state bypass via client-asserted paid state and non-idempotent fulfillment, critical, remediation = set the paid state only from a server-side confirmation of settlement with the provider, require the settled precondition before fulfillment, and make fulfillment idempotent per order.

Kill. The paid state is set only after the server confirms settlement with the payment provider out of band; fulfillment, charge, and payout each validate their settled precondition server-side and refuse an out-of-order jump; every value-releasing handler is idempotent per logical operation under retry and replay; and refunds return only captured value and cannot repeat. A skipped step or replayed request releases nothing extra. Killed, kill_reason = "value-releasing transitions gated on server-confirmed settlement and idempotent under replay; no out-of-order or repeated transition releases value."

Rationalizations to reject

  • "The payment page redirected back with success." → A client-delivered success is spoofable; confirm settlement server-side with the provider before setting paid.
  • "The charge was authorized." → Authorization is not settlement; gate fulfillment on the confirmed settled state, not on a hold that can be released.
  • "Retries are just network noise." → A non-idempotent handler turns any retry, benign or malicious, into a double charge or double shipment; make it idempotent per operation.
  • "Refunds go through our finance team." → If the refund endpoint can be replayed or credits without reversing the capture, it is a payout primitive regardless of who normally calls it.
  • "The client tracks the order state." → Client-asserted state lets an attacker set the value-releasing state; derive every transition from server-confirmed events.

Executing this in practice

You need the legal states and transitions, which server-confirmed event gates each value-releasing action, and whether each such handler is idempotent. On sandbox payment paths, try to mark paid without settlement, skip to fulfillment, replay the charge and fulfillment and refund handlers, and repeat a refund. Reading the state- transition code shows the intended order; a value release without settlement or a doubled handler shows whether it holds.

Related

  • auditing-payment-callback-and-amount-integrity - the provider callback that should set the paid state; its authenticity and amount checks are the trusted signal this state machine must wait for.
  • hunting-price-and-coupon-manipulation - manipulating the amount before this state machine runs is the paired attack; together they cover paying less and paying nothing.
  • auditing-webhook-authenticity-and-callback-trust - settlement usually arrives as a webhook; that skill verifies the event this flow depends on is genuine.
  • hunting-broken-object-level-authorization - driving another user's order through these transitions is an object-authorization failure on the order; the two meet at the order identifier.
  • FINDING-SCHEMA.md - source = the out-of-order or replayed transition, sink = the value released without settlement, evidence = the skippable step or non-idempotent handler.

Perguntas frequentes

O que a habilidade de IA Auditing Payment State Machine And Idempotency faz?

Audit payment and checkout state machines for transitions an attacker can drive out of order or replay for value: an order marked paid before the charge is confirmed, a step that can be skipped or repeated so goods ship without settlement, a non-idempotent charge or fulfillment endpoint that double-processes on a retried or replayed request, and a refund or cancel that returns value while the underlying charge stays captured. Covers checkout, charge, fulfillment, and refund flows where money and goods change hands across a sequence of state transitions. Use when a purchase moves through ord...

Por que usar Auditing Payment State Machine And Idempotency no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Auditing Payment State Machine And Idempotency é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Auditing Payment State Machine And Idempotency no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-payment-state-machine-and-idempotency. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Auditing Payment State Machine And Idempotency?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Auditing Payment State Machine And Idempotency?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Auditing Payment State Machine And Idempotency com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Auditing Payment State Machine And Idempotency é gratuita?

Sim. A habilidade é publicada no GitHub por UnboundCompute sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇