muellerberndt / sabre

Security analyzer for Solidity smart contracts. Uses the MythX smart contract security service.
https://mythx.io
MIT License
59 stars 23 forks source link

TypeError: Cannot read property 'source' of undefined #34

Closed muellerberndt closed 5 years ago

muellerberndt commented 5 years ago

Description

When passing the absolute path of an input file to Sabre, the analysis fails with the "TypeError: Cannot read property 'source' of undefined".

For example with MythX Playground:

$ sabre /Users/bernhardmueller/Projects/mythx-playground/exercise5/token-with-backdoor.sol 
TypeError: Cannot read property 'source' of undefined

The same works when running analysis from the same directory:

$ cd exercise5
$  sabre token-with-backdoor.sol 
[=== ] Analyzing Token
$ sabre token-with-backdoor.sol 
token-with-backdoor.sol
  15:8  warning  integer overflow  https://smartcontractsecurity.github.io/SWC-registry/docs/SWC-101
   1:0  warning  No pragma is set  https://smartcontractsecurity.github.io/SWC-registry/docs/SWC-103

✖ 2 problems (0 errors, 2 warnings)

Expected behavior

Should work in both situations.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.3 ETH (42.42 USD @ $141.4/ETH) attached to it as part of the MythX fund.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 1 year, 11 months ago. Please review their action plans below:

1) pumpkingwok has been approved to start work.

Hi there, I can look in it without problems if this issue is still free. Thanks in advance

Learn more on the Gitcoin Issue Details page.

muellerberndt commented 5 years ago

Hey @pumpkingwok, how's the progress?

gitcoinbot commented 5 years ago

⚡️ A tip worth 0.30000 ETH (42.76 USD @ $142.54/ETH) has been granted to @eswarasai for this issue from @b-mueller. ⚡️

Nice work @eswarasai! Your tip has automatically been deposited in the ETH address we have on file.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This Bounty has been completed.

Additional Tips for this Bounty:


gitcoinbot commented 5 years ago

⚡️ A tip worth 0.25000 ETH (35.64 USD @ $142.54/ETH) has been granted to @pumpkingwok for this issue from @b-mueller. ⚡️

Nice work @pumpkingwok! Your tip has automatically been deposited in the ETH address we have on file.

gitcoinbot commented 5 years ago
Blockbuster ⚡️ A *Blockbuster* Kudos has been sent to @pumpkingwok for this issue from @b-mueller. ⚡️ Nice work @pumpkingwok! Your Kudos has automatically been sent in the ETH address we have on file.
muellerberndt commented 5 years ago

@eswarasai I'm re-opening the issue because we're now encountering the same error in the Truffle Metacoin project:

$ sabre contracts/MetaCoin.sol 
TypeError: Cannot read property 'source' of undefined
muellerberndt commented 5 years ago

I'm still getting the same error on another example:

https://github.com/ConsenSys/mythx-playground/blob/master/exercise2/contracts/Tokensale.sol

$ sabre Tokensale.sol 
TypeError: Cannot read property 'source' of undefined
PumpkingWok commented 5 years ago

There is absolutely no power without control !!!