Q1 2025 Web3 Security ReportAccess control failures led to $1.63 billion in losses
Discover report insights
  • Hacken
  • Audits
  • redstone
  • [SCA] RedStone Finance / Sui Connector / Feb2025
RedStone logo

RedStone

Audit name:

[SCA] RedStone Finance / Sui Connector / Feb2025

Date:

Feb 28, 2025

Table of Content

Introduction
Audit Summary
System Overview
Potential Risks
Findings
Appendix 1. Definitions
Appendix 2. Scope
Appendix 3. Additional Valuables
Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the RedStone team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

Redstone SUI Connector is price oracle contract integration for Redstone's SUI stack.

Document

NameSmart Contract Code Review and Security Analysis Report for RedStone
Audited ByAtaberk Yavuzer
Approved ByGrzegorz Trawinski
Websitehttps://www.redstone.finance/
Changelog21/02/2025 - Preliminary Report
28/02/2025 - Final Report
PlatformSUI
LanguageMove
TagsOracle; Signatures
Methodologyhttps://hackenio.cc/sc_methodology

Audit Summary

7Total Findings
3Resolved
4Accepted
0Mitigated

The system users should acknowledge all the risks summed up in the risks section of the report

Documentation quality

  • Functional requirements are partially missed (NatSpecs).

  • Technical description is not provided.

Code quality

  • The development environment is configured.

Test coverage

It is not possible to calculate total coverage since there is no helper tool on SUI Framework. However;

  • Deployment and basic interactions are covered with tests.

  • Payload and signature checks are covered.

  • Unit tests are exist for all contracts.

System Overview

sui-connector is a price feed adapter integration with the following smart contracts:

price_feed.move  — RedStone Price Feed ETH contract with view functionalities

price_data.move — price data reference contract with view functionalities for price data fields

price_adapter.move — main price adapter contract contains price update functionalities such as write_price()

main.move — helper smart contract for creating and initializing a price_adapter struct with given configuration

admin.move — smart contract designed to grant Admin capability

config.move — stores protocol-wide signer and timestamp configuration

conv.move — conversion utility for bytes data structure

crypto.move — smart contract utilizes ECDSA signatures to validate payloads and signers

data_package.move — data package struct that contains significant information such as signer_address, timestamp and other data_points

median.move — utility for calculating median for vector<u256> data type

payload.move — smart contract that verifies, processes, and runs security checks on RedStone-specific payload struct

update_check.move — smart contract that manages trusted updaters.

validate.move — verification contract for multiple protocol-wide structures such as data packages, timestamps and signer counts

Privileged roles

  • The AdminCap can initialize and update price adapters, modify configurations, adjust protocol versions, and create new price adapters.

Potential Risks

Some configurations may be susceptible to human error due to missing lower and upper bounds.

Move.toml contains the testnet version of the SUI framework (rev = "framework/testnet"). This version may contain testnet functionalities rather than mainnet functionalities.

Findings

Code
Title
Status
Severity
F-2025-8916Duplicate Feed IDs in Data Packages Allow a Single Signer to Override Others
fixed

High
F-2025-8908Early Return in Signer Threshold Verification May Confirm Malicious Payloads
fixed

High
F-2025-8909Manipulated Initial Data Package Can Skew Timestamp Validation
fixed

Medium
F-2025-8753Median Calculation Does Not Take Zero Amounts Into Account, Leading to Lower Prices
accepted

Low
F-2025-8758Missing NatSpecs
accepted

Observation
F-2025-8754Lack of Upper and Lower Bounds for Timestamp Configuration May Cause System Instability
accepted

Observation
F-2025-8751Price Adapter Configuration Prone To Human Error
accepted

Observation
1-7 of 7 findings

Identify vulnerabilities in your smart contracts.

Appendix 1. Definitions

Severities

When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.

Reference on how risk scoring is done is available through the repository in our Github organization:

Severity

Description

Critical
Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

High
High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

Medium
Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

Low
Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution.
  • Severity

    Critical

    Description

    Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

    Severity

    High

    Description

    High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

    Severity

    Medium

    Description

    Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

    Severity

    Low

    Description

    Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution.

Potential Risks

The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.

Appendix 2. Scope

The scope of the project includes the following smart contracts from the provided repository:

Assets in Scope

sui-connector
sui
contracts
price_adapter
sources
admin.move - sui-connector/sui/contracts/price_adapter/sources/admin.move
main.move - sui-connector/sui/contracts/price_adapter/sources/main.move
price_adapter.move - sui-connector/sui/contracts/price_adapter/sources/price_adapter.move
price_data.move - sui-connector/sui/contracts/price_adapter/sources/price_data.move
redstone_sdk
config.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/config.move
conv.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/conv.move
crypto.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/crypto.move
data_package.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/data_package.move
median.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/median.move
payload.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/payload.move
update_check.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/update_check.move
validate.move - sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/validate.move
price_feed
sources
price_feed.move - sui-connector/sui/contracts/price_feed/sources/price_feed.move

Appendix 3. Additional Valuables

Additional Recommendations

The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.

To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:

  • Detecting changes to ownership or critical permissions.

  • Monitoring large or unexpected transactions and minting events.

  • Pausing operations when irregularities are identified.

These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.

Disclaimer