Relay Escrow Report

Security Assessment Report

Relay Escrow

June-2025

Prepared for Relay Protocol


Project Summary

Project Scope

Project Name Repository(link) Initial Commit Hash Platform
Relay Escrow Github Repository 91b182a Solana

Project Overview

This document describes the verification of Relay Escrow code using manual code review. The work was undertaken from June 6 to June 13, 2025.

The following contracts are considered in scope for this review:

During the audit, Certora discovered bugs in the Solana programs, as listed on the following page.

Protocol Overview

The Relay Escrow is a system that enables secure fund transfers and swaps using off-chain authorization. Users interact with the forwarder program responsible for transferring assets from the user account to the escrow program which, in turn, stores them in a dedicated vault account. The funds remain safe in the vault until an authorized party signs a message that allows the trade to be finalized and the promised assets to be sent to the legitimate recipient. This design adds a layer of security where outgoing financial flows are governed by the program logic and a trusted signer.


Findings Summary

The table below summarizes the findings of the review, including type and severity details.

Severity Discovered Confirmed Fixed
Critical 2 2 2
High 1 1 1
Medium 2 2 2
Low 2 2 2
Informational 2 2 2
Total 9 9 9

Detailed Findings

ID Title Severity Status
C-01 Anyone can initialize the relay escrow and become the owner/allocator Critical Fixed
C-02 Transfer recipient can be changed to arbitrary address, allowing complete escrow drainage Critical Fixed
H-01 Signer account is mistakenly treated as the forwarder account, leading to user drainage and broken logic High Fixed
M-01 Contract fails to support Token2022 tokens, limiting compatibility with modern SPL tokens Medium Fixed
M-02 Depositors can specify arbitrary vault token account, enabling fake deposits that bypass actual escrow Medium Fixed
L-01 Token account rent is susceptible to be stolen Low Fixed
L-02 Vault account automatic closure prevents token transfer operations Low Fixed

Critical Severity Issues

C-01 Anyone can initialize the relay escrow and become owner/allocator

Severity: Critical Impact: High Likelihood: High
Files: relay-escrow/src/lib.rs#L32-L38 Status: Fixed

C-02 Transfer recipient can be changed to arbitrary address, allowing complete escrow drainage

Severity: Critical Impact: High Likelihood: High
Files: relay-escrow/src/lib.rs#L163 Status: Fixed

High Severity Issues

H-01 Signer account is mistakenly treated as forwarder account, leading to user drainage and broken logic

Severity: High Impact: High Likelihood: High
Files: relay-forwarder/src/lib.rs#L16-L26 Status: Fixed

Medium Severity Issues

M-01 Contract fails to support Token2022 tokens, limiting compatibility with modern SPL tokens

Severity: Medium Impact: Medium Likelihood: Medium
Files: relay-escrow/src/lib.rs#L325 Status: Fixed

M-02 Depositors can specify arbitrary vault token account, enabling fake deposits that bypass actual escrow

Severity: Medium Impact: Medium Likelihood: Medium
Files: relay-escrow/src/lib.rs#L316 Status: Fixed

Low Severity Issues

L-01 Token account rent is susceptible to be stolen

Severity: Low Impact: Low Likelihood: Low
Files: relay-forwarder/src/lib.rs#L52-L62 Status: Fixed

L-02 Vault account automatic closure prevents token transfer operations

Severity: Low Impact: Low Likelihood: Low
Files: relay-escrow/lib.rs Status: Fixed

Informational Issues

I-01. Hard-coded account space calculation in relayEscrow initialization
Description: The accounts initialization uses a manually calculated space allocation instead of Anchor's built-in INIT_SPACE constant.
Recommendations: Replace the manual space calculation with Anchor's INIT_SPACE constant to ensure automatic synchronization between struct definition and space allocation.

I-02. Missing PDA constraints for RelayEscrow account validation
Description: The SetAllocator and ExecuteTransfer account structs do not enforce proper Program Derived Address (PDA) constraints on the relay_escrow account.
Recommendations: Set the corresponding PDA constraints for the relay_escrow account in the SetAllocator and ExecuteTransfer account structs.

Disclaimer

Even though we hope this information is helpful, we provide no warranty of any kind, explicit or implied. The contents of this report should not be construed as a complete guarantee that the contract is secure in all dimensions. In no event shall Certora or any of its employees be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the results reported here.

About Certora

Certora is a Web3 security company that provides industry-leading formal verification tools and smart contract audits. Certora’s flagship security product, Certora Prover, is a unique SaaS product that automatically locates even the most rare & hard-to-find bugs on your smart contracts or mathematically proves their absence. The Certora Prover plugs into your standard deployment pipeline. It is helpful for smart contract developers and security researchers during auditing and bug bounties. Certora also provides services such as auditing, formal verification projects, and incident response.