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

Missing parameter validation #195

Open
code423n4 opened this issue Feb 2, 2022 · 2 comments
Open

Missing parameter validation #195

code423n4 opened this issue Feb 2, 2022 · 2 comments
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Some parameters of functions are not checked for invalid values:

  • TreasuryManager.setPriceOracle: oracleAddress: could break things
  • TreasuryManager.setSlippageLimit: slippageLimit: should be <= SLIPPAGE_LIMIT_PRECISION

Impact

Wrong user input or wallets defaulting to the zero addresses for a missing input can lead to the contract needing to redeploy or wasted gas.

Recommended Mitigation Steps

Validate the parameters.

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Feb 2, 2022
code423n4 added a commit that referenced this issue Feb 2, 2022
@jeffywu jeffywu added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Feb 6, 2022
@jeffywu
Copy link
Collaborator

jeffywu commented Feb 6, 2022

Although this is somewhat of a duplicate of 174, this report is more specific than the others and so I would argue we can keep it separate.

@pauliax
Copy link
Collaborator

pauliax commented Feb 15, 2022

Only owner functions, and this does not lead to redeploy, the owner can fix these mistakes by calling the setters again.
I have invalidated #174, but because this submission is more concrete and relevant, I am leaving this as a non-critical recommendation.

@pauliax pauliax added 0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation and removed 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments labels Feb 15, 2022
weitianjie2000 added a commit to notional-finance/staked-note that referenced this issue Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

3 participants