CertiK reviewed DeepBrain Chain (DeepBrainChain) on 30 Dec 2024: 10 findings, 1 critical; 7 marked fixed, 1 acknowledged, 2 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 1 |
| High | 0 | 1 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 2 | 0 | 6 |
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
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(), })?; ```
The cited address input is missing a check that it is not `address(0)`.
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.
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.
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); ```
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.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (2)
1,044 projects reviewed · 1,375 reports · latest May 2025
See CertiK’s auditsSomething 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