You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
Misuse of Old Borrowing key instead of New Key in takeOverDebt Function
Summary
The function takeOverDebt seems to mistakenly use the borrowingKey (which is the old key) instead of the expected newBorrowingKey in the _addKeysAndLoansInfo method. This can lead to unexpected behavior and potential DoS vulnerabilities, as the platform relies on a specific key format.
Vulnerability Detail
The function takeOverDebt is responsible for managing borrowing positions. During its execution, a new borrowing position is initialized or updated using the _initOrUpdateBorrowing function, which returns a new borrowing key (newBorrowingKey). However, subsequent actions are performed using the old borrowing key (borrowingKey), leading to inconsistencies in data storage and retrieval.
The borrowingKey (old key) is used instead of the newBorrowingKey. Given that the platform expects keys in the format:
borrowingKey = Keys.computeBorrowingKey(msg.sender, saleToken, holdToken);
This inconsistency can lead to unexpected behavior, data corruption, or potential denial-of-service vulnerabilities.
Impact
The mismanagement of borrowing keys can lead to:
Inaccurate tracking of borrowing positions.
Potential data corruption, making certain positions inaccessible.
Potential DoS attacks if an adversary can manipulate or predict key generation.
User mistrust due to unpredictable platform behavior.
The impact is high, especially for users who can only use the front-end portal to execute the trades.
sherlock-admin2
changed the title
Ancient Frost Albatross - Misuse of Old Borrowing key instead of New Key in takeOverDebt Function
0xMaroutis - Misuse of Old Borrowing key instead of New Key in takeOverDebt Function
Oct 30, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
0xMaroutis
medium
Misuse of Old Borrowing key instead of New Key in takeOverDebt Function
Summary
The function
takeOverDebt
seems to mistakenly use theborrowingKey
(which is the old key) instead of the expectednewBorrowingKey
in the_addKeysAndLoansInfo
method. This can lead to unexpected behavior and potential DoS vulnerabilities, as the platform relies on a specific key format.Vulnerability Detail
The function
takeOverDebt
is responsible for managing borrowing positions. During its execution, a new borrowing position is initialized or updated using the_initOrUpdateBorrowing
function, which returns a new borrowing key (newBorrowingKey
). However, subsequent actions are performed using the old borrowing key (borrowingKey
), leading to inconsistencies in data storage and retrieval.Specifically, in the line:
The borrowingKey (old key) is used instead of the newBorrowingKey. Given that the platform expects keys in the format:
borrowingKey = Keys.computeBorrowingKey(msg.sender, saleToken, holdToken);
This inconsistency can lead to unexpected behavior, data corruption, or potential denial-of-service vulnerabilities.
Impact
The mismanagement of borrowing keys can lead to:
The impact is high, especially for users who can only use the front-end portal to execute the trades.
Code Snippet
https://github.com/sherlock-audit/2023-10-real-wagmi/blob/main/wagmi-leverage/contracts/LiquidityBorrowingManager.sol#L441
Tool used
Manual Review
Recommendation
Update the takeOverDebt function to use the newBorrowingKey in the _addKeysAndLoansInfo method :
Duplicate of #53
The text was updated successfully, but these errors were encountered: