Open code423n4 opened 1 year ago
Picodes marked the issue as primary issue
Regrouping all issues related to the possibility that proposal can't be executed
MikeHathaway marked the issue as sponsor confirmed
Picodes marked the issue as satisfactory
Picodes marked the issue as selected for report
I think the issue should be low/informational.
There is a discussion here about issues that are conditional on user mistake. Wanted to note that the arguments pro marking user mistake as medium, agree that some leak of value or loss of funds should be involved, which is not the case in this issue.
The DoS is only limited to the specific proposal and not to the system.
@0xRobocop I didn't consider this an instance of "user mistake". My reasoning was that the sponsor implemented a bunch of safeguards in _validateCallDatas
to avoid invalid proposals from being voted and going through the whole voting process (taking some place in the amount of funding available) so I saw this as a potential spam / griefing attack
On second thought, I think @0xRobocop is right and we should consider this a "user mistake". Indeed, malicious proposals can be proposed anyway, for example, to transfer funds to inexistent addresses or to spam the voting system.
So I think Low severity is more appropriate.
Picodes marked the issue as not selected for report
Picodes changed the severity to QA (Quality Assurance)
On second thought, I think @0xRobocop is right and we should consider this a "user mistake". Indeed, malicious proposals can be proposed anyway, for example, to transfer funds to inexistent addresses or to spam the voting system.
So I think Low severity is more appropriate.
If a malicious proposal gets voted on, the funds will be locked in the system. #188 explains this precisely. Why would that be just low severity?
@bytes032 in the sense that malicious proposals can be submitted anyway (sending funds to addresses not owned by anyone, etc), so it's up to voters to verify that what they vote for is correct. The safety checks are mitigating some attacks but doesn't change this
Picodes marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L63 https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L133
Vulnerability details
Impact
When proposing a proposal, the call data would be validated in
Funding._validateCallDatas
. It would check if the call data match the specifications. And thecalldatas_
would be used inFunding._execute
when the proposal has passed. However, the proposal could be blocked due to the missed check on the length ofcalldatas_[i]
.Proof of Concept
Funding._validateCallDatas()
checks the selector incalldatas_[i]
and fetch the tokensRequested fromcalldatas_[i]
https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L133A normal calldata should be formed like:
And the
tokensRequested
can fetch by:But a malformed calldata can be:
The calldata still pass the check in
Funding._validateCallDatas
. And the fetchedtokensRequested
is zeroHowever, when the proposal has passed. The proposal cannot be executed since
targets_[i].call
won’t succeed. https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L63Tools Used
Manual Review
Recommended Mitigation Steps
Add a length check on
calldata_[i]
to prevent invalid proposals.Assessed type
Invalid Validation