hyperledger / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.25k stars 208 forks source link

Verify magic number in fallback #1519

Closed LucasSte closed 11 months ago

LucasSte commented 12 months ago

Presently, we do not check the magic number when we enter a fallback function. If it modifies or read the data account, a malefactor can forge an account so that the function would read or write malicious data. This PR fixes such an issue.

LucasSte commented 11 months ago

Solidity also has receive, is this already done properly there?

receive is not permitted on Solana: https://solang.readthedocs.io/en/v0.3.2/targets/solana.html#receive-function