Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot execute SignMessageLib.signMessage assembled from tx builder #3406

Closed
chiefbiiko opened this issue Mar 7, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@chiefbiiko
Copy link

Bug description

Environment

  • Browser: Chromium
  • Wallet: MetaMask
  • Chain: Gnosis Chain

Steps to reproduce

  1. Go to the tx builder and assemble a tx with:
    • address 0xd53cd0aB83D845Ac265BE939c57F53AD838012c9
    • function signMessage
    • message 0x68616c6c6f63
  2. Confirm the tx with $threshold signers
  3. Try execute the tx (will fail)

Expected result

Executing a SignMessageLib.signMessage tx built from the tx builder ui should work.

For SignMessageLib.signMessage the tx builder should always use operation delegatecall instead of call. The latter will always fail as the library function is referring to Safe contract storage that is only available when executing the tx via delegatecall.

Obtained result

The tx builder wrongfully sets operation call for SignMessageLib.signMessage invocations and there is no ui input to manually change it to delegatecall.

Screenshots

Shows operation call wrongfully set for SignMessageLib.signMessage:

safestucksignmsgviaui

@chiefbiiko chiefbiiko added the bug Something isn't working label Mar 7, 2024
@katspaugh
Copy link
Member

In the safe-apps-sdk (and Transaction Builder is using that SDK), we limit delegatecalls to arbitrary contracts on purpose because it entails a massive security risk. We're not looking to change that anytime soon. Delegatecalls to an arbitrary contract can only be performed via our other SDKs like the safe-core-sdk.

See safe-global/safe-apps-sdk#65. Thanks!

@katspaugh katspaugh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2024
@chiefbiiko
Copy link
Author

@katspaugh Please reconsider the case where Safe signers want to perform a multisig message "signature" via the SignMessageLib, always deployed at 0xd53cd0aB83D845Ac265BE939c57F53AD838012c9. I'm only asking to correct the operation to delegatecall for this particular static and known address.

For SignMessageLib.signMessage(msg) delegatecall must be used as the target contract is a library with the method referring to Safe storage (tx builder setting the call operation makes the tx unexecutable) AND that delegatecall is absolutely safe to use since we are calling into Safe's official SignMessageLib - this is not an arbitrary contract.

In the current state, regular (no-code) users are not able to generate a multisig for a message, this limits the usage of Safe's ERC-1271 signature verification flow and multisig message signing in general.

@katspaugh
Copy link
Member

katspaugh commented Mar 8, 2024

Feel free to raise this with the https://github.com/safe-global/safe-apps-sdk team. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants