Introduction
We express our gratitude to the ChainSight team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Chainsight oracles are modular, on-chain data pipelines composed of indexers, calculators, and relayers that fetch, process, and deliver external data to smart contracts. They support reusable data components across chains .
Document | |
---|---|
Name | Smart Contract Code Review and Security Analysis Report for ChainSight |
Audited By | Lukasz Mikula |
Approved By | Ataberk Yavuzer |
Website | https://chainsight.network→ |
Changelog | 16/04/2025 - Preliminary Report |
23/04/2025 - Final Report | |
Platform | Ethereum |
Language | Solidity |
Tags | Oracle |
Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for ChainSight
- Audited By
- Lukasz Mikula
- Approved By
- Ataberk Yavuzer
- Website
- https://chainsight.network→
- Changelog
- 16/04/2025 - Preliminary Report
- 23/04/2025 - Final Report
- Platform
- Ethereum
- Language
- Solidity
- Tags
- Oracle
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
---|---|
Repository #1 | https://github.com/horizonx-tech/chainsight-management-oracle→ |
Commit #1 | 955bad45318c98549525bbe70fa19ba7bbff893b |
Remediation Commit #1 | 955bad45318c98549525bbe70fa19ba7bbff893b |
Repository #2 | https://github.com/horizonx-tech/chainsight-multisource-oracle→ |
Commit #2 | 86aa2b1576c9e4f2c81ae5883f6c814a0c7d89ad |
Remediation Commit #2 | 0e5cc1b5287e2fc1b041e0e0bbeeccd7edde9c38 |
Review Scope
- Commit #1
- 955bad45318c98549525bbe70fa19ba7bbff893b
- Remediation Commit #1
- 955bad45318c98549525bbe70fa19ba7bbff893b
- Commit #2
- 86aa2b1576c9e4f2c81ae5883f6c814a0c7d89ad
- Remediation Commit #2
- 0e5cc1b5287e2fc1b041e0e0bbeeccd7edde9c38
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
A detailed documentation about the protocol was provided
Code quality
The code has multiple functions that are very similar to each other; they could be merged into one function.
A redundant code was found in the project
Test coverage
The tests are present, but were not working due to unresolved dependency issues
System Overview
ChainSight Oracle System consists of two main contracts:
Oracle.sol — A data storage contract that allows addresses to record and retrieve timestamped data.
It has the following attributes:
Built with OpenZeppelin's upgradeable proxy pattern
Stores arbitrary data with associated timestamps
Provides read functions for various data types (strings, uint256, int256)
Each address can only write data for itself
MultiSourceOracle.sol — An aggregator that combines price data from multiple sources:
Integrates Chainlink, Pyth, and ChainSight oracles
Uses time-weighted averaging with configurable parameters
Implements median-based outlier detection
Normalizes prices to a consistent decimal format (default: 8 decimals)
Includes fallback mechanisms for handling stale data
Privileged roles
Owner can configure price sources (add/remove/modify)
Owner can adjust system parameters (stale threshold, decay rate, etc.)
Owner can toggle outlier detection
Owner can pause and unpause the system
Potential Risks
Data Source Failures: If any single oracle source reverts, the entire aggregation process will fail due to a lack of try/catch mechanism.
Price Manipulation: Outlier detection is bypassed when fewer than 3 fresh data sources are available, creating vulnerability during periods of limited oracle availability.
Precision Loss: Conversion between different decimal precisions uses truncation rather than rounding, creating systematic bias, particularly for non-USD-denominated pairs.
Silent Stale Data Fallback: When all sources are stale, the system automatically falls back to the newest stale price without notifying consumers of this transition.
Time-Weight Exploitation: The exponential decay weighting system gives significantly higher influence to recent timestamps, potentially allowing manipulation by controlling the most recently updated source.
Findings
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2025-9838 | Fallback to newest stale price is possible | fixed | Medium | |
F-2025-9841 | Hard dependency on Pyth for specific interface methods | fixed | Low | |
F-2025-9839 | Single source failure causes complete oracle failure | fixed | Low | |
F-2025-9842 | No duplicate checks when adding ChainSight sources | fixed | Observation | |
F-2025-9840 | Missing event emissions | fixed | 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 #1 | https://github.com/horizonx-tech/chainsight-management-oracle→ |
Commit #1 | 955bad45318c98549525bbe70fa19ba7bbff893b |
Repository #2 | https://github.com/horizonx-tech/chainsight-multisource-oracle→ |
Commit #2 | 86aa2b1576c9e4f2c81ae5883f6c814a0c7d89ad |
Whitepaper | N/A |
Requirements | N/A |
Technical Requirements | N/A |
Scope Details
- Commit #1
- 955bad45318c98549525bbe70fa19ba7bbff893b
- Commit #2
- 86aa2b1576c9e4f2c81ae5883f6c814a0c7d89ad
- Whitepaper
- N/A
- Requirements
- N/A
- Technical Requirements
- N/A
Assets in Scope
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.