pNetwork - Audit 2

CertiKCode version: not recorded (see the report)

CertiK reviewed pNetwork (pNetwork - Audit 2) on 16 Dec 2022: 12 findings, 0 critical; 5 marked fixed, 1 acknowledged, 6 open.

No open critical findings
Open the reportOpen pNetwork’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings12

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

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium011
Low604
LowIncomplete `Rinkeby` implementation in `validate_Open

The block hash validation for `Rinkeby` is skipped in `validate_block_in_state`. ```rust if chain_id == EthChainId::Rinkeby { // FIXME/TODO Add in rinkeby block validation! info!("✔ Skipping Rinkeby ETH block header validaton!"); Ok(state) } else { ... } ``` The block will not be validated when a `Rinkeby` block is used as input.

LowMissing Feature Flag For Debug FunctionOpen

Based on the linked comment, the function initiated with `debug_` should only be used in debug mode.

LowPotential Loss of Asset on AlgorandOpen

According to the [Algorand developing manual](https://developer.algorand.org/docs/get-details/asa/#receiving-an-asset), in order to receive the corresponding asset on Algorand, the address needs to opt-in to receive it. Therefore, when performing a cross bridge transaction, if the receiver address does not opt-in to receive the corresponding pToken, the transfer invocation will revert, thus causing potential unexpected loss.

LowPotential Private key leaks in source codeOpen

There are multiple private keys leaked in the source code via the test section. For instance, in the file `submit_int_block.rs`, the private key of the address N4F4VB7GYZWL2RRTMQVMBKM5GKTKDTOHVB5PHGQYFB6XSXR3MRYIVOPTWE can be found. At the time of writing the report, there is `0.99 ALGO` in this address. The PoC below shows how the address was retrieved from the private key and how the balance of the address was retrieved. \ The real private key is not shown for security reasons. ```python #pip3 install bip_utils import binascii, requests, json from time import sleep from bip_utils import Bip44, Bip44Coins, Bip44Changes def getAddressFromPK(priv_key_bytes): bip44_key = Bip44.FromPrivateKey(priv_key_bytes, Bip44Coins.ALGORAND) address=bip44_key.PublicKey().ToAddress() return address def getAlgoBalance(address): pattern1="https://indexer.algoexplorerapi.io/v2/accounts/" pattern2="?include-all=false&apps-local-state-limit=50&assets-limit=50&exclude=created-apps,created-assets" url=pattern1 + address + pattern2 reponse=requests.get(url) jsonResponse=json.loads(reponse.text) balance=str(jsonResponse['account']['amount'] / 10**6) return balance array=[ ["ALGO_N4F4", binascii.unhexlify(b"abc123...")], ["...","..."], ] for item in array: try: address=getAddressFromPK(item[1]) print("Balance of " + str(item[0]) + " : " + str(getAlgoBalance(address))) except: print("Request failed for address " + str(address)) ``` ```text $ python3 test.py Balance of ALGO_N4F4 : 0.993001 ```

LowRisk For Weak RandomnessOpen

Currently, the program generates private keys while initializing the Algo core or INT core via the following random functions: - For `maybe_initialize_algo_core`: ```rust pub fn create_random() -> Self { Self(Keypair::generate(&mut OsRng {})) } ``` - For `maybe_initialize_int_core`: ```rust fn get_x_random_bytes(num_bytes: usize) -> Vec<u8> { let mut bytes = vec![0u8; num_bytes]; thread_rng().fill_bytes(&mut bytes); bytes } ``` Both methods use randomness from the system, which may allow attackers to reduce the search space of potential random seeds and cause a brute-force attack against private keys.

LowThe output of `submit_algo_block_to_core()` and `Open

After invoking `submit_algo_block_to_core()` and `submit_int_block_to_core()` to submit and verify Algorand / Ethereum block, it will generate an output, which is a signed message that can be used as proof to retrieve asset from the other chain. Considering the database only maintains a small piece of chain, and the result of the output is not preserved, it could lead to the loss of the output result. Therefore, if the output is mistakenly and improperly handled since there is no copy of the output within the pNetwork core, it could cause the asset to be unretrievable on the other side of the chain.

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.

Part of pNetwork’s security record

pNetwork
Audits2 audits by 1 firmLast audit Jan 2023, by CertiK.
Critical findingsNo open critical findingsAcross 2 reports.
IncidentIncident 18 Sep 2021Source: De.Fi incident database.
Open pNetwork’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 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