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

anyone can call function sponsor #40

Open
code423n4 opened this issue Jun 14, 2021 · 3 comments
Open

anyone can call function sponsor #40

code423n4 opened this issue Jun 14, 2021 · 3 comments

Comments

@code423n4
Copy link
Contributor

Handle

pauliax

Vulnerability details

Impact

This function sponsor should only be called by the factory, however, it does not have any auth checks, so that means anyone can call it with an arbitrary _sponsorAddress address and transfer tokens from them if the allowance is > 0:
/// @notice ability to add liqudity to the pot without being able to win.
/// @dev called by Factory during market creation
/// @param _sponsorAddress the msgSender of createMarket in the Factory
function sponsor(address _sponsorAddress, uint256 _amount)
external
override
{
_sponsor(_sponsorAddress, _amount);
}

Recommended Mitigation Steps

Check that the sender is a factory contract.

@code423n4 code423n4 added 3 (High Risk) bug Something isn't working labels Jun 14, 2021
code423n4 added a commit that referenced this issue Jun 14, 2021
@Splidge
Copy link
Collaborator

Splidge commented Jun 15, 2021

This is a good one!

@mcplums
Copy link
Collaborator

mcplums commented Jun 18, 2021

Yeah this is massive one!! Thanks @pauliax :)

@Splidge
Copy link
Collaborator

Splidge commented Jun 21, 2021

fixed here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants