Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the _setExternalBribe logs incorrect information #40

Open
hats-bug-reporter bot opened this issue Jul 12, 2024 · 0 comments
Open

the _setExternalBribe logs incorrect information #40

hats-bug-reporter bot opened this issue Jul 12, 2024 · 0 comments
Labels
bug Something isn't working Low lead auditor Low

Comments

@hats-bug-reporter
Copy link

Github username: --
Twitter username: --
Submission hash (on-chain): 0x1f14e721c29e2e97b474147fbe6482d950d5b964430ba90e41465e7b2401eb9f
Severity: low

Description:
Description

The vulnerability lies in the incorrect logging within the _setExternalBribes function. Specifically, the function emits an event called SetBribeFor using the internal_bribes[_gauge] instead of using external_bribes[_gauge] for the current external bribe address argument.

This misconfiguration in the event emission can be exploited by misleading observers of the blockchain about the actual deployment or change of external bribes. Given that blockchain transparency is fundamental for trust in the system, especially for operations involving incentive mechanisms (like bribes), this has real implications.

Attack Scenario

  1. Assume an observer monitors external bribes being set for gauges through the SetBribeFor event for governance or audit purposes.
  2. The contract admin sets or updates an external bribe address using the setNewBribes function.
  3. Upon execution, _setExternalBribe is called internally, and an event SetBribeFor(false, internal_bribes[_gauge], _external, _gauge) is emitted.
  4. Observers receive the event and, due to the erroneous emission of internal_bribes[_gauge] as the previous address, incorrectly conclude that the previous external bribe address was what is currently the internal bribe address.

Conclusion and Fix:

To correct this issue, the line in the _setExternalBribe function:

emit SetBribeFor(false, internal_bribes[_gauge], _external, _gauge);

should be changed to:

emit SetBribeFor(false, external_bribes[_gauge], _external, _gauge);

Attachments

  1. Proof of Concept (PoC) File
  1. Revised Code File (Optional)
@hats-bug-reporter hats-bug-reporter bot added the bug Something isn't working label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Low lead auditor Low
Projects
None yet
Development

No branches or pull requests

2 participants