Skip to content

send_path_payment never validates the path parameter, leaving StellarSendError::InvalidPath dead code #6

Description

@abayomicornelius

stellar_send/src/error.rs defines InvalidPath ("The payment path provided is empty or malformed") but stellar_send/src/lib.rs's send_path_payment never returns it — the path: Vec<Address> argument is only ever appended to full_path with no checks for duplicate hops, hops equal to send_token/dest_token, or a maximum path length.

Since Soroban has resource/instruction limits, an unbounded or malicious path could cause excessive gas usage or unexpected behavior once real DEX routing (see related issue on 1:1 simulation) is implemented. Add validation that rejects empty/duplicate/oversized paths and returns InvalidPath accordingly, with matching test coverage in stellar_send/src/test.rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontractsSmart contract logictestingTest coverage related

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions