Skip to content

Commit a4a10e1

Browse files
authored
Create Arbitrary CPI
1 parent 561b5d1 commit a4a10e1

File tree

1 file changed

+10
-0
lines changed
  • not-so-smart-contracts/solana/arbitrary_cpi

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Arbitrary CPI
2+
Solana allows programs to call one another through cross-program invocation (CPI). This can be done via `invoke`, which is responsible for routing the passed in instruction to the program. Whenever an external contract is invoked via CPI, the program must check and verify the program ID. If the program ID isn't verified, then the contract can be called into an attacker-controlled contract instead of the intended one.
3+
4+
View ToB's lint implementation for the arbitrary CPI issue [here](https://github.com/crytic/solana-lints/tree/master/lints/arbitrary_cpi).
5+
6+
## Exploit Scenario
7+
8+
### Example Contract
9+
10+
## Mitigation

0 commit comments

Comments
 (0)