Submitted by obront
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/AstariaRouter.sol#L780-L785
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/VaultImplementation.sol#L287-L306
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/VaultImplementation.sol#L233-L244
When a user calls Router#commitToLiens(), the Router calls commitToLien(). The comments specify:
//router must be approved for the collateral to take a loan,
However, the Router being approved isnt enough. It must be approved for all, which is a level of approvals that many users are not comfortable with. This is because, when the commitment is validated, it is checked as follows:
The check above allows the following situations pass:
This is inconsistent and doesnt make much sense. The approved users should have the same permissions.
More importantly, the most common flow (that the address approved for the individual NFT the Router is the caller) does not work and will lead to the function reverting.
Change the check to include msg.sender != operator rather than receiver != operator.
SantiagoGregory (Astaria) confirmed
Picodes (judge) commented:
