Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Integer overflow risks, update Solidity version pragma to 0.8.x #78

Open
Tracked by #80
shazow opened this issue Mar 31, 2022 · 3 comments
Open
Tracked by #80

Integer overflow risks, update Solidity version pragma to 0.8.x #78

shazow opened this issue Mar 31, 2022 · 3 comments
Labels
security Welcome to the danger zone

Comments

@shazow
Copy link
Contributor

shazow commented Mar 31, 2022

The Challenge.sol contract uses uint256 without overflow checks, and there is some arithmetic in places that would benefit from overflow checks.

Updating the pragma to 0.8.x would include built-in solc overflow checks, easy fix that's worth doing.

@norswap norswap added the bug Something isn't working label Apr 1, 2022
@norswap
Copy link
Contributor

norswap commented Apr 1, 2022

Thanks for the issue 🙏
We will definitely do this.

@protolambda
Copy link
Contributor

We will soon be looking at an upgrade to the latest solidity version. But note that some overflows are a feature, not a bug, to emulate uint32 behavior of registers, where overflows are expected to happen. We'll need to be careful with introducing safe-math-by-default behavior of 0.8.x to not break expected MIPS behavior.

@protolambda protolambda added security Welcome to the danger zone and removed bug Something isn't working labels May 1, 2023
@shazow
Copy link
Contributor Author

shazow commented May 1, 2023

IIRC the specific overflow issue was in the challenge game (maybe something about being able to wrap around the binary search cursor?).

Could make sense to disable overflow protections in the VM implementation as needed, while still have it in the higher-level contracts.

But yea, worth considering these choices carefully when the time comes. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
security Welcome to the danger zone
Projects
None yet
Development

No branches or pull requests

3 participants