Skip to content

Memo Mutability With Soroban Auth Signatures

Low
xiv published GHSA-3p8h-7v82-ffvq Jan 29, 2025

Package

Stellar-Core (C++)

Affected versions

< 22.0.0

Patched versions

22.0.0

Description

Impact

Exchanges on the Stellar network often “multiplex” their accounts, resulting in, effectively, different accounts under the exchange umbrella that don’t have individual account representations on the blockchain. Exchanges have taken to using the memo field as a way of tagging specific movements of tokens to specific accounts.

With the introduction of the Soroban smart contract platform last year, so-called “C” custom account addresses were introduced. Custom accounts have custom authorization implementations backed by a smart contract. Authorization for the transactions is provided by a SorobanAuthorizationEntry (SorobanAuth) object (see CAP 46-11 here).

When a SorobanAuth object is created, information about the smart contract interaction (e.g. destination and token transfer amount) is hashed and then signed. This ensures that the details of the interaction are not changeable. However, the memo field is not part of the hashing done for the authorization process as there can be many Soroban calls in one transaction (and there is only one memo per transaction).

When a SorobanAuth object is created, it is an “authorization to operate” during the lifetime of that transaction. However, there is nothing that ties the authorization to the specific transaction it was originally intended for. Thus, a malicious attacker could front-run a transaction, take the signed SorobanAuth object, and put it into a different transaction with a different destination memo. This vulnerability creates the opportunity to maliciously “front-run” a transaction. For example:

  • A user owns a 'deposit' exchange account that is a pair (G$EXCHANGE_ACCOUNT, 123) (123 is memo)
  • Custom account signs a soroban auth payload to transfer 1 XLM from its balance to account G$EXCHANGE_ACCOUNT
  • Then owner of the account creates a transaction with memo 123 and attaches the signed auth from the previous step to it
  • The attacker takes the soroban auth entry, creates their own transaction with memo 456 and front-runs the original transaction.
  • In case if front-running is successful, the transfer is deposited to (G$EXCHANGE_ACCOUNT, 456)

When this was first identified, Stellar Development Foundation took immediate action to review and assess the impact of this vulnerability. During the time of this vulnerability being active, there were very few transactions which had both “Soroban Auth” objects and memo fields in use. Of those, none were multiplexing activities. Thus, during the time this vulnerability was present, it was not exploited.

Due to the High complexity of the attack and very focused impact, this severity is Low.

Patches

To quickly mitigate this vulnerability, a change was introduced in Protocol 22 (release 22.0.0) which prevented acceptance and processing of transactions for which both of the following conditions are true:

  • The transaction contains a memo and/or muxed source account
  • The transaction contains a Soroban authorization entry with Address credentials

While this change does mitigate the vulnerability, it prevents some valid potential use-cases in the future, such as smart-contract wallets wanting to issue transactions with memos.

It is important to note that transactions with memos that use only SOURCE_ACCOUNT credentials are not affected. Indeed, 99+% of Soroban transactions with non-blank memo fields on-chain fall into this last category and are unaffected by the mitigation.

References

Safely enabling memos with Soroban authorization entries is an important advancement for Stellar. SDF would like to open discussion up to the community for how this can best be accomplished. CAP-64 represents the current thinking for this remediation.

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

CVE ID

No known CVE

Weaknesses

No CWEs

Credits