Force exercise lacks caller-side bounds for exercise fee
The force exercise function calculates a fee from current and time-weighted ticks and settles it without letting the caller set a maximum they are willing to pay. A caller could therefore pay more than expected when the fee changes with price movement.
Submitted by Nyx
PanopticPool.sol L1598-L1664
Summary
The force exercise path (dispatchFrom() → _forceExercise()) computes an exerciseCost() and immediately settles it without any caller-provided bounds on the maximum amount the caller is willing to pay. Because the fee depends on currentTick, twapTick, and per-leg liquidity deltas, the final amount the caller pays may change.
Finding description
The force exercise mechanism computes a fee (exerciseFees) that the force exercisor may pay to the position owner, and then redistributes/settles deltas via getRefundAmounts() and refund(). In _forceExercise(), the caller has no way to enforce a maximum fee or a maximum per-token outflow:
function _forceExercise(
address account,
TokenId tokenId,
int24 twapTick,
int24 currentTick
) internal {
// ...
exerciseFees = riskEngine().exerciseCost(
currentTick,
twapTick,
tokenId,
positionBalance
);
// ...
LeftRightSigned refundAmounts = riskEngine().getRefundAmounts(
account,
exerciseFees,
twapTick,
ct0,
ct1
);
ct0.refund(account, msg.sender, refundAmounts.rightSlot());
ct1.refund(account, msg.sender, refundAmounts.leftSlot());
// ...
}
The fee can change to both (a) whether any long leg is in-range at currentTick, and (b) the delta between the token amounts corresponding to a long leg’s liquidity at currentTick versus oracleTick (here twapTick):
The force exercise fee is expected to vary with how far the position is from the money, which implies natural fee volatility with price movements 1. Without a max-fee / min-receive bound, callers cannot protect themselves from changes.
A caller initiating a force exercise may end up paying more than anticipated. This can make position management more complex/unexpected for users who want to force exercise another position.
Recommended mitigation steps
Consider adding explicit caller-side bounds for force exercise payments.
Proof of Concept
In PanopticPool.t.sol, import a PositionBalanceLibrary:
"import {PositionBalance, PositionBalanceLibrary} from "@types/PositionBalance.sol";"
View detailed Proof of Concept
Panoptic marked as informative.
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 force exercise entry point settles the computed fee without accepting a caller-supplied maximum fee or minimum receive amount.
Impact
A caller could pay more than anticipated for a force exercise, making position management less predictable; the project marked the issue as informative.
What the attacker needed
Caller initiates a force exercise; fee varies with tick and liquidity
The fix
Caller-side bounds on the maximum fee or per-token outflow should be added to the force exercise path.
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.
A smart contract lets one user force-close another user's trading position and pay a fee for it. The fee is worked out at the moment of the transaction and can shift with market prices, but the person triggering it cannot say 'do not charge me more than this'. So they might be charged more than they planned.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.