Closed sherlock-admin closed 1 year ago
Essentially repeating our comment back to us. While the behavior in question might be annoying or unexpected, it is not a bug -- just something to document. There's no real reason for couriers to credit each other anyway.
2 comment(s) were left on this issue during the judging contest.
panprog commented:
invalid, because this is obviously intended behavior as the comments and docs indicate
MohammedRizwan commented:
valid
feelereth
high
Principle accounting is skipped for couriers. This means couriers could manipulate their principle to reduce fees paid to the next courier.
Summary
Principle accounting is skipped for couriers. This means couriers could manipulate their principle to reduce fees paid to the next courier.
Vulnerability Detail
The code does have a vulnerability where couriers can manipulate their principle to reduce fees paid to the next courier. The relevant code section is in the _burn() function:
This means that when a courier receives a fee, their principle is not updated. So the full amount of the fee is considered "profit" that is subject to the next courier's fee. Normally, the principle tracks the total assets deposited by a user. This allows calculating the fees correctly - only profit above the principle should be charged. But by skipping the principle update for couriers, a courier can artificially increase their "profit" and reduce fees paid to the next courier. For example:
Impact
The major impact of not tracking principle properly for couriers is that it enables fee manipulation between couriers. Specifically:
Couriers can artificially inflate their principle to reduce fees paid to the next courier in the referral chain. This allows them to unfairly benefit at the expense of other couriers. Over time, this could significantly reduce the fees collected by downstream couriers. It incentives gaming the system rather than bringing in new business. If left unchecked, it could undermine the entire courier referral mechanism. Overall, I would categorize this as a high severity issue. It enables unfair manipulation between couriers and undermines a core mechanism of the protocol. It should be addressed to maintain fairness and incentive alignment.
Code Snippet
https://github.com/sherlock-audit/2023-10-aloe/blob/main/aloe-ii/core/src/Lender.sol#L514-L516
Tool used
Manual Review
Recommendation
Principles need to be tracked properly for couriers. I suggest this example:
This ensures each courier's fees are calculated correctly based on the profit above their principle.