Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 3.55 KB

0x205-C5-Bridge.md

File metadata and controls

50 lines (41 loc) · 3.55 KB

C5: Bridge

Control Objective

If a project contains a Bridge smart contract, it is necessary to follow the standard and create a secure contract based on it. Learn from past mistakes that have been identified and have solutions ready.

Ensure that a verified contract satisfies the following high-level requirements:

  • Contract follows a tested and stable Bridge standard,
  • It is impossible to abuse the signature verification logic,
  • Potential threats related to bridges are taken into consideration.

Category “C5” lists requirements related to the Bridge smart contract as one of the project components.

Security Verification Requirements

# Description
C5.1 Verify that bridge requires all necessary values to be included in the message and signed: chain ids, receiver, amount, nonce.
C5.2 Verify that used signatures are invalidated to protect the bridge from replay attacks.
C5.3 Verify that the message hash generation algorithm is resistant to collision attacks.
C5.4 Verify that bridge includes source and destination chain identifiers in the signed message and correctly verifies them.
C5.5 Verify that bridge does not allow spoofing chain identifiers.
C5.6 Verify that bridge uses a nonce parameter to prevent the same operation (the same sender, receiver, and amount) to be executed multiple times.
C5.7 Verify that signed message cannot be used in a different context (use domain separator from EIP-712).
C5.8 Verify that the case of 0 being returned by ecrecover function is handled securely.
C5.9 Verify that privileged contracts are separated from cross-chain relay calls. Attacker should not be able to cross-call the privileged contract.
C5.11 Verify each supported blockchain's finality is taken into account when settling relay calls.
C5.12 Verify that bridge disregards calls originating from different function than designed.
C5.13 Verify that bridge requires adequate amount of fees to process the message.
C5.14 Verify that the maximum gas consumption for relayed messages is limited or fully backed by sender (e.g., in terms of fee).

References

For more information, see also:

Smart contract audit

Request an audit of your project by SCSVS authors. Contact a specialist.