Financial theft
| Class | Availability and abuse |
|---|---|
| MITRE ATT&CK | T1657 Financial Theft |
| Typical severity | High to Critical |
| Affects | Refund, payout, wallet and gift card features; payment provider keys; accounts that control bank details, such as seller, payroll and HR accounts |
An application that holds money has features built to move it: a refund button, a payout to a seller's bank account, a wallet balance, a salary deposit set up in an HR system. Financial theft is the taking of a victim's money through extortion, deception or technical means, and it is the end goal of several kinds of attack, among them ransomware extortion, business email compromise and attacks on banks.1 When an application's own features are used, the requests involved are ones it accepts as valid. They come from an account or with a key the attacker should not hold, or in an order and at a speed the code did not plan for.
Ways money leaves
A stolen account
An attacker who signs in as an employee, a seller or a customer can replace the bank account on file, and later payments go to the new account.2 Accounts taken over in this way are also used to make transfers directly, and the theft can leave two victims: the person whose account was used and the party that loses the money.1
A stolen payment key
A payment provider's secret API key acts with the authority of the merchant account. Whoever holds a leaked Stripe secret key can make charges, read customer data and break the integration.3 A restricted key carries only the permissions one component needs, so a key stolen from a service that only monitors disputes can read disputes and nothing more. Keys can also be tied to fixed IP addresses, after which Stripe blocks requests made with them from anywhere else, and the API request log shows where a key is being misused.3
Refunds are a narrow route at the provider. Stripe sends a refund only to the payment method that was charged, never to a different card or bank account, and the refunds on one charge cannot add up to more than the charge.4 Credit an application keeps in its own database, such as a wallet balance, store credit or gift card value, has only the limits its own code enforces.
Logic that runs twice
Take a gift card handler that reads whether the card is unused, adds its value to the balance, then marks it used. Two requests that arrive within the same fraction of a second can both pass the first step before either reaches the last, and the value is credited twice. This race condition, one of the Business logic flaws, also lets a user withdraw or transfer more than their balance.5 Where one request both validates the payment and confirms the order, items can be added to the basket after the payment check and still be confirmed in the order.5
A request for payment
Some theft needs no access to the application at all. In business email compromise the attacker poses as a trusted party and persuades the victim to send money to an account the attacker controls. Ransomware groups encrypt a victim's data, copy it out, and demand payment to keep the copy unpublished.1 A demand for money can also be a cover story, drawing attention away from the real aim of destroying data or disrupting the business.1
Payroll pirates, 2025
Microsoft tracked a group it calls Storm-2657 that took over staff accounts at US universities to redirect salaries. Its Phishing emails warned of illness outbreaks on campus or announced pay and benefits updates, and led to adversary-in-the-middle pages that captured passwords and two-factor codes; some of the accounts had no second factor at all. In the mailboxes it took over, the attacker created inbox rules that deleted notification emails from Workday, some named with nothing but punctuation such as "….". The attacker then added a phone number of their own as a two-factor device, opened Workday through single sign-on and changed the employee's bank details, so that future salary payments went to the attacker.2
From March 2025 to the report, Microsoft counted 11 accounts taken over at three universities, which were then used to send phishing to nearly 6,000 email accounts at 25 universities. Microsoft stated that Workday had no vulnerability and that any service storing pay and bank details could be attacked the same way.2
Controls
One operation for each change of value
A balance change or a single-use redemption is safe from the race above when the check and the write happen in one database operation, using the database's own concurrency features, with a uniqueness constraint as a second guard. Data kept in the session cannot stop two requests from overrunning a limit stored in the database.5
-- Postgres: the balance check and the deduction are one statement
UPDATE wallets
SET balance = balance - $1
WHERE user_id = $2 AND balance >= $1
RETURNING balance;
-- no row returned: the balance was too low, refuse the withdrawal
-- a code can be redeemed once per user; a second insert fails
ALTER TABLE redemptions
ADD CONSTRAINT redemptions_once UNIQUE (code_id, user_id);A call that moves money at the provider, such as a refund, can carry an idempotency key in the Idempotency-Key header, for example a random version 4 UUID created once per refund. When the same key arrives again, Stripe returns the saved result of the first request instead of performing the operation a second time.6
Bank details and payment approval
Fewer people hold the authority to make sensitive transactions, and a payment request that arrives by email is confirmed through another channel before it is paid.1 In the payroll attacks, deleted emails with "Payment Elections" or "Direct Deposit" in the subject were one trace of a changed bank account, next to the Workday audit events "Change My Account" and "Manage Payment Elections". The fixes were to reset the password and end active sessions, review recently added two-factor devices, remove the rules, reverse the payroll change, and move users to phishing-resistant sign-in such as security keys and Passkeys and WebAuthn.2
Prompt for a coding agent
Find every place in this project where money or credit changes hands: refunds, payouts, withdrawals, transfers, wallet or credit balances, gift cards, coupons, and changes to a user's bank or payout details. For each balance change or single-use redemption, make the check and the write one atomic database operation (a conditional UPDATE or a transaction with row locking) and add a unique constraint where something may be used once. Add an Idempotency-Key to every payment provider call that creates a refund or payout. Send a notice to the account email whenever bank or payout details change. List each file you changed and any flow you were unsure about.
In SecFlash
SecFlash reports a payment webhook route that never checks the provider's signature as SF-SEC-726, since a forged "paid" event can grant a plan, credits or a paid order. Code that copies every field of a request into a database record, which lets a visitor set a field such as a balance, is reported as SF-SEC-740. Both show on the Security page.
See also
- Business logic flaws
- Card testing
- Securing Stripe payments
- Webhook signature verification
- Mass assignment
- Responding to an administrator account takeover
- Category: Availability and abuse
References
- a b c d e MITRE (November 2026). "Financial Theft, Technique T1657", version 1.2. MITRE ATT&CK.
- a b c d Microsoft Threat Intelligence (9 October 2025). "Investigating targeted 'payroll pirate' attacks affecting US universities". Microsoft Security Blog.
- a b Stripe (n.d.). "Best practices for managing secret API keys". Stripe Docs.
- back Stripe (n.d.). "Refund and cancel payments". Stripe Docs.
- a b c PortSwigger. "Race conditions". Web Security Academy.
- back Stripe (n.d.). "Idempotent requests". Stripe API reference.