Submitted by d4r3d3v1l
https://github.com/code-423n4/2023-09-delegate/blob/main/src/DelegateToken.sol#L134
https://github.com/code-423n4/2023-09-delegate/blob/main/src/DelegateToken.sol#L168
https://github.com/code-423n4/2023-09-delegate/blob/main/src/libraries/DelegateTokenStorageHelpers.sol#L149
There is no way to revoke the approval which given via DelegateToken.approve(address,delegateTokenId). They can able call the DelegateToken.transferFrom even the tokenHolder revoke the permission using the DelegateToken.setApprovalForAll.
If the spender address is approved by the PT token, we can call the DelegateToken.withdraw.
Alice is the token Holder.
Alice approves Bob via DelegateToken.setApprovalForAll(Bob,true).
Bob approves himself using DelegateToken.approve(Bob,delegateTokenId)
Alice revokes the Bob approval by calling DelegateToken.setApprovalForAll(Bob,false);
Now Bob can still calls the DelegateToken.transferFrom(Alice,to,delegateTokenId) which is subjected to call only by approved address.
The transfer will be successful.
Code details
https://github.com/code-423n4/2023-09-delegate/blob/main/src/libraries/DelegateTokenStorageHelpers.sol#L143
Even after revoking the approval for operator using setApprovalAll this msg.sender == readApproved(delegateTokenInfo, delegateTokenId) will be true and able to call transferFrom function.
Test function
If token Holder revokes the approval for a operator using DelegateToken.setApprovalForAll, revoke the all the approvals(DelegateToken.approve) which is done by the operator.
Access Control
0xfoobar (Delegate) confirmed and commented:
Alex the Entreprenerd (judge) commented:
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
0xfoobar (Delegate) commented:
