Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line number is not correct when vulnerability occurs in helper routine #27

Open
kaisert opened this issue Oct 4, 2018 · 1 comment
Open
Labels
Enhancement New feature or request wontfix This will not be worked on

Comments

@kaisert
Copy link

kaisert commented Oct 4, 2018

For some operations helper routines are added to the binary during compilation. In the source mapping these instructions reference the whole contract. Therefore if some vulnerability is detected in these helper routines, the line number of the contract definition is returned by securify.

To counteract, either helper routines should be detected during the analysis and jump instructions to them returned as the vulnerable instruction or another mechanism to track the vulnerability back to the actual line of code should be implemented.

Example contract:

contract c {
    int[] a;
    function f() public {
        a.length = 1;
    } 
}

More information:
ethereum/solidity#5135

@hiqua
Copy link
Contributor

hiqua commented Oct 4, 2018

I'm not sure about how many such examples there are, but I suspect there are not that many, in which case it could be enough to document them all. In any case I'm wary of working around the Solidity compiler, it'd be better to solve problems there directly rather than in Securify (in this case, it'd be better to improve the mappings returned by solc).

@hiqua hiqua added Enhancement New feature or request Some Day This issue may be worked on some day in the distant future labels Oct 4, 2018
@hiqua hiqua added wontfix This will not be worked on and removed Some Day This issue may be worked on some day in the distant future labels Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants