Anyone can lock a triggered TP/SL position: a permissionless retry keeps the protection out of Latched, the only state in which the owner can amend its limits
A permissionless retry function lets any address re-trigger a failed take-profit or stop-loss close, keeping the protection out of the Latched state in which the owner is allowed to amend its close limits. An attacker can therefore freeze the position and its margin indefinitely, and the owner cannot cancel, close or amend while the attack continues.
Originally disclosed on Immunefi
- Disclosed after under an hour
#99485 [SC-High] Anyone can lock a triggered TP/SL position: a permissionless retry keeps the protection out of Latched, the only state in which the owner can amend its limits
Submitted on Nov 13th 2026 at 21:04:24 UTC by @RowanDamisch for Audit Competition | Plether
- Report ID: #99485
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/immunefi-team/audit-comp-plether/tree/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src
- Impacts:
- Temporary freezing of funds for at least 24 hours
Description
Brief/Intro
retryPositionProtectionClose is permissionless, while the owner of a triggered TP/SL can change its close limits only while the protection is Latched. When a protection close fails on the trader's own limits, for example a stop-loss that the market jumps past, anyone can retry it right after every failure and keep the protection Triggered. The owner's amendment then always reverts, and cancelling the protection or closing the position in any other way is blocked while the protection is active. The position and its margin stay frozen for as long as the attacker continues and the price stays beyond the trader's limits. In the PoC a stop-loss is locked for 24 hours while the loss grows from 300 to 540 USDG, and a stop-loss that gaps on a Friday stays locked until the Sunday reopen, 51 hours, because the frozen weekend price cannot come back within the limits. Each retry costs about $0.03 and locks a position of any size. This is the unfinished part of the MED-9 fix: the trader's limits are retained, but the owner's way to change them cannot be reached. We suggest letting the owner amend while Triggered; with a one-function patch the owner exits during the attack.
Vulnerability Details
When a triggered protection close fails, the protection relatches (Latched). The owner's only way out of a latched
protection is amendLatchedPositionProtectionCloseLimits, which works only while the protection is Latched. Every
ordinary exit is blocked while the protection is active: the owner cannot cancel it, cannot use cancel-and-close, and
cannot commit an ordinary close.
retryPositionProtectionClose is permissionless. An attacker who retries right after every failed close moves the
protection Latched → Triggered before the owner's next transaction lands. The owner's amendment then reverts, and the
position with its margin stays locked for as long as the attacker continues. The only way out is a processing and an
amendment sequenced back to back, which the product's own trading accounts cannot send (see "Owner's options").
Example: a stop-loss through a gap (test_weekday_attack_stopLossLockedFor24h).
- A trader holds a 10,000 USDG LONG with a stop-loss at 1.02 and a 260 USDG loss cap: 200 USDG at the stop plus room for 0.5% slippage and fees.
- The market jumps past the stop: the first price after it is 1.03. The protection fires, but a close at 1.03 would debit 304.12 USDG, more than the trader's cap. The close fails and the protection waits for the trader.
- Without the attacker the trader now raises the cap and closes at the gap
(
test_weekday_control_ownerAmendsAndExits). - With the attacker, every failed close is retried at once. The trader's cap change reverts each time, and so do cancelling the protection and an ordinary close.
- As long as the price does not come back within the cap, the attacker keeps the position locked for as long as it wants. The PoC holds it for 24 hours while the price keeps moving against the position; the price loss grows from 300 to 540 USDG.
The same lock applies to a take-profit whose close fails on the trader's limits: the trader cannot take the profit or move the margin out.
The same lock over a weekend (test_weekend_attack_fridayStopLossLockedUntilReopen). The stop-loss above gaps
through its cap on a Friday, at 12:00 New York in the PoC, and the attacker holds it through the afternoon. At 17:00
New York the market closes and the oracle freezes: the price stays at its last value, beyond the cap, and cannot come
back before the Sunday reopen. Every frozen attempt fails as well; the 50 bps frozen spread makes the close even
dearer (355.6 USDG against the 260 USDG cap). An ordinary trader has no way out for the whole weekend: the PoC holds
the position for 51 hours, from Friday noon to the Sunday reopen. A trader running a script that executes the attempt
and amends back to back can still leave in the frozen market; an ordinary user trading through the product or a
wallet cannot.
The frozen market also breaks fee ceilings set for live conditions. A take-profit triggered at Friday's close with a
ceiling of 3× the live fee fails on every frozen attempt (48.6 USDG against 10.8 USDG) and is locked for the whole
47-hour frozen period (test_weekend_attack_lockedAllWeekend).
The attacker needs no position and no capital: one retryPositionProtectionClose (about 669k gas in the PoC) after
each failed close. At the Arbitrum One gas price of 0.02 gwei and ETH at $1,931 (both read on 2026-11-13), one retry
costs about $0.03.
The cost does not depend on the position. A retry that locks a 10,000,000 USDG position uses the same gas as one that
locks a 10,000 USDG position (669,194 and 669,196, test_depth_costIndependentOfPositionSize). Any triggered
protection whose stored limits the market does not meet can be locked, whatever its size.
Severity: High — Temporary freezing of funds for at least 24 hours.
Root cause
Scope: packages/perps/src at a82d4fefb02768e5b3bddcc97dee371eee24fea8.
- Retry is permissionless.
retryPositionProtectionClose(PositionProtectionBook.sol:382-406) checks only that the protection isLatched, the position matches and no order is pending. It commits a new attempt and setsTriggered. - The owner's only exit requires
Latched.amendLatchedPositionProtectionCloseLimits(PositionProtectionBook.sol:315-328) revertsOrderRouter__ProtectionNotLatchedin any other state and revertsOrderRouter__PendingOrdersExistwhile the attempt is pending. - No other exit while the protection is active.
cancelPositionProtection→_cancelaccepts onlyPendingOpenandArmed(PositionProtectionBook.sol:414-419);cancelPositionProtectionAndCommitCloserequiresArmed(PositionProtectionBook.sol:346);- ordinary commits revert
OrderRouter__ProtectionActive(OrderLiquidationBatchLogic.sol:314).
- A failed attempt relatches.
handleFailedProtectionAttemptsetsLatchedwhen the position still matches (PositionProtectionBook.sol:663-667), including on expiry. Attempts carry zero bounty, the router's execution window (60 s in the repository test configuration, at most 1 hour byOrderRouterAdmin.sol:31) and the stored limits (OrderLiquidationBatchLogic.sol:657-677). - Where the stored limits fail. A close's gross account debit includes the consumed price loss
(
CfdOrderPolicyEvaluatorBase.sol:410-411), so a fill through the stop exceeds a loss cap; its explicit fees include the frozen spread (CfdOrderPolicyEvaluatorBase.sol:416), so a live-calibrated fee ceiling fails while the oracle is frozen.
Each failed attempt (points 4 and 5) leaves the protection Latched only until the next transaction. Point 1 lets
any address use that transaction to put it back into Triggered. The owner's exit in point 2 is then never
reachable from a separate transaction, and point 3 leaves no other exit.
Attack
The attacker can pick targets in advance. Every protection's trigger prices and close limits are public
(getPositionProtection, closeFinancialLimits), so it can list the protections whose limits a gap or the frozen
spread would break before they trigger.
- A protection has triggered and its close attempt fails on the trader's own limits:
- a stop-loss through a gap, on any trading day or at the Sunday reopen; a lock started on a Friday carries through the frozen weekend;
- a protection crossed at Friday's close with a fee ceiling set for live conditions, triggered with the last live tick, so its attempt can only run in the frozen market.
- Whenever an attempt is processed (by the keeper at its first qualifying tick, by the owner, or by the attacker
itself), it fails and the protection relatches. The attacker sees this in the sequencer feed and calls
retryPositionProtectionClosewithin milliseconds. An owner's separately signed transaction arrives later, and Arbitrum sequences transactions first come, first served, so the retry lands first. - The protection is
Triggeredagain with a fresh attempt carrying the same failing limits. Step 2 repeats.
The attacker can also process the attempt itself and retry in the same transaction: a small contract calls
OrderRouter.executeOrder and then retryPositionProtectionClose. Whenever the attacker is the one to process the
attempt, the protection never ends a transaction Latched, so the owner has no window at all
(test_depth_executeAndRetryInOneTransaction).
Without a keeper the attacker can drive the loop itself: expire the stale attempt and retry in one transaction, once per execution window, with no oracle data.
Known issues and prior audits
- Cecuro AI MED-9 ("Keepers can retry protection closes without the trader's financial limits") was resolved by
copying the trader's limits into every retry and letting the owner amend them while
Latched; tight limits "may prevent execution until conditions improve or the owner amends them". Ona82d4fefthat amendment cannot be reached while any address keeps retrying, so the fix is incomplete: the trader's limits are retained, but the owner's way to change them is not reachable. SECURITY.md:1356-1359covers liveness when nobody retries a latched protection. It does not cover a third party retrying to keep the owner out ofLatched.- The docs give the owner the amendment as the remedy for a latched protection (
CANONICAL_ENTRYPOINTS.md:145) and tell protection workers not to "continuously queue the same failing attempt" (DEPLOYMENT.md:421). The contract does not enforce that guidance, and a third party doing exactly that keeps the remedy out of the owner's reach. - The Scan report's "Protection trigger bounty is paid before a zero-bounty close is executed" concerns when the trigger bounty is paid, not the owner's exit from a latched protection.
Impact Details
- What is frozen. The position's size, its pledged margin (1,986 USDG in the PoC) and its PnL: the owner cannot close, reduce, or move the margin out. Free settlement remains withdrawable; margin added later joins the locked position.
- How long. The protocol sets no upper bound. The lock lasts as long as the attacker continues and the stored
limits cannot be met. It ends only when the price comes back within the trader's limits (the next attempt then
closes the position,
test_boundary_priceBackWithinLimits) or when the position is liquidated. While the market is frozen the price cannot move, so a lock carried into a weekend lasts at least until the Sunday reopen. The PoC stops at 24 hours (weekday) and at the reopen (51 hours from Friday noon); continuing costs the same per retry. - Stop-loss. The trigger still fires, but the close it mandates is neutralised exactly when the market moves against the trader. If the price keeps moving, the position runs to liquidation instead of the stop, and the loss the stop-loss was set to cap is realised up to the whole margin.
- Weekend. The protocol keeps the frozen market open for closes ("frozen-market execution is intentionally
liveness-first for risk reduction",
SECURITY.md:437). For every protection the attacker holds into the weekend, it removes that close liveness until the market reopens. - Who can do it. Any address, with no position and no capital, against a position of any size.
- Owner's options. The owner leaves only if their amendment is sequenced right after a processing, with nothing in
between. The documented flow is the separate-transaction case: the remedy is the amendment
(
CANONICAL_ENTRYPOINTS.md:145), and execution is "a separate permissionless transaction" (DEPLOYMENT.md:438). (packages/perps-aa*are outside the audit scope; they are cited only for what a trader can send.)- Product smart accounts cannot process an attempt at all. The sponsored actions are trader actions only, with
no order execution and no retry (
packages/perps-aa-client/src/types.ts:3-16), and the sponsorship gateway must reject "keeper/admin methods" (packages/perps-aa/SECURITY.md:35-36). The owner's amendment is a sponsored UserOperation that reaches the chain seconds after the keeper's processing, after the attacker's retry. - Externally owned accounts that process the attempt and amend in separately signed transactions: the attacker's retry lands between them (both weekend attack tests). In a live market the owner cannot even process the fresh attempt in the same tick, because it becomes executable only from the next oracle tick (the weekday attack test).
- The exception. An advanced trader who submits processing and amendment back to back, from a script or as one
batch from a contract account, exits (
test_boundary_ownerProcessesAndAmendsBackToBack). In a frozen market any pending attempt can be processed at once. In a live market the trader must process the fresh attempt at its first tick, before the keeper that services the queue head at that tick. This takes custom tooling: an ordinary user trading through the product or a wallet sends these actions as separate transactions.
- Product smart accounts cannot process an attempt at all. The sponsored actions are trader actions only, with
no order execution and no retry (
Why High.
- Weekdays. In the stop-loss example the position and its margin stay locked for as long as the price stays beyond the trader's cap and the attacker keeps retrying; nothing in the protocol ends the lock earlier. The PoC holds it for 24 hours, the program's threshold for High.
- Weekend. A stop-loss locked on a Friday stays locked until the Sunday reopen: the frozen price cannot come back within the cap, so for an ordinary trader nothing ends the lock. The PoC holds it for 51 hours.
In both, the owner uses the documented exit (amend, then retry) in separate transactions. Owners on the product's sponsored smart accounts have no way out through the product. The attacker pays one retry, about $0.03, per failed close, and the same retry locks a position of any size: the frozen amount grows with the position, the cost does not. This is the program's "Temporary freezing of funds for at least 24 hours".
Suggested fix
Allow the owner to amend the close limits while the protection is Triggered as well as Latched. A trigger
requires the account to have no pending orders (PositionProtectionBook.sol:532) and ordinary commits are blocked
while the protection is active, so while Triggered the live attempt is the account's only pending order. The amended
limits apply from the next retry, so a third-party retry can no longer keep the owner out. We checked this with a
minimal patch (fix.patch, one function in PositionProtectionBook.sol):
git apply ../fix.patch
forge test --root packages/perps --match-path test/perps/spec/trader/ProtectionRetryLockFixCheck.t.sol --match-test "fix_|weekday_attack|weekend_attack" -vv
The fix-check suite inherits the PoC, so it runs the two fix tests and the three attack tests. Expected on the patched
code: test_fix_weekdayOwnerAmendsWhileTriggeredAndExits and test_fix_weekendOwnerAmendsWhileTriggeredAndExits
pass (the owner amends during the attack and the next attempt closes the position), and the three attack tests fail
with next call did not revert as expected, at the step that expects the owner's amendment to revert.
References
- permissionless retry: PositionProtectionBook.sol#L382-L406
- owner amendment only while
Latched, no pending order: PositionProtectionBook.sol#L315-L328 - cancel accepts only
PendingOpen/Armed: PositionProtectionBook.sol#L414-L419; cancel-and-close requiresArmed: PositionProtectionBook.sol#L346 - ordinary commits blocked while protection is active: OrderLiquidationBatchLogic.sol#L314
- failed attempt relatches: PositionProtectionBook.sol#L663-L667
- attempts carry the stored limits: OrderLiquidationBatchLogic.sol#L657-L677
- execution window at most 1 hour: OrderRouterAdmin.sol#L31
- gross account debit and explicit fees (frozen spread): CfdOrderPolicyEvaluatorBase.sol#L410-L416
- frozen window, Friday 17:00 to Sunday 16:59:59 New York: CfdEngine.sol#L888-L892
- trigger requires no pending orders: PositionProtectionBook.sol#L532
- owner's documented remedy, amendment while
Latched: CANONICAL_ENTRYPOINTS.md#L145-L147 - workers must not continuously queue the same failing attempt: DEPLOYMENT.md#L421; execution as a separate transaction: DEPLOYMENT.md#L438
- frozen-market execution is liveness-first: SECURITY.md#L437
- known limitation, nobody retries a latched protection: SECURITY.md#L1356-L1359
- sponsored trader actions, outside the audit scope: perps-aa-client/src/types.ts#L3-L16; gateway rejects keeper methods: perps-aa/SECURITY.md#L35-L36
- Cecuro AI audit, MED-9: plether-ai-audit-report-2026-10-26.pdf
Link to Proof of Concept
https://gist.github.com/w64267685-afk/954dcc8c97c4bf55e9fcf749cde417a0
Proof of Concept
Proof of Concept
One Foundry test file in the project's own test suite: ProtectionRetryLockPoC.t.sol extends the repository's PositionProtectionTest (its fixtures and frozen-calendar setup), runs without network and mocks only Pyth and USDG; no file under src/ is changed. The keeper is the fixture's EXECUTION_KEEPER; the attacker is an arbitrary address calling retryPositionProtectionClose. Each test iteration is one exchange of the ordering in "Attack", sampled once per hour.
fix.patch and ProtectionRetryLockFixCheck.t.sol are our check of the suggested fix (Suggested fix).
All three files are in the secret gist.
Setup
The test files and fix.patch are in the secret gist; ProtectionRetryLockPoC.t.sol is also inlined at the end. Download the gist files into an empty directory, open a shell in that directory and run:
git clone https://github.com/immunefi-team/audit-comp-plether && cd audit-comp-plether
git checkout a82d4fefb02768e5b3bddcc97dee371eee24fea8
git submodule update --init --recursive
cp ../ProtectionRetryLockPoC.t.sol ../ProtectionRetryLockFixCheck.t.sol packages/perps/test/perps/spec/trader/
The test imports ./PositionProtection.t.sol, so it goes next to it in spec/trader/. All commands below run from the repository root (audit-comp-plether).
Run
forge test --root packages/perps --match-path test/perps/spec/trader/ProtectionRetryLockPoC.t.sol --match-test "weekday_|weekend_|depth_|boundary_" -vv
Expected: 12 tests pass.
What each test shows
- Stop-loss through a gap (stop 1.02, loss cap 260 USDG, first tick 1.03):
test_weekday_control_ownerAmendsAndExits— without the attacker the fill fails on the cap, the owner amends and exits at the gap (304.12 USDG debited);test_weekday_attack_stopLossLockedFor24h— 24 hours. Each hour the stale attempt is cleaned up and the attacker retries; at the next tick the keeper executes the fresh attempt, it fails on the cap (ConstraintViolation(GrossAccountDebit), the debit growing with the price), and the attacker retries again. After each retry amend, cancel, cancel-and-close and an ordinary close revert, and the owner's own processing in the same tick finds no qualifying price. The price drifts to 1.054 and the price loss grows from 300 to 540 USDG; about 669k gas per retry.test_weekend_attack_fridayStopLossLockedUntilReopen— the same stop-loss gapping on Friday at 12:00 New York: 4 live hours, then all 47 frozen hours, 51 hours in total. Live attempts fail on the cap (304.12 USDG), frozen ones as well (355.6 USDG with the frozen spread). In the frozen market the keeper's and the owner's own executions both fail, and the attacker's retry lands before the owner's amendment.
- Fee ceiling in the frozen market (take-profit with a ceiling of 3× the live fee):
test_weekend_control_liveCloseFitsCeiling— triggered earlier in the live session, the same ceiling closes the position on the next live tick;test_weekend_control_ownerExitsWithoutAttacker— triggered with the last live tick (10 s before the freeze), the first frozen execution fails on the spread; the owner raises the ceiling and exits during the weekend;test_weekend_attack_lockedAllWeekend— same trigger, all 47 frozen hours. The first frozen execution and every later one, by the keeper or by the owner, fails on the spread (ConstraintViolation(ExplicitFees), 48.6 USDG against the 10.8 USDG ceiling), and the attacker's retry lands before the owner's amendment.
- Depth:
test_depth_whatIsFrozen— pledged margin locked, free settlement withdrawable, added margin joins the lock;test_depth_expiryOnlyMode— no keeper, no oracle data: one expire-and-retry per 60 s window;test_depth_executeAndRetryInOneTransaction— the attacker executes each attempt itself (it fails on the cap) and retries in the same transaction; after each transaction the owner's amend, cancel and close revert;test_depth_costIndependentOfPositionSize— a 10,000,000 USDG stop-loss position is locked by a retry of the same gas as a 10,000 USDG one (669,194 and 669,196).
- Boundaries:
test_boundary_priceBackWithinLimits(a fill within the stored cap closes the position) andtest_boundary_ownerProcessesAndAmendsBackToBack(an owner whose amendment directly follows the processing exits).
Fix check
git apply ../fix.patch
forge test --root packages/perps --match-path test/perps/spec/trader/ProtectionRetryLockFixCheck.t.sol --match-test "fix_|weekday_attack|weekend_attack" -vv
The fix-check suite inherits the PoC, so it runs the two fix tests and the three attack tests. Expected on the patched
code: test_fix_weekdayOwnerAmendsWhileTriggeredAndExits and test_fix_weekendOwnerAmendsWhileTriggeredAndExits
pass (the owner amends during the attack and the next attempt closes the position), and the three attack tests fail
with next call did not revert as expected, at the step that expects the owner's amendment to revert.
Test code: ProtectionRetryLockPoC.t.sol
ProtectionRetryLockFixCheck.t.sol and fix.patch are in the gist.
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.35;
import {PositionProtectionTest} from "./PositionProtection.t.sol";
import {CfdTypes} from "@plether/perps/CfdTypes.sol";
import {OrderV3Types} from "@plether/perps/OrderV3Types.sol";
import {IOrderRouterErrors} from "@plether/perps/interfaces/IOrderRouterErrors.sol";
import {IPositionProtectionActions} from "@plether/perps/interfaces/IPositionProtectionActions.sol";
import {PositionProtectionTypes} from "@plether/perps/interfaces/PositionProtectionTypes.sol";
import {console2} from "forge-std/console2.sol";
interface IExecRouter {
function executeOrder(uint64 orderId, bytes[] calldata data)
external
payable
returns (OrderV3Types.ExecutionResult memory);
}
/// Any address: execute the trader's failing attempt and retry it in the same transaction.
contract ExecuteAndRetry {
function cycle(address router, address book, uint64 orderId, uint64 protectionId, bytes[] calldata data)
external
returns (uint64 nextOrderId)
{
IExecRouter(router).executeOrder(orderId, data);
nextOrderId = IPositionProtectionActions(book).retryPositionProtectionClose(protectionId);
}
}
/// Any address: expire the stale attempt and retry in one transaction (no oracle data, no execution).
contract ExpiryGriefer {
function expireAndRetry(address router, address book, uint64 orderId, uint64 protectionId)
external
returns (uint64 nextOrderId)
{
IExecRouter(router).executeOrder(orderId, new bytes[](0));
nextOrderId = IPositionProtectionActions(book).retryPositionProtectionClose(protectionId);
}
}
/// A triggered protection whose close attempt fails relatches (`Latched`). The owner's only exit is amending the
/// close limits, which requires `Latched`. `retryPositionProtectionClose` is permissionless and moves the protection
/// back to `Triggered`. An attacker who retries right after every processed attempt keeps the protection out of
/// `Latched` at every point the owner's own transaction can land, so amend, cancel, cancel-and-close and an ordinary
/// close all revert, and the position with its margin stays locked.
///
/// Ordering model. On Arbitrum transactions are sequenced first come, first served. The keeper services the queue
/// head at the first qualifying oracle tick (live) or at once (frozen). The attacker watches the sequencer feed and
/// lands its retry right after each processing, before a separately signed owner transaction. Each test iteration is
/// one such exchange; the tests sample one per hour.
contract ProtectionRetryLockPoC is PositionProtectionTest {
address internal constant ATTACKER = address(0xBAD);
// Weekday stop-loss on a LONG (loses as the price rises). Notional 10,000 USDG, margin 2,000 USDG (5x).
uint256 internal constant SL_PRICE = 102_000_000; // stop at 1.02: a 200 USDG loss
uint256 internal constant GAP_PRICE = 103_000_000; // first tick after the stop: a 1% gap through it
uint256 internal constant LOSS_CAP = 260e6; // max gross debit: 200 at the stop + 0.5% slippage + fees
uint256 internal constant DRIFT_PER_HOUR = 100_000; // the price keeps moving against the position, +0.001/h
// ---------------- helpers ----------------
function _wideLimits() internal pure returns (PositionProtectionTypes.CloseFinancialLimits memory l) {
l.maxExecutionNotionalAssets = 25_000e6;
l.maxGrossAccountDebitAssets = 25_000e6;
l.maxActionChargeAssets = 25_000e6;
l.maxExplicitFeesAssets = 25_000e6;
}
function _status(uint64 protectionId) internal view returns (PositionProtectionTypes.PositionProtectionStatus) {
return protectionViews.getPositionProtection(protectionId).status;
}
function _size(address a) internal view returns (uint256 s) {
(s,,,,,,) = engine.positions(a);
}
function _lossAt(uint256 price) internal pure returns (uint256) {
return (POSITION_SIZE * (price - MARK_PRICE)) / 1e20;
}
function _nextBlock(ui
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
The retry function is permissionless while the owner's amendment is only allowed in the Latched state, so a third party can keep the protection out of that state.
Impact
The position, its margin and its PnL can be frozen for at least 24 hours and potentially through a whole weekend, with the stop-loss neutralised so losses can run to liquidation; an advanced trader using back-to-back processing and amendment can still exit.
What the attacker needed
No position or capital needed; price stays beyond trader's limits; attacker retries after each failed close
The fix
The owner should be allowed to amend the close limits while the protection is Triggered as well as Latched, so a third-party retry can no longer keep the owner out.
How it was found
- A trader sets a stop-loss whose close fails because the market gaps past the trader's loss cap.
- The failed attempt relatches the protection, and the attacker calls the permissionless retry to set it back to Triggered.
- The owner's amendment, cancel, cancel-and-close and ordinary close all revert.
- The attacker repeats the retry after every failed close for as long as the price stays beyond the limits.
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 trader can attach an automatic stop-loss or take-profit to a position. When that automatic close fails because the market moved past the trader's own limits, the protection waits in a state called Latched, and the trader is allowed to change the limits only in that state. Because anyone may call the retry function, an attacker can keep pushing the protection back into the Triggered state, so the trader's fix always fails and the position stays stuck.
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.