At a glance
- Controls
- CWE-770
What it is
Many products pass user requests to a paid model and pay per token. If the endpoint has no budget or rate limit, every request costs money with no ceiling. Long prompts and large outputs raise the cost of each call.
An attacker scripts a stream of expensive requests from one or many free accounts. AI-assisted attackers can also reuse such an endpoint as a free model for their own work, which drives usage further.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- Chat, summarise and generate endpoints
- Agent features that call a model in a loop
- Background jobs that run model calls on uploaded files
- Free tier and trial accounts with access to model features
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01Sign in with the test account and call the model feature at a small, agreed rate.
- 02Raise the rate and the input size step by step within the agreed limit, watching for throttling.
- 03Read the code path to confirm whether a per-user and per-account budget is checked before each call.
Every call to a paid model must count against a per-user and per-account budget.
Executable checkas test user: send N model requests above the per-user budget expect: 429 or a clear budget-exceeded error expect: usage counter for the user and account increments on each call expect: oversize input returns 413 or 422
Every rule MATT holds →What the fix looks like
- 01
Meter tokens or calls per user and per account, and check the budget before calling the model.
- 02
Cap input size, output length and loop depth for agent features.
- 03
Set hard spending limits and alerts with the model provider.
- 04
Give free and trial accounts lower limits than paid ones.
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →