Profile creation can be frontrun
The profile creation function in the LensHub contract can be frontrun by other whitelisted profile creators, who can observe pending transactions and claim a desired handle first. An attacker could then demand a ransom from the original creator for that handle.
Submitted by cmichel
The LensHub/PublishingLogic.createProfile function can be frontrun by other whitelisted profile creators.
An attacker can observe pending createProfile transactions and frontrun them, own that handle, and demand ransom from the original transaction creator.
Recommended Mitigation Steps
Everyone needs to use flashbots / private transactions but it might not be available on the deployed chain. A commit/reveal scheme for the handle and the entire profile creation could mitigate this issue.
donosonaumczuk (Aave Lens) disputed
Declined. This is by design. Governance can allow contracts/addresses to mint. If governance allows a malicious actor that is the fault of governance. Governance can also allow contracts that implement auction/commit reveal or other functionality as well to manage the profile minting system.
The protocol should take no opinion on this by default.
0xleastwood (judge) decreased severity to Medium and commented:
While I agree that this is the fault of the governance, I think it still stands that any whitelisted user may be compromised or become malicious at a later point in time. For that reason, I think this issue has some validity although due to the unlikely nature (requiring a faulty governance), I’ll mark this as
mediumrisk for now.
Zer0dot (Aave Lens) commented:
I disagree on the medium risk. Governance being faulty is not enough of a reason IMO. Like most governance-included protocols, governance getting compromised bears risks that are largely unavoidable.
0xleastwood (judge) commented:
While I agree that a faulty governance is an extremely unlikely outcome. It isn’t stated in the README and as per the judges’ guidelines, profiles can be front-run under specific stated assumptions/external requirements. A malicious whitelisted profile creator can reasonably front-run other creators.
2 — Med (M): vulns have a risk of 2 and are considered “Medium” severity when assets are not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
Zer0dot (Aave Lens) acknowledged and commented:
Fair enough, though we were aware of this— it’s clear it falls into a medium severity. We’re acknowledging this!
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 handle is claimed on a first-come basis with no commit/reveal or reservation step, so any whitelisted creator can race a pending transaction.
Impact
A malicious or compromised whitelisted profile creator could take a handle and demand a ransom, though the protocol team considers this by design and dependent on governance whitelisting.
What the attacker needed
Attacker is a whitelisted profile creator; attacker can see pending transactions
The fix
A commit/reveal scheme for the handle and the entire profile creation could mitigate this issue.
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.
When you create a profile, your transaction waits in a public queue before it is processed. Someone else watching that queue can send their own request for the same name first and take it. They can then ask you for money to give it back.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.