createRJLaunchEvent() can be called by anyone with 1 Wei of _token and stop others from creating RJLaunchEvent with the same token anymore
The factory function that creates a launch event for a token had no access control, so anyone holding even a tiny amount of that token could register it first. This blocked the legitimate issuer or the platform from creating the launch event for the same token afterwards.
Submitted by WatchPug, also found by p4st13r4
function createRJLaunchEvent(
address _issuer,
uint256 _phaseOneStartTime,
address _token,
uint256 _tokenAmount,
uint256 _tokenIncentivesPercent,
uint256 _floorPrice,
uint256 _maxWithdrawPenalty,
uint256 _fixedWithdrawPenalty,
uint256 _maxAllocation,
uint256 _userTimelock,
uint256 _issuerTimelock
) external override returns (address) {
require(
getRJLaunchEvent[_token] == address(0),
"RJFactory: token has already been issued"
);
require(_issuer != address(0), "RJFactory: issuer can't be 0 address");
require(_token != address(0), "RJFactory: token can't be 0 address");
require(_token != wavax, "RJFactory: token can't be wavax");
require(
_tokenAmount > 0,
"RJFactory: token amount needs to be greater than 0"
);
require(
IJoeFactory(factory).getPair(_token, wavax) == address(0) ||
IJoePair(IJoeFactory(factory).getPair(_token, wavax))
.totalSupply() ==
0,
"RJFactory: liquid pair already exists"
);
address launchEvent = Clones.clone(eventImplementation);
// msg.sender needs to approve RocketJoeFactory
IERC20(_token).transferFrom(msg.sender, launchEvent, _tokenAmount);
In the current implementation, RocketJoeFactory.sol#createRJLaunchEvent() can be called by anyone with at least 1 Wei of _token.
This allows a malicious user or attacker to call createRJLaunchEvent() with minimal cost and stop others, especially the platform itself or the rightful issuer of the token from creating the RJLaunchEvent.
Recommendation
Consider making createRJLaunchEvent() only callable by the owner of RocketJoeFactory.
cryptofish7 (Trader Joe) acknowledged and commented:
That’s the spirit, not a single token should be in circulation.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the function lacked an access-control check, so any caller holding the token could register a launch event and the one-event-per-token rule then blocked the rightful issuer.
Impact
An attacker could cheaply pre-empt the launch event for any token, preventing the platform or the rightful issuer from creating it.
What the attacker needed
Hold at least 1 Wei of the target token; token has no launch event yet
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A launch event is a contract that manages the sale of a new token. The factory that creates these events did not check who was calling it, so any person holding a very small amount of the token could create the event first. Because the factory only allows one event per token, the real owner was then locked out.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.