Attacker will prevent any raffles by calling `WinnablesTicketManager::cancelRaffle` before admin starts raffle
The cancelRaffle function in WinnablesTicketManager can be called by anyone to cancel a raffle while it is in the PRIZE_LOCKED state, which is a temporary state before the admin starts the raffle. An attacker could repeatedly cancel raffles to prevent any raffle from being started, disrupting the protocol.
0rpse Follow with 0x0bserver, 0x73696d616f and 46 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-08-winnables-raffles-judging/issues/57
Found by
0rpse, 0x0bserver, 0x73696d616f, 0xAadi, 0xShahilHussain, 0xarno, 0xbrivan, AllTooWell, BitcoinEason, Bluedragon, CatchEmAll, KaligoAudits, Oblivionis, Offensive021, PNS, PTolev, Paradox, S3v3ru5, Silvermist, TessKimy, Trident-Audits, ZC002, aman, araj, charles__cheerful, denzi_, dimi6oni, dimulski, dinkras_, dobrevaleri, durov, eeshenggoh, frndz0ne, iamnmt, jennifer37, neko_nyaa, ogKapten, p0wd3r, philmnds, phoenixv110, rsam_eth, sakshamguruji, shaflow01, shikhar, shui, tjonair, utsav, vinica_boy, y4y
Summary
The WinnablesTicketManager::cancelRaffle function is vulnerable to abuse because it is an external function that allows anyone to cancel a raffle if its status is set to PRIZE_LOCKED. An attacker could exploit this by repeatedly calling cancelRaffle whenever a new raffle is available to be started, effectively preventing any raffles from ever being initiated.
Root Cause
The root cause of this issue lies in the design of the function:
- The function is external, meaning it can be called by anyone.
- When called, it checks the underlying function
WinnablesTicketManager::_checkShouldCancel, which allows cancellation of a raffle if the status is PRIZE_LOCKED, which is a temporary state before the admin callsWinnablesTicketManager::createRaffle. - This opens up a window of opportunity for an attacker to cancel the raffle before it transitions to an active state.
Internal pre-conditions
There must be a raffleId with raffleStatus == PRIZE_LOCKED
External pre-conditions
The attacker must monitor the contract to identify when a raffle is in the PRIZE_LOCKED state, which occurs after the admin locks a prize in the WinnablesPrizeManager contract.
The attacker must call the WinnablesTicketManager::cancelRaffle before the admin calls WinnablesTicketManager::createRaffle.
Attack Path
- An attacker monitors the contract to detect when a new raffle enters the PRIZE_LOCKED state.
- As soon as the raffle reaches this state, the attacker calls the cancelRaffle function.
- The raffle is canceled before it can transition to an active state, preventing it from starting.
- The attacker can repeat this process for each new raffle, effectively blocking the initiation of all raffles.
Impact
This vulnerability allows a malicious actor to disrupt the entire raffle system. By preventing any raffles from starting, the attacker can undermine the functionality of the whole protocol.
PoC
The test below, which can be added to the hardhat test suite, shows that a random user can cancel the raffle if it hasn't yet been started
describe('Buyer can cancel raffle', () => {
before(async () => {
snapshot = await helpers.takeSnapshot();
});
after(async () => {
await snapshot.restore();
});
const buyers = [];
it('Should be able to cancel a raffle', async () => {
const now = await blockTime();
const buyer = await getWalletWithEthers();
await (await link.mint(manager.address, ethers.utils.parseEther('100'))).wait();
const tx = await manager.connect(buyer).cancelRaffle(counterpartContractAddress, 1, 1);
const { events } = await tx.wait();
expect(events).to.have.lengthOf(3);
const ccipMessageEvent = ccipRouter.interface.parseLog(events[0]);
expect(ccipMessageEvent.name).to.eq('MockCCIPMessageEvent');
expect(ccipMessageEvent.args.data).to.eq('0x000000000000000000000000000000000000000000000000000000000000000001');
await expect(manager.getWinner(1)).to.be.revertedWithCustomError(manager, 'RaffleNotFulfilled');
});
});
Mitigation
This vulnerability can be mitigated by updating the underlying function WinnablesTicketManager::_checkShouldCancel to only allow the admin to cancel a raffle that hasn't started yet.
Discussion
neko-nyaa
Escalate. Per Sherlock rules, this is a grief-DoS for one block. Because the only impact is denial of a raffle without any actual loss, as well as this function is not time-sensitive, this is a Low.
sherlock-admin3
Escalate. Per Sherlock rules, this is a grief-DoS for one block. Because the only impact is denial of a raffle without any actual loss, as well as this function is not time-sensitive, this is a Low.
You've created a valid escalation!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Brivan-26
@neko-nyaa You are incorrect.
Malicious users can repeatedly cancel raffles, preventing the creation of new raffles, stopping users from purchasing tickets, and forcing administrators to constantly create new raffles. This behavior renders the protocol unusable.
matejdrazic
I think my issue #158 is an dup of this issue and not #50 because the root cause is anyone can call cancel function. Can the judge please check this out?
Basicly the root is lack of access control on cancelRaffle. We're just showing 2 different exploits.
0xsimao
There is loss, chainlink tokens to send the cross chain messages, hence high is appropriate.
0rpse
The issue that exists is not only DoS for one block, because of the cross chain messaging the protocol will incur further losses on LINK tokens, though this report and many others do not mention that, some of them do(#391 and others).
The reports that fail to identify at least a Medium impact and only suggest DoS for a block should be invalidated as per Sherlock docs.
MarioBozhikov
Considering this is valid high there is a similar issue #498 that would also render the protocol unusable.
As the intent would be absolutely the same where instead of canceling the raffles all of the players will be refunded and will always need to reenter the raffle.
ArnieSec
In my opinion this should be invalid, from sherlock docs:
Griefing for gas (frontrunning a transaction to fail, even if can be done perpetually) is considered a DoS of a single block
In this example the LINK token is essentially the gas token that pays for a crosschain transaction, the same way eth is gas for a transaction on mainnet, hence the repeated canceling of the raffle even if done perpetually does not qualify the issue to be valid as can be confirmed from the snippet of the docs above.
The loss is constrained to essentially the gas token of ccip, and is a dos of a single block. This should not be valid according to sherlock rules.
furthermore, also from sherlock docs
DoS has two separate scores on which it can become an issue: The issue causes locking of funds for users for more than a week. The issue impacts the availability of time-sensitive functions (cutoff functions are not considered time-sensitive).
If both apply, the issue can be considered of High severity.
The issue does not cause locking of user funds for more than a week, and the issue does not impact time-sensitive function
Therefore the issue is clearly invalid, to expand even further, from the readme
Admins will always keep LINK in the contracts (to pay for CCIP Measages) and in the VRF subscription (to pay for the random numbers)
Brivan-26
@ArnieSec You did not understand the issue. The issue is NOT with the LINK amount not enough to cover cross-chain messages. Check my reply to the waston here
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/Winnables/public-contracts/pull/3
ArnieSec
@Brivan-26
Malicious users can repeatedly cancel raffles, preventing the creation of new raffles, stopping users from purchasing tickets, and forcing administrators to constantly create new raffles. This behavior renders the protocol unusable.
Your comment is above
frontrunning a transaction to fail, even if can be done perpetually) is considered a DoS of a single block
From Sherlock docs.
You are describing DOS of single block, the issue is invalid. Not to mention the DOS does not lock user funds at all, a requirement needed for this to even be a high as shown by my earlier comment.
Brivan-26
@ArnieSec
You are describing DOS of single block
Single block? Anyone can prevent raffle creation at any time no matter which block, this makes the protocol unusable. Read the issue carefully before elaborating further
ArnieSec
Yes that is the definition of perpetually, even if you can dos a block every time, this still does not qualify as valid under Sherlock rules
mystery0x
This finding concerns a scenario where Public Cancel function can DOS the protocol whereas #50 deals with CCIP Parameters in cancelRaffle and propagateWinner being never validated. They are different from each other and separately valid highs.
WangSecurity
As I understand, it's indeed a DOS of one-block and to have a larger impact, it has to be called repeatedly. But, as was quoted correctly above, the following rule applies:
Griefing for gas (frontrunning a transaction to fail, even if can be done perpetually) is considered a DoS of a single block, hence only if the function is clearly time-sensitive, it can be a Medium severity issue
But, as I see there's a LINK token loss and as I understand, it's not similar to gas fees, since you still have to pay gas for calling createRaffle, and paying LINK is a fee for sending CCIP cross-chain messages. Hence, I agree it's a loss of funds. Of course, feel free to correct me.
@mystery0x could you identify which duplicates of this report identify the loss of LINK token? For example, this report doesn't identify it, and only reports a one-block DOS of non-time-sensitive function.
ArnieSec
@WangSecurity
Maybe I agree there is a loss of funds but the issue cannot be high and should be downgraded to medium, duplicates who do not mention the Loss of link token funds should be de duplicated and made invalid aswell.
DoS has two separate scores on which it can become an issue: The issue causes locking of funds for users for more than a week. The issue impacts the availability of time-sensitive functions (cutoff functions are not considered time-sensitive).
If both apply, the issue can be considered of High severity.
Due to the fact that this bug only fits 1 of the 2 criteria, the bug cannot qualify for high severity.
Brivan-26
@WangSecurity I still don't understand how this this a DOS of one-block and why the LINK loss is the only impact.
The issue described here is that anyone can prevent any raffle from being started by calling cacnelRaffle which leads to the following impacts:
- No raffle can be started
- Admins should keep creating new raffles and keep locking new prizes
- Loss of LINK
This makes the protocol unusable.
AtanasDimulski
Hey @WangSecurity, the loss of the LINK token comes in second place, with this attack possible the only thing that the protocol can achieve is take space on the network, nothing more.
WangSecurity
duplicates who do not mention the Loss of link token funds should be de duplicated and made invalid aswell
Yes, I agree with that and that's why I asked the lead judge if the current duplicates are sufficient.
Due to the fact that this bug only fits 1 of the 2 criteria, the bug cannot qualify for high severity
The reason why I view it as a high-severity finding is not satisfying the DOS requirements but due to LINK token loss. As I understand, this issue has a definite loss of funds without extensive limitations.
I still don't understand how this this a DOS of one-block
Let me re-iterate. Let's consider only one instance of the attack, the attacker calls cancelRaffle front-running the admin's call to start a raffle. But, the admin can start a raffle in the very next block, no? I understand it should be a raffle with another id, but they still can use the same funds to start a new raffle? In this case, it's the one-block DOS.
Therefore, for this issue to have a larger impact, the attack has to repeated indefinitely. Therefore, the following from the DOS rules applies:
Griefing for gas (frontrunning a transaction to fail, even if can be done perpetually) is considered a DoS of a single block, hence only if the function is clearly time-sensitive, it can be a Medium severity issue.
the loss of the LINK token comes in second place, with this attack possible the only thing that the protocol can achieve is take space on the network, nothing more
Not sure what you mean by that @AtanasDimulski could you please re-iterate? Do you mean the LINK loss is not important and doesn't pose such an impact?
Note: thank you to the Watsons who elaborated on duplicates, I will reply to them once the above question is resolved
Brivan-26
@WangSecurity
Let me re-iterate. Let's consider only one instance of the attack, the attacker calls cancelRaffle front-running the admin's call to start a raffle. But, the admin can start a raffle in the very next block, no?
In the next block, the same attack can re-occur. Attacker can front-run any start raffle to cancel it. As a consequence, no raffle can be started
Therefore, for this issue to have a larger impact, the attack has to repeated indefinitely
That's what we are describing here ser. Please check #51 if you think this submission does not outline that clearly
AtanasDimulski
Hey @WangSecurity, first of all, I want to state that I am astonished by the fact we are still discussing whether this issue is valid or not. The whole purpose of the protocol is to create raffles, clearly, it can't. The fact that losing some LINK and ETH fees is considered to be more severe than that is, to put it mildly - illogical. What I mean by the protocol will only consume space is that a piece of code that is unusable, pointless, meaningless, useless, and so on, will be deployed and just exist on the chain. A whole protocol won't work because an extremely cheap attack can be performed multiple times - the cancelation of the transaction is performed on contracts that will be deployed on Avalance. The contract that sends the CCIP message will be deployed on Ethereum. This whole shenanigans is based on one stupid sentence from the Sherloc rules. However, the fact that this is extremely important admin function is disregarded. If we use a bit of logic we will clearly see that this is much more severe than some fees that are lost(fees are just an addition to the severity). Finally when we are going to abandon all sense and logic and simply argue about wording - from the readme: The protocol working as expected relies on having an admin creating raffles. - this clearly is not the case. From Sherlock docs: The protocol team can use the README (and only the README) to define language that indicates the codebase's restrictions and/or expected functionality. Issues that break these statements, irrespective of whether the impact is low/unknown, will be assigned Medium severity. High severity will be applied only if the issue falls into the High severity category in the judging guidelines. Lets please use some common sense, and stop with this pointless discussion. Thanks for your time.
ArnieSec
@WangSecurity
The reason why I view it as a high-severity finding is not satisfying the DOS requirements but due to LINK token loss. As I understand, this issue has a definite loss of funds without extensive limitations.
The network fee in ccip is .45$ + the destination gas fee, this will be cents since the destination is L2. So in total the entire link lost per tx will be 50 cents. The attacker pays the gas fee associated with calling the function on mainnet which will certainly be alot higher than 50 cents. Given that simply sending Usdc is costing 70 cents right now.
Now given that the impact is dos of one block
And knowing the attack will cost the attacker more than the loss to the protocol.
I think medium severity is appropriate.
AtanasDimulski
@ArnieSec you would have better spent your time writing this report instead of trying to come up with reasons why it is invalid. I suggest you go back to the readme, notice that the WinnablesTicketManager is deployed on Avalance, and then make your calculations again.
AtanasDimulski
The admin pays the CCIP fees on ehtereum + the gas fees for executing the transaction on Ethereum. The attacker pays for the fees to cancel the transaction on Avalance, and the LINK that was deposited by the admin in the WinnablesTicketManager is spent as well. It is best to have common sense!
ArnieSec
The attacker gains nothing, loses his gas cost which will be higher than usual since he is front running meaning he has to pay a higher fee in order to have his tx included first.
Furthermore the raffle creator can just frontrun the attacker and create the raffle.
The issue does not meet the criterium for a high
The issue causes locking of funds for users for more than a week. The issue impacts the availability of time-sensitive functions (cutoff functions are not considered time-sensitive). If at least one of these are describing the case, the issue can be a Medium.
It simply is not a high imo, there is no need to get emotional...
AtanasDimulski
Thanks for the anger management session, should I start quoting your comments so you don't delete them all the time?
ArnieSec
The discussion has moved from its intended purpose, which was to find the correct severity of the issue. You haven't defended your issue using Sherlock rules as I have defended my position. I think it's time for me to move on and let the judge make his decision 🫡
AtanasDimulski
The discussion has moved from its intended purpose, which was to find the correct severity of the issue. You haven't defended your issue using Sherlock rules as I have defended my position. I think it's time for me to move on and let the judge make his decision 🫡
@ArnieSec this discussion shouldn't have occurred in the first place. In my above comments, I have presented multiple arguments both from Sherlock rules and using common sense. The fact that you refuse to, or can't comprehend the severity of the issue is an entirely different topic. I am not gonna spend time calculating the exact attack costs, it is pretty clear who is going to pay more fees - the admin(LINK on Ethereum, ETH on Ethereum, LINK on Avalance). The attacker only pays for gas on Avalance. Again fees are not the main problem here. You have repeatedly quoted two sentences from the Sherloc rules, and refused to apply any logic. In your previous two comments which you have now deleted, you demonstrated a complete misunderstanding of how the protocol is supposed to work, thus my snappy remark.
WangSecurity
In the next block, the same attack can re-occur. Attacker can front-run any start raffle to cancel it. As a consequence, no raffle can be started That's what we are describing here ser. Please check https://github.com/sherlock-audit/2024-08-winnables-raffles-judging/issues/51 if you think this submission does not outline that clearly
As exactly said in the rule, it's considered a DOS of one-block (even though it can be repeated perpetually). As also said in the rules, it's invalid, unless the function is time-sensitive. Here, the function is not time-sensitive.
from the readme: The protocol working as expected relies on having an admin creating raffles. - this clearly is not the case.
The statement is not broken, the protocol has an admin that can create a raffle in the next block, this line from the README is not broken here.
About the LINK loss due to sending the CCIP message, as we can see in this page from Chainlink docs the billing mechanism is the blockchain fee + network fee. Blockchain fee is not considered a loss of funds. The Network fee is a couple of dollars. Therefore, it doesn't exceed the "small and finite amounts" for Medium severity:
Causes a loss of funds but requires certain external conditions or specific states, or a loss is highly constrained. The losses must exceed small, finite amount of funds, and any amount relevant based on the precision or significance of the loss.
Excuse me for the confusion caused above. Planning to accept the escalation and invalidate the issue.
Brivan-26
@WangSecurity I really do not understand why constantly applying the rule DOS of one-block. The issue is NOT just about blocking an action in one block. This issue will PREVENT ANY RAFFLE FROM BEING STARTED. What's the point of the protocol then?
WangSecurity
@Brivan-26 could you explain how you understand the following rule:
Griefing for gas (frontrunning a transaction to fail, even if can be done perpetually) is considered a DoS of a single block, hence only if the function is clearly time-sensitive, it can be a Medium severity issue.
This way I would understand what’s missing and needs to be explained, cause as I understand the explanation in this comment wasn’t good enough?
Brivan-26
@Brivan-26 could you explain how you understand the following rule:
Griefing for gas (frontrunning a transaction to fail, even if can be done perpetually) is considered a DoS of a single block, hence only if the function is clearly time-sensitive, it can be a Medium severity issue.
This way I would understand what’s missing and needs to be explained, cause as I understand the explanation in this comment wasn’t good enough?
I do understand the above rule, but it should not be used blindly everywhere. If a DoS can happen for a critical function that makes the protocol completely unusable, we don't invalidate the issue just because there is a general rule like that.
For the last time, the purpose of this protocol is to create raffles and reward a random winner. An attacker can front-run ANY raffle start to cancel it and prevent the raffle from being started. This means no raffle can be started, which makes the protocol completely unusable and useless, isn't this considered as DoS?
That rule should not be used blindly here. Consider the impact of this issue for a second. This will be my last comment for this issue
philmnds
This is indeed an attack that renders the protocol useless.
And one important thing to add is that it is a simple attack, not a front running one.
The flow of the raffle creation is:
- Raffle owner calls WinnablesPrizeManager::lockNFT() (or lockETH() or lockTokens())
- Raffle owner waits for the CCIP message to go from WinnablesPrizeManager to WinnablesTicketManager
- Raffle owner calls WinnablesTicketManager::createRaffle()
The attacker does not need to wait for the protocol owner to call createRaffle(). If the protocol owner does not immediately call createRaffle() upon the receipt of the CCIP message, the attacker just needs to call WinnablesTicketManager::cancelRaffle(). No mempool reading, no higher gas fees, just a simple txn.
So this is a very simple and hassle free way of making the protocol useless. Any of the white hackers that audited this protocol would be proficient enough to get a simple script running that does this - consider someone with a motivation to do so, such as a another raffle protocol that see Winnables as a competitor.
The dissent towards the invalidation completely loses sight of the security aspect in question, which is the fact that this issue breaks README assertion that the protocol should be able to start a raffle.
It seems bizarre to me that this discussion is taking so long. Not only because this is so clearly a valid issue, but also because it has absolutely no impact for anyone whether it will be valid or invalid - considering the number of dups, this will pay a penny.
ArnieSec
The rule does not state that the attack needs to be frontrunning attack in order to be a dos of 1 block. It states that frontrunning a tx to fail is considered a dos of one block. A dos of one block, with frontrunning or not, is still not grounds for a valid issue according to Sherlock rules.
Just because there is technically no tx front ran, does not change the fact that the issue is still a dos of one block. Because a raffle can therefore be started the next block.
And even if the raffle is then dosed for that block, it is still a dos of one block.
It seems bizarre to me that this discussion is taking so long. Not only because this is so clearly a valid issue, but also because it has absolutely no impact for anyone whether it will be valid or invalid - considering the number of dups, this will pay a penny.
The impact is that people who judged the issue according to Sherlock rules will be penalized. Additionally users who did not submit the bug because they knew about the ruling are also penalized. While users who submit an issue that does not qualify to be valid according to Sherlock rules are rewarded.
The dissent towards the invalidation completely loses sight of the security aspect in question, which is the fact that this issue breaks README assertion that the protocol should be able to start a raffle.
From the read me
We will report issues where the core protocol functionality is inaccessible for at least 7 days. Would you like to override this value?
This value seems reasonable
0xsimao
@WangSecurity this is not a 1 block DoS due to creating a raffle being a cross chain message. The admin would have to wait at least a few blocks to try again because creating a raffle requires a cross chain message.
Also, although the fee cost is small each time, the attack can be carried out infinite times, exceeding small and finite funds (I believe there is also a rule for this).
kuprumxyz
Also, although the fee cost is small each time, the attack can be carried out infinite times, exceeding small and finite funds (I believe there is also a rule for this).
It is, indeed, V. How to identify a medium issue:
Breaks core contract functionality, rendering the contract useless or leading to loss of funds of the affected party larger than 0.01% and 10 USD.
Note: If a single attack can cause a 0.01% loss but can be replayed indefinitely, it will be considered a 100% loss and can be medium or high, depending on the constraints.
DemoreXTess
@WangSecurity
I want to present a different perspective on this issue. We accept issue #26 as valid. While #26 differs slightly, it is quite similar to this issue. In both cases, a raffle that should not be cancellable can be cancelled by an attacker. The only distinction between the two is the timing: in #26, the attacker needs to wait for an edge case, whereas in this issue, the attacker must wait for the CCIP message.
I believe this issue should not be categorized as a DoS because it directly violates a fundamental invariant: a raffle that is meant to be non-cancellable can be cancelled without any conditions.
Given this, I think high severity is appropriate for this issue as it compromises the entire system. If we cannot classify this issue as high severity, I doubt we could classify any other issue as high severity in this contest.
WangSecurity
Watsons, please refrain from off-topic statements and claims that don't add value to the discussion (i.e. who has which interests, how large is the pay for this finding, etc.) and keep your arguments objective.
I do understand the above rule, but it should not be used blindly everywhere. If a DoS can happen for a critical function that makes the protocol completely unusable, we don't invalidate the issue just because there is a general rule like that.
The rule is not "blindly applied everywhere", this issue (regarding the DOS impact) perfectly fits the rule which was created for these exact issues where one iteration of the attack has little to no impact, i.e. the call can be repeated in the next block successfully.
For the last time, the purpose of this protocol is to create raffles and reward a random winner. An attacker can front-run ANY raffle start to cancel it and prevent the raffle from being started. This means no raffle can be started, which makes the protocol completely unusable and useless, isn't this considered as DoS?
This is repeating the same arguments as previously. Based on the 1-block DOS rule, the raffle can be started right after the attack is executed.
which is the fact that this issue breaks README assertion that the protocol should be able to start a raffle.
The statement in the README is different, and it was already explained above why it's not broken. No need to repeat the same arguments.
Besides this, the protocol team agrees with the existence of the vuln and confirmed they will fix it.
The sponsor confirming and fixing the issue has no effect on the judgment.
this is not a 1 block DoS due to creating a raffle being a cross-chain message. The admin would have to wait at least a few blocks
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
The cancelRaffle function lacks access control, allowing any user to cancel a raffle that is in the PRIZE_LOCKED state before the admin starts it.
Impact
This could prevent any raffle from starting, making the protocol unusable, and may cause a loss of LINK tokens used for cross-chain messages, though the judge ultimately deemed it a low-severity issue due to the small and finite loss.
What the attacker needed
Raffle in PRIZE_LOCKED state; attacker can call cancelRaffle before admin starts raffle
The fix
The vulnerability was fixed by updating the _checkShouldCancel function to only allow the admin to cancel a raffle that hasn't started yet.
How it was found
- An attacker monitors the contract to detect when a new raffle enters the PRIZE_LOCKED state.
- As soon as the raffle reaches this state, the attacker calls the cancelRaffle function.
- The raffle is canceled before it can transition to an active state, preventing it from starting.
- The attacker can repeat this process for each new raffle, effectively blocking the initiation of all raffles.
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.
In this raffle system, a raffle must be started by an admin after a prize is locked. However, a function meant to cancel raffles can be called by anyone while the raffle is in a waiting state. An attacker can call this function repeatedly to cancel every raffle before it starts, so no raffle ever runs.
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.