hyperledger-solang / solang

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

Verify magic number in fallback #1519

Closed LucasSte closed 1 year ago

LucasSte commented 1 year 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 1 year 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