Spectra - mrudenko's results

A permissionless interest rate derivatives protocol on Ethereum.

General Information

Platform: Code4rena

Start Date: 23/02/2024

Pot Size: $36,500 USDC

Total HM: 2

Participants: 39

Period: 7 days

Judge: Dravee

Id: 338

League: ETH

Spectra

Findings Distribution

Researcher Performance

Rank: 30/39

Findings: 1

Award: $53.72

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

53.7155 USDC - $53.72

Labels

bug
2 (Med Risk)
partial-50
sufficient quality report
:robot:_04_group
duplicate-210

External Links

Lines of code

https://github.com/code-423n4/2024-02-spectra/blob/383202d0b84985122fe1ba53cfbbb68f18ba3986/src/tokens/PrincipalToken.sol#L483-L485

Vulnerability details

Impact

The maxRedeem function is designed to return the maximum amount a user can redeem. However, it lacks a check to adjust its behavior when the protocol is paused, potentially misleading users or external contracts about the available actions during the pause state. This oversight may lead to failed transactions or unintended interactions, as users might attempt to redeem based on incorrect assumptions about their capabilities during a pause.

Proof of Concept

The issue lies within the maxRedeem function implementation in the PrincipalToken.sol contract. The function is intended to return the maximum amount that can be redeemed by a given owner. However, when the protocol is paused, the function does not account for this state and should, for security and clarity purposes, return 0 to indicate that no redemption actions are possible.

function maxRedeem(address owner) public view override returns (uint256) { return _maxBurnable(owner); //@audit must return 0 when protocol is paused }

Tools Used

Manual

To address this issue, it's recommended to modify the maxRedeem function to include a check for the protocol's paused state. If the protocol is paused, the function should immediately return 0, clearly indicating that no redemption actions are possible under the current state.

The modification could involve using a state variable or a function call to check the pause state, similar to how other functions might check for such conditions. Here is a conceptual implementation:

function maxRedeem(address owner) public view override returns (uint256) { if (protocolPaused()) { // This is a placeholder for the actual paused state check return 0; } return _maxBurnable(owner); }

Assessed type

Context

#0 - c4-pre-sort

2024-03-03T09:23:05Z

gzeon-c4 marked the issue as duplicate of #33

#1 - c4-pre-sort

2024-03-03T09:23:08Z

gzeon-c4 marked the issue as sufficient quality report

#2 - c4-judge

2024-03-11T00:24:14Z

JustDravee marked the issue as satisfactory

#3 - c4-judge

2024-03-11T00:24:19Z

JustDravee marked the issue as partial-50

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter