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

RedStone

Audit name:

[L1] RedStone Finance / SDK / Feb2025

Date:

Mar 28, 2025

Table of Content

Introduction
Audit Summary
System Overview
Potential Risks
Findings
Appendix 1. Definitions
Appendix 2. Scope
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 Security Assessment.

RedStone is a decentralized oracle protocol that aggregates on-chain and off-chain data (such as asset price feeds) and delivers it on-chain with cryptographic proofs to ensure data integrity and authenticity to provide reliable, low-latency data for smart contracts and decentralized applications.

Document

NameCode Review and Security Analysis Report for RedStone
Audited ByBartosz Barwikowski
Approved ByAtaberk Yavuzer
Websitehttps://www.redstone.finance
Changelog16/02/2025 - Preliminary Report
28/04/2025 - Final Report
PlatformGeneric
LanguageRust
TagsOracle
  • Document

    Name
    Code Review and Security Analysis Report for RedStone
    Audited By
    Bartosz Barwikowski
    Approved By
    Ataberk Yavuzer
    Changelog
    16/02/2025 - Preliminary Report
    28/04/2025 - Final Report
    Platform
    Generic
    Language
    Rust
    Tags
    Oracle

Review Scope

Repositoryhttps://github.com/redstone-finance/rust-sdk/
Commit35a303985376b82523f86dcfa31fc1c6df64f3d8

Audit Summary

4Total Findings
3Resolved
1Accepted
0Mitigated

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

Documentation quality

  • Functional Requirements are available in the README and doc comments, detailing how to parse, validate, and aggregate data packages.

  • Technical Description is partially embedded in Rust doc comments (//! lines at file heads).

  • Code Comments describe core structures and logic.

Code quality

  • The development environment is properly configured with Rust’s standard toolchain and optional features.

  • The architecture is modular and follows good Rust design (split into coherent modules like core, types, protocol, etc.). Utility crates are separated from core logic.

  • The code uses safe Rust patterns, with minimal unsafe usage.

  • Each module has fairly robust test coverage.

Test coverage

Code coverage of the project is 100%. The project is a perfect example of how projects should be tested.

  • The code base includes extensive unit tests in multiple modules (especially aggregator, config, processor, validator).

  • The tests work correctly even for different target architectures (eg. wasm32-unkown-unkown).

System Overview

RedStone Rust SDK is a library providing:

  • Data Package structures and decoders (e.g., DataPackage, DataPoint, Payload), enabling applications to parse cryptographically signed price feed data.

  • Configurable Aggregation for feed IDs, allowing customization of threshold-based signer validation and feed filtering.

  • Modular Cryptography with multiple backends (e.g., k256 for ECDSA on Solana, or pure Rust-based secp256k1 crates).

  • Environment Abstractions for logging and environment-specific implementations (e.g., StdEnv, CasperEnv, SolanaEnv).

  • Utilities such as median calculation, slice filtering, and signature recovery.

This SDK is designed for flexible integration across different blockchain environments, ensuring that off-chain aggregated data can be securely transmitted on-chain with authenticity checks.

Privileged roles

This library itself does not define on-chain privileged roles. Instead, the Config structure can be set up by the integrating contract or environment to specify which signers are recognized and how many are required. Any “privileged” concept typically lives in the environment that uses this SDK (e.g., a contract’s admin can mutate the config). The library strictly enforces the signers and thresholds provided in the Config.

Potential Risks

An incorrect or incomplete Config (e.g. zero signers, repeated feed IDs in the config) will result in errors. While the library performs internal checks and errors out, an improperly set signer_count_threshold or timestamps could break data validation.

The library should be used only in smart contract environment where panic is not an issue.

Processing payloads may be compute intensive when a lot of data is provided. It may lead to denial of service issue if library is being incorrectly used, for example in case when fees are being paid by deployer of smart contract instead of users.

Findings

Code
Title
Status
Severity
F-2025-8834Panic in Sanitized Trait with Large or Non-Zero Byte Arrays
fixed

Observation
F-2025-8833Unverified Signer Processing in make_payload Leads to Unnecessary Computation
accepted

Observation
F-2025-8830Out-of-Bounds Slice Panic During Signature Checks
fixed

Observation
F-2025-8822Integer Overflow in DataPackage Signature Verification
fixed

Observation
1-4 of 4 findings

Findings like these can secure your blockchain.

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:

Asset

Type

lib.rsSource
core/mod.rsSource
core/processor_result.rsSource
core/processor.rsSource
core/aggregator.rsSource
core/config.rsSource
core/validator.rsSource
casper/mod.rsSource
network/error.rsSource
network/mod.rsSource
network/as_str.rsSource
solana/mod.rsSource
radix/mod.rsSource
radix/value_ext.rsSource
types/signer_address.rsSource
types/mod.rsSource
types/value.rsSource
types/bytes.rsSource
types/timestamp_millis.rsSource
types/feed_id.rsSource
crypto/mod.rsSource
utils/mod.rsSource
utils/median.rsSource
utils/trim.rsSource
utils/trim_zeros.rsSource
utils/slice.rsSource
utils/filter.rsSource
protocol/data_package.rsSource
protocol/data_point.rsSource
protocol/constants.rsSource
protocol/mod.rsSource
protocol/payload_decoder.rsSource
protocol/payload.rsSource
protocol/marker.rsSource
contract/verification.rsSource
contract/mod.rsSource
default_ext/mod.rsSource
  • Asset

    lib.rs

    Type

    Source

    Asset

    core/mod.rs

    Type

    Source

    Asset

    core/processor_result.rs

    Type

    Source

    Asset

    core/processor.rs

    Type

    Source

    Asset

    core/aggregator.rs

    Type

    Source

    Asset

    core/config.rs

    Type

    Source

    Asset

    core/validator.rs

    Type

    Source

    Asset

    casper/mod.rs

    Type

    Source

    Asset

    network/error.rs

    Type

    Source

    Asset

    network/mod.rs

    Type

    Source

    Asset

    network/as_str.rs

    Type

    Source

    Asset

    solana/mod.rs

    Type

    Source

    Asset

    radix/mod.rs

    Type

    Source

    Asset

    radix/value_ext.rs

    Type

    Source

    Asset

    types/signer_address.rs

    Type

    Source

    Asset

    types/mod.rs

    Type

    Source

    Asset

    types/value.rs

    Type

    Source

    Asset

    types/bytes.rs

    Type

    Source

    Asset

    types/timestamp_millis.rs

    Type

    Source

    Asset

    types/feed_id.rs

    Type

    Source

    Asset

    crypto/mod.rs

    Type

    Source

    Asset

    utils/mod.rs

    Type

    Source

    Asset

    utils/median.rs

    Type

    Source

    Asset

    utils/trim.rs

    Type

    Source

    Asset

    utils/trim_zeros.rs

    Type

    Source

    Asset

    utils/slice.rs

    Type

    Source

    Asset

    utils/filter.rs

    Type

    Source

    Asset

    protocol/data_package.rs

    Type

    Source

    Asset

    protocol/data_point.rs

    Type

    Source

    Asset

    protocol/constants.rs

    Type

    Source

    Asset

    protocol/mod.rs

    Type

    Source

    Asset

    protocol/payload_decoder.rs

    Type

    Source

    Asset

    protocol/payload.rs

    Type

    Source

    Asset

    protocol/marker.rs

    Type

    Source

    Asset

    contract/verification.rs

    Type

    Source

    Asset

    contract/mod.rs

    Type

    Source

    Asset

    default_ext/mod.rs

    Type

    Source

Assets in Scope

casper - casper
contract - contract
core - core
crypto - crypto
default_ext - default_ext
helpers - helpers
network - network
price-adapter - price-adapter
protocol - protocol
radix - radix
solana - solana
types - types
utils - utils

Disclaimer