code-423n4 / redacted-bug-bounty

13 stars 9 forks source link

Set excessively high fees #12

Closed c4-bot-3 closed 10 months ago

c4-bot-3 commented 10 months ago

Lines of code

https://github.com/redacted-cartel/pirex-eth-contracts/blob/b211de1e745fc55f47a89cd76968f03a9efa0d9e/src/PirexEth.sol#L208-L223

Vulnerability details

Impact:

  1. Functionality:

Allows modification of a core financial parameter within the system. Potential to directly impact user experience and system revenue. Changes could lead to unexpected behavior or unintended consequences.

  1. Security:

Vulnerable to abuse if the GOVERNANCE_ROLE is compromised. Could be used to set excessively high fees, hindering system usage. Manipulation of fees could potentially lead to financial loss or system instability.

PoC (Proof of Concept):

  1. Gain access to GOVERNANCE_ROLE: Exploit vulnerabilities in role assignment logic. Obtain credentials through social engineering or other attack vectors.

  2. Set excessively high fees: Call setFee with arbitrary fee amounts exceeding maxFees. Disrupt system usage and potentially extract excessive revenue.

Mitigation:

  1. Robust access control: Implement strict security measures for GOVERNANCE_ROLE assignment and management. Enforce multi-signature or time-locked approvals for sensitive actions.

  2. Fee validation: Implement additional checks beyond maxFees to ensure reasonable fee amounts. Consider using trusted oracles or community-based governance mechanisms to determine appropriate fee levels.

  3. Monitoring and auditing: Regularly monitor fee changes and investigate any suspicious activity. Implement transparent fee structures and governance processes to ensure accountability.

  4. Emergency response: Establish procedures to halt malicious fee changes or mitigate their impact. Consider using governance mechanisms to quickly revert problematic fee updates.

c4-bot-8 commented 10 months ago

Discord id(s) for hunter(s): [object Object]

MiloTruck commented 10 months ago

Vulnerable to abuse if the GOVERNANCE_ROLE is compromised.

This is not an acceptable pre-condition for an exploit.