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 | |
---|---|
Name | Smart Contract Code Review and Security Analysis Report for RedStone |
Audited By | Ataberk Yavuzer |
Approved By | Grzegorz Trawinski |
Website | https://www.redstone.finance/→ |
Changelog | 21/02/2025 - Preliminary Report |
28/02/2025 - Final Report | |
Platform | SUI |
Language | Move |
Tags | Oracle; Signatures |
Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for RedStone
- Audited By
- Ataberk Yavuzer
- Approved By
- Grzegorz Trawinski
- Changelog
- 21/02/2025 - Preliminary Report
- 28/02/2025 - Final Report
- Platform
- SUI
- Language
- Move
- Tags
- Oracle; Signatures
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
---|---|
Repository | https://github.com/redstone-finance/redstone-oracles-monorepo/tree/main/packages/sui-connector/sui→ |
Commit | 8fab69f |
Review Scope
- Commit
- 8fab69f
Audit Summary
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-8916 | Duplicate Feed IDs in Data Packages Allow a Single Signer to Override Others | fixed | High | |
F-2025-8908 | Early Return in Signer Threshold Verification May Confirm Malicious Payloads | fixed | High | |
F-2025-8909 | Manipulated Initial Data Package Can Skew Timestamp Validation | fixed | Medium | |
F-2025-8753 | Median Calculation Does Not Take Zero Amounts Into Account, Leading to Lower Prices | accepted | Low | |
F-2025-8758 | Missing NatSpecs | accepted | Observation | |
F-2025-8754 | Lack of Upper and Lower Bounds for Timestamp Configuration May Cause System Instability | accepted | Observation | |
F-2025-8751 | Price Adapter Configuration Prone To Human Error | accepted | Observation |
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:
Scope Details | |
---|---|
Repository | https://github.com/redstone-finance/redstone-oracles-monorepo/tree/main/packages/sui-connector/sui→ |
Commit | 8fab69f040c04d118f37ed7198fa16edaba92f18 |
Whitepaper | https://hackenio.cc/hacken-methodologies→ |
Requirements | https://github.com/redstone-finance/redstone-oracles-monorepo/tree/main/packages/sui-connector/sui/README.md→ |
Technical Requirements | https://docs.redstone.finance/docs/get-started/data-formatting-processing/#technical-considerations-when-implementing-redstones-data-feeds→ |
Scope Details
- Commit
- 8fab69f040c04d118f37ed7198fa16edaba92f18
Assets in Scope
sui-connector/sui/contracts/price_adapter/sources/admin.move
sui-connector/sui/contracts/price_adapter/sources/main.move
sui-connector/sui/contracts/price_adapter/sources/price_adapter.move
sui-connector/sui/contracts/price_adapter/sources/price_data.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/config.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/conv.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/crypto.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/data_package.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/median.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/payload.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/update_check.move
sui-connector/sui/contracts/price_adapter/sources/redstone_sdk/validate.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.