HUND

QuillAuditsFiles named in the report

Audit · firm’s term: audit report

QuillAudits reviewed Hund on 6 May 2024: 7 findings, 0 critical; all marked fixed.

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

Report hosted on quillaudits.com.

Trustblock does not review code.

Findings7

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

SeverityOpenAcknowledgedFixed
Critical000
High002
Medium002
Low003
HighLack of Input Validation in Staking Program FunctionsFixed

The staking program functions, such as create_state, create_pool, update_pool, amount, stake, unstake, and withdraw, lack proper input validation on function parameters. This deficiency can lead to unintended behavior, such as setting total points to 0, which can cause a division by zero panic. Additionally, unchecked input values can result in the creation of states or pools with invalid parameters, leading to potential exploits and disruption of normal operations

HighUnrestricted create_state Function Leading to Denial of ServiceFixed

The create_state function allows any user to create a new state with a specified id without any restrictions. Since the create_pool function requires the authority of an existing state, and only one pool can be created per id within the range of 0 to 12, an attacker can create 12 different states using create_state with ids from 0 to 12. This would prevent legitimate users from creating new states or pools, effectively causing a denial of service (DoS) attack on the staking program.

MediumUnused Variable amount_multiplerFixed

The variable amount_multipler is defined and initialized in the create_pool function, but it is not used in any calculations or further logic within the staking program. This unused variable introduces unnecessary complexity.

MediumUse of unwrap in Staking Program FunctionsFixed

The staking program functions contain multiple instances of the unwrap method, which can lead to panics if an error occurs. The unwrap method forces a program to terminate if the result is an Err, which can be exploited by attackers to cause unintentional crashes. This lack of proper error handling can lead to unintended crashes

LowMissing Event Emission in FunctionsFixed

Several functions within the solana_token_staking program lack necessary event emissions. Emitting events is crucial for providing transparency and traceability of important actions and state changes within the smart contract. The missing events include: 1. create_state 2. fund_reward_token 3. withdraw

LowMissing NatSpec DocumentationFixed

The program lacks NatSpec (Ethereum Natural Specification Format) documentation for its functions and data structures. NatSpec is a standardized format for documenting programs and is used to provide clear and detailed explanations of the purpose, inputs, outputs, and behavior of the contract's functions and data structures.

LowUnauthorized Fund Withdrawal in withdraw FunctionFixed

The withdraw function allows anyone with the authority to call the function and drain the reward amount and pool amount from the pool and reward vault without proper authorization checks. There is no verification that the reward amount and pool amount are indeed present or have been inputted by the user. Additionally, there are no checks to ensure that the user is authorized to perform the withdrawal.

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.

Repository and files the report names (2)

  • Staking.rs
  • programs/solana_token_staking/src/lib.rs

Part of Hund’s security record

Hund
Audits1 audit by 1 firmLast audit May 2024, by QuillAudits.
Critical findingsNo open critical findingsIn 1 report.
Open Hund’s security record

Security firm

QuillAudits

350 projects reviewed · 459 reports · latest Apr 2025

See QuillAudits’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