You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transaction script contains malformed contract manifest (all methods offsets are set to be 22, while the contract script lenght is 22). Here's the contract manifest:
Expected behavior
Although VM is able to properly handle the out-of-bounds method offset, it would be better not to allow deploying of such corrupted contracts.
Platform:
Version: neo v3.3.0
(Optional) Additional context
The issue was discovered due to T5 statediff, neo-go node didn't allow to deploy such corrupted contract, see the nspcc-dev/neo-go@d1899a4.
The text was updated successfully, but these errors were encountered:
Describe the bug
It is allowed to deploy contract with method offset that is out of the contract script bounds. Here's the Management's check:
neo/src/neo/SmartContract/Native/ContractManagement.cs
Line 180 in 736c346
Helper
tries to retrieve instruction by the specified offset for each method:neo/src/neo/SmartContract/Helper.cs
Line 82 in 736c346
RET
is returned and no exception occurs: https://github.com/neo-project/neo-vm/blob/a65487fa56be3eccb2c1dbfec5dcdd71b8a05fde/src/Neo.VM/Script.cs#L146. Thus, the contract script check is passed.To Reproduce
Block 125000 of current T5 contains the following deploying transaction:
Transaction script contains malformed contract manifest (all methods offsets are set to be 22, while the contract script lenght is 22). Here's the contract manifest:
And here's the contract script itself:
Expected behavior
Although VM is able to properly handle the out-of-bounds method offset, it would be better not to allow deploying of such corrupted contracts.
Platform:
(Optional) Additional context
The issue was discovered due to T5 statediff, neo-go node didn't allow to deploy such corrupted contract, see the nspcc-dev/neo-go@d1899a4.
The text was updated successfully, but these errors were encountered: