pyth2wormhole - Governance

CertiKCode version: not recorded (see the report)

CertiK reviewed Wormhole (pyth2wormhole - Governance) on 13 Dec 2022: 13 findings, 0 critical; 4 marked fixed, 9 open.

No open critical findings
Open the reportOpen Wormhole’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings13

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High101
Medium000
Low803
HighIncorrect Index When Removing a PositionFixed

The function `make_none()` is used to remove a position, which is needed when completely closing a position. By design, it will swap the last valid position with the position to be removed. ```rust=51 pub fn make_none(&mut self, i: usize, next_index: &mut u8) -> Result<()> { *next_index -= 1; self.positions[i] = self.positions[*next_index as usize]; None::<Option<Position>>.try_write(&mut self.positions[i]) } ``` The function first decreases `next_index` by 1, so it now points to the last created position. Then the function overwrites the position at index `i` with the information of the last position, and then changes position `i` to a `None` value. This eliminates position `i`, but the value of `next_index` does not point towards an empty position. A consequence of this is that if a new position was created, then this new position will overwrite the last created position due to the updated value of `next_index`, causing the user to completely lose a position.

LowInconsistent Error CodeFixed

In the function `update_woter_weight`, both actions `CastVote` and `CreateProposal` will compare the proposal `max_voting_time` with `config.epoch_duration`. It currently checks to ensure the `max_voting_time` is at least larger than one epoch. ```rust=406 if config.epoch_duration > max_voting_time.into() { return Err(error!(ErrorCode::ProposalTooLong)); } ``` However, the error code for the `max_voting_time` when it is less than one epoch will be `ErrorCode::ProposalTooLong`. If the max voting time is meant to be larger than one epoch, the error code should be "proposal too short" instead. Otherwise, if the max voting time is meant to be shorter than an epoch, the condition should be reversed.

LowInitialization of `MaxVoterWeightRecord`Fixed

When context for `UpdateMaxVoterWeight` has the `init_if_needed` condition for the `max_voter_record` account. Since the function `update_max_voter_weight()` fixes all fields of `max_voter_record`, there is no reason to use this function twice.

LowMissing Index CheckFixed

The position index `i`, converted from user input `index`, is not sanitized before accessing the positions in `stake_account_positions`.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Part of Wormhole’s security record

Wormhole
Audits11 audits by 4 firmsLast audit Oct 2024, by Cyfrin.
Critical findingsNo open critical findingsAcross 11 reports.
Open Wormhole’s security record

Security firm

CertiK

1,044 projects reviewed · 1,393 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us