Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded Q -> M from #268 [1674418407759] #668

Closed
c4-judge opened this issue Jan 22, 2023 · 2 comments
Closed

Upgraded Q -> M from #268 [1674418407759] #668

c4-judge opened this issue Jan 22, 2023 · 2 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value duplicate-377 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@c4-judge
Copy link
Contributor

Judge has assessed an item in Issue #268 as M risk. The relevant finding follows:

[L-02] Front running attacks by the owner
Project has one possible attack vectors by the onlyOwner:

dao.Fees , burnsFees , referralFees , botFees variable;
It determines the fees rate
The default deposit fees equal zero.
Can be updated by onlyOwner with function Fees

When a user use feed, expecting to have zero fee , the owner can frontrun the fee function and increase fees to 10000 bps , If the size is big enough, that may be a significant amount of money.

contracts/Trading.sol:
951 /
952: function setFees(bool _open, uint _daoFees, uint _burnFees, uint _referralFees, uint _botFees, uint _percent) external onlyOwner {
953: unchecked {
954: require(_daoFees >= _botFees+_referralFees
2);
955: if (_open) {
956: openFees.daoFees = _daoFees;
957: openFees.burnFees = _burnFees;
958: openFees.referralFees = _referralFees;
959: openFees.botFees = _botFees;
960: } else {
961: closeFees.daoFees = _daoFees;
962: closeFees.burnFees = _burnFees;
963: closeFees.referralFees = _referralFees;
964: closeFees.botFees = _botFees;
965: }
966: require(_percent <= DIVISION_CONSTANT);
967: vaultFundingPercent = _percent;
968: }
969: }
Recommended Mitigation Steps
Use a timelock to avoid instant changes of the parameters.

@c4-judge c4-judge added the 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value label Jan 22, 2023
@c4-judge
Copy link
Contributor Author

GalloDaSballo marked the issue as duplicate of #377

@c4-judge
Copy link
Contributor Author

GalloDaSballo marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value duplicate-377 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

1 participant