A program upgrade buffer can be rewritten until its authority is the multisig
An approved upgrade names a buffer account. If someone else still controls that buffer at vote time, its contents can change before execution.
Why this is a risk, not a vulnerability · Social engineering
- Program
- Squads V3
- Source
- Public program behavior
- Code
- View at c95b767
A V3 multisig manages a program by holding its upgrade authority under one of its authority PDAs, as the repository README describes. An upgrade is an ordinary transaction whose stored instruction calls the upgradeable loader with a buffer account. The program stores the buffer’s address, not its contents.
The loader only requires that the buffer’s authority equal the program’s upgrade authority when the upgrade executes. A buffer whose authority is still the developer’s wallet at vote time can be rewritten, and then handed to the multisig’s authority, after members approve, so different code is deployed than the code they reviewed.
The program manager in the same repository is a separate program. Its upgrade records describe an upgrade for display; they do not control what the multisig executes.
What to do
- Inspect the transaction itself before approving or executing it, not its description or any auxiliary record.
- Before approving an upgrade, confirm the buffer’s authority is already the multisig’s authority PDA, and verify the buffer’s contents against a reproducible build.
- Re-check the buffer immediately before executing.
- Integrators: show the buffer authority and a hash of the buffer contents on every upgrade transaction, and warn if the authority is anything other than the executing authority.