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

Missing events for critical parameter changing operations by owner #64

Open
code423n4 opened this issue Jun 30, 2021 · 2 comments
Open
Labels
2 (Med Risk) bug Something isn't working

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

The owner of TracerPerpetualSwaps contract, who is potentially untrusted as per specification, can change the market critical parameters such as the addresses of the Liquidation/Pricing/Insurance/GasOracle/FeeReceiver and also critical values such as feeRate, maxLeverage, fundingRateSensitivity, deleveragingCliff, lowestMaxLeverage, insurancePoolSwitchStage and whitelisting.

None of these setter functions emit events to record these changes on-chain for off-chain monitors/tools/interfaces to register the updates and react if necessary.

Impact: Malicious owner changes the critical addresses or values that significantly change the security posture/perception of the protocol. No events are emitted and users lose funds/confidence. The protocol takes a reputation hit.

Proof of Concept

See similar High-severity finding OpenZeppelin’s Audit of Audius (https://blog.openzeppelin.com/audius-contracts-audit/#high) and Medium-severity finding OpenZeppelin’s Audit of UMA Phase 4 (https://blog.openzeppelin.com/uma-audit-phase-4/)

https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/TracerPerpetualSwaps.sol#L522-L570

https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/TracerPerpetualSwaps.sol#L577-L585

Tools Used

Manual Analysis

Recommended Mitigation Steps

Consider emitting events when these addresses/values are updated. This will be more transparent and it will make it easier to keep track of the status of the system.

@code423n4 code423n4 added 2 (Med Risk) bug Something isn't working labels Jun 30, 2021
code423n4 added a commit that referenced this issue Jun 30, 2021
@raymogg
Copy link
Collaborator

raymogg commented Jul 5, 2021

Duplicate of #66

@raymogg raymogg marked this as a duplicate of #66 Jul 5, 2021
@raymogg raymogg closed this as completed Jul 5, 2021
@cemozerr
Copy link
Collaborator

Opening this issue as the event emission seems to be separate from the arbitrarily changing of the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants