DeepBrainChain

CertiKFiles named in the report

CertiK reviewed DeepBrain Chain (DeepBrainChain) on 30 Dec 2024: 10 findings, 1 critical; 7 marked fixed, 1 acknowledged, 2 open.

1 critical finding, fixed
Open the reportOpen DeepBrain Chain’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings10

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical001
High010
Medium000
Low206
CriticalPotential Attack via Delegatecall to Bridge PrecoFixed

In the provided precompile (Bridge<T>), the code uses ```rust let from = T::AddressMapping::into_account_id(context.caller); ``` to determine the source of funds. However, there is no check to distinguish whether the incoming call arrived through a normal EVM call or via a `delegatecall`. As a result, if a malicious contract uses `delegatecall`, the precompile may see an unintended contract (e.g., a Uniswap Pair contract that actually holds funds) as `context.caller`. This allows an attacker to impersonate the legitimate caller and transfer tokens belonging to the victim contract to an arbitrary address. **Root Cause** - The precompiled contract relies solely on context.caller (the EVM-level “sender”) to identify who owns the tokens. - There is no additional logic to confirm whether the call came directly from the rightful owner/contract or via a delegatecall from a malicious contract. - Consequently, any contract with a callback can be coerced (through delegatecall) into appearing as the “sender” in the precompile, enabling impersonation of other contracts’ balances. **Impact** - Attackers can steal tokens from third-party that hold substantial funds (e.g., DEX) or phishing the EOAs who holds the tokens. - Any contract that accepts callbacks (e.g., flash loan hooks, swap hooks) could become a target if it holds or can access valuable tokens. Reference: - https://medium.com/immunefi/moonbeam-missing-call-check-bugfix-review-6279d609bdc5

LowIncorrect Condition CheckFixed

In the `bridge.rs` contract, the `execute` function ensures that the input length is at least `4` by using the following check: ```rust ensure!( input.len() >= 4, PrecompileFailure::Revert { exit_status: ExitRevert::Reverted, output: "invalid input".into(), } ); ``` However, if the input length is exactly `4`, the following code snippet will revert because the fifth element of `input` does not exist: ```rust let param = ethabi::decode( &[ethabi::ParamType::String, ethabi::ParamType::Uint(256)], &input[4..], ) .map_err(|e| PrecompileFailure::Revert { exit_status: ExitRevert::Reverted, output: format!("decode param failed: {:?}", e).into(), })?; ```

LowMissing Zero Address ValidationFixed

The cited address input is missing a check that it is not `address(0)`.

LowPossible Loss Of the Data Due to Indexed DynamicFixed

When attempting to index dynamic data types like `string`, `bytes`, `array`, or `struct` in Solidity, they don't get stored in their original form. Instead, the Ethereum log system stores the `Keccak-256` hash of these data types. While this approach ensures efficiency and cost-effectiveness, developers must be aware of it to correctly use and interpret logs, and they cannot retrieve the original string from its hash alone.

LowUnprotected Upgradeable ContractFixed

The `Logic` contract does not protect the initializer. An attacker can front-run the `initialize` call and assume ownership of the logic contract. Once in control, the attacker can perform privileged operations, misleading users into believing that they are interacting with the legitimate owner of the upgradeable contract.

LowUnused Contract AddressFixed

The given contract address has not been used in the contract `Logic` and this precompile contract is not registered in the DeepBrainChain as well: ```rust address private constant projectRegisterPrecompile = address(0x0000000000000000000000000000000000000802); ```

LowUnused Owner Role In ContractFixed

The current contract in question inherits from the `OwnableUpgradeable` contract, which is a standard smart contract module providing basic authorization control. Despite inheriting from `Ownable`, the current contract does not appear to leverage any of the owner-exclusive functions. The absence of owner-specific functionality suggests that the contract may not actually require the ownership mechanism provided by the `Ownable` module.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (2)

  • system/contracts/bridge/Bridge.sol
  • system/contracts/logic/Logic.sol

Part of DeepBrain Chain’s security record

DeepBrain Chain
Audits1 audit by 1 firmLast audit Dec 2024, by CertiK.
Critical findingsNo open critical findingsIn that report, 1 critical finding was reported. It is marked fixed by the firm that reported it.
Open DeepBrain Chain’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us