Anybody can join a community before it is made #181
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate
This issue or pull request already exists
valid
Lines of code
https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Community.sol#L169-L203
https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/libraries/SignatureDecoder.sol#L20-L41
Vulnerability details
Impact
User can stealthily join community without community owner approval. An unwanted user can pass member checks (ask to publish) and more down the line, they can easily front run any community creation and join with no approvals.
Proof of Concept
I ran this code in the
test/utils/communityTests.ts
file indescribe('createCommunity()'
tests.Tools Used
tests included in repo, hardhat, chai, js
Recommended Mitigation Steps
I wrote another bug report with these mitigation steps:
I recommend reverting transactions that have
signer = 0
I know the project has a mechanism to allow hashes of transactions to be executed by anyone if approved, so I would check this condition first then check the signature. This way you keep the current mechanism working and not allow invalid signatures to come through the pipeline.
example of fix:
The text was updated successfully, but these errors were encountered: