The redeem method in PoolTemplate verifies insurance data using a Merkle proof that only includes the target and insured addresses, not the incident timestamp. An attacker could reuse a valid proof to call insure with high amounts if the owner creates an incident with a future timestamp.
As can be seen, the only data related to the _insurance aretarget and insured, so as the incident has no relation with theInsurance, apparently nothing prevents a user to call insure with high amounts, after receive the incident, the only thing that prevents this from being reused is that the owner creates the incident with an _incidentTimestamp from the past.
So if an owner create a incident from the future it’s possible to create a new insure that could be reused by the same affected address.
Another lack of input verification that could facilitate this attack is the _span=0 in the insure method.
Recommended Mitigation Steps
It is mandatory to add a check in applyCover that_incidentTimestamp is less than the current date and the span argument is greater than 0 in theinsure method.
2 — Med: Assets 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.
The external requirement here would be an incorrect timestamp from the owner which would cause assets to be at risk from the replay.
The original report as published on Code4rena, by 0x1f8b. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
Likely the Merkle proof verification omits the incident timestamp, allowing replay if the timestamp is in the future.
Impact
Could allow an attacker to reuse a valid proof to insure high amounts and potentially drain funds, but only if the owner creates an incident with a future timestamp.
What the attacker needed
Owner creates incident with future timestamp; attacker has a valid Merkle proof
The fix
The contract should be fixed by adding a check that the incident timestamp is in the past and that the span is greater than zero.
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.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
A smart contract checks a proof to confirm an insurance claim, but the proof does not include when the incident happened. If the contract owner sets a future date for an incident, someone could reuse the same proof to file another claim and get more money than intended.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.