background
logo

Security Audit Report for PopDEX's Bridge Contracts

專案簡介

The target of this audit is the private code repository of Bridge Contracts of PopDEX. The DexChain Bridge implements a Hub-and-Spoke cross-chain bridge architecture consisting of native Rust precompiled contracts on the Hub chain (Core) and Solidity upgradeable contracts on each Spoke chain (EVM). On the Hub side, three Rust modules are deployed as native precompiles: MessageGateway at 0x1001, which handles inbound message verification, hot/cold verifier signature validation, replay protection, and verifier set management; TokenBridge at 0x100f, which manages user withdrawals, deposit execution, and governance configuration synchronization to Spoke chains; and common, which provides shared utilities including EIP-712 digest construction. On the Spoke side, the bridge is implemented through Solidity UUPS-upgradeable contracts. MessageGateway.sol is responsible for receiving and validating cross-chain messages from the Hub chain, enforcing message execution rules, replay protection, and authorized gateway interactions. TokenBridge.sol manages token deposit and withdrawal flows on the Spoke chain, including locking or releasing bridged assets, initiating outbound bridge messages to the Hub, executing inbound bridge instructions, and applying bridge-related governance or configuration updates propagated from the Hub.

Please refer to the report for the detailed audit scope.

Our audit methodology employs automated vulnerability scans, manual verification, and business logic analysis to uncover potential security issues coupled with gas and code quality optimization recommendations.

In summary, we have found that the codebase contains 2 high-risk issues that require prompt attention. In addition, we have identified other non-critical issues as well as recommendations and notes that should be considered. The Bridge Contracts team has addressed these issues promptly. It is important to note that our audit covers only the final reported versions of the codebase. Any subsequent updates would require a re-evaluation.

關鍵發現

我們在該智能合約中共發現 10 個潛在問題,另有 11 條建議與 7 條說明,明細如下:

高風險:2
中風險:4
低風險:4
建議:11
說明:7
ID Severity Description Status
1 High Lack of challenge_period initialization in genesis blocks subsequent verifier updates Fixed
2 High Spoke custody configuration incorrectly overwrites the Hub challenge_period Fixed
3 Medium Improper configuration synchronization process Confirmed
4 Medium Incorrect address encoding in the function _calculateMessageHash() Fixed
5 Medium Potential DoS in the function depositWithPermit() Fixed
6 Medium Inconsistent use of the bridge precompile address Fixed
7 Low Potential DoS due to the improper deposit accounting in the contract TokenBridge Confirmed
8 Low Potential delay of verifier update due to missing duplicate check Fixed
9 Low Unbounded signature input may lead to excessive gas consumption Fixed
10 Low Inconsistent failure handling in the function executeMessage() Fixed
11 - Add checks in the function validate_verifier_set_addresses() Fixed
12 - Ensure consistent governance payload checks between Hub and Spoke Fixed
13 - Add destination checks in the function handle_receive_message() Fixed
14 - Add overflow protection when casting tx_index Fixed
15 - Add chain ID checks for source_chain_id in the function handle_receive_message() Fixed
16 - Add non-zero checks for the variable tokenId in the route configuration Fixed
17 - Add minimum value checks in the function setChallengerPeriod() Fixed
18 - Implement emergency withdrawal in TokenBridge to prevent accidental transfers Confirmed
19 - Revise the custom error InvalidSignature Fixed
20 - Remove redundant sorting in function handle_list_verifiers() Fixed
21 - Remove redundant code Fixed
22 - Ensure the same verifier set is shared across all Spoke chains -
23 - Proper handling for USDT on Tron -
24 - Proper aggregation logic for relayer signatures -
25 - Proper Cross-Spoke liquidity management -
26 - Potential centralization risks -
27 - Out of scope dependencies and external logic -
28 - Ensure proper setup in production -

更多細節見審計報告

邁出走向安全的第一步

立即聯絡我們,獲取 BlockSec 的專業程式碼審計服務,在協議上線之前把安全性提上來!