Normal Behavior:
In well-designed smart contracts, any change to critical access control parameters (such as the organizer or owner) should emit an event. Events are essential for off-chain systems, dApps, and users to track changes, audit contract activity, and respond to potential threats or misconfigurations. They are the primary mechanism for external observers to monitor contract state changes without constant polling.
Issue:
In the FestivalPass
contract, the setOrganizer
function changes the critical organizer
role but does not emit an event. This omission means that off-chain systems, such as block explorers, analytics dashboards, and security monitors, cannot detect or respond to changes in the organizer role. This can lead to missed alerts for malicious or accidental changes, and makes it difficult for users and auditors to track the contract’s history.
Relevant Code Example:
Likelihood:
This will occur every time the organizer is changed, which may happen during normal operations, upgrades, or in response to a security incident.
The risk is present in all deployments where off-chain monitoring or transparency is important.
Impact:
Monitoring Blindness: Off-chain systems and users cannot detect or respond to changes in the organizer role, missing potential attacks or misconfigurations.
Audit Difficulty: Auditors and users cannot reconstruct the history of access control changes, making it harder to verify the contract’s integrity and governance.
Delayed Response: Security incidents or mistakes may go unnoticed for longer, increasing the risk of damage.
To reproduce this issue, copy and paste the following test code into your test file (e.g., test/contract.t.sol
). This test demonstrates that changing the organizer does not emit an event, making it invisible to off-chain listeners:
Explanation:
The test changes the organizer and records all logs.
It checks for the presence of an OrganizerChanged
event.
Since the event is missing, off-chain systems cannot detect the change.
Add an event declaration and emit it whenever the organizer is changed. This enables off-chain monitoring and improves transparency.
Informational. This protocol doesn't rely on events to function, they are just nice to have, but not mandatory.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.