Consensys / truffle-security

MythX smart contract security verification plugin for Truffle Framework
https://mythx.io
124 stars 28 forks source link

FInd and fix what is problably a bug in JWT refresh #109

Closed rocky closed 5 years ago

rocky commented 5 years ago

When running against aragonOS for the first time (no caching) we seem to get conscutive errors that are probably associated with the way truffle-security handles refresh. track down and fix.

For example a recent run gave:

            DepositableStorage |**     | 31% || Elapsed: 93.3s ✗ error
                  ENSConstants |**     | 30% || Elapsed: 92.3s ✗ error
         ENSSubdomainRegistrar |**     | 31% || Elapsed: 92.5s ✗ error
rocky commented 5 years ago

An expanded version of the error is:


KernelOverloadMock: Body {
  url:
   'https://staging.api.mythx.io/v1/analyses/2f03833d-bc78-48dc-b0d1-fff89566c79d',
  status: 401,
  statusText: 'Unauthorized',
  headers:
   Headers {
     _headers:
      { date: [Array],
        'content-type': [Array],
        'content-length': [Array],
        connection: [Array],
        'x-dns-prefetch-control': [Array],
        'x-frame-options': [Array],
        'strict-transport-security': [Array],
        'x-download-options': [Array],
        'x-content-type-options': [Array],
        'x-xss-protection': [Array],
        'access-control-allow-origin': [Array],
        etag: [Array] } },
  ok: false,
  body:
   PassThrough {
     _readableState:
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: BufferList { head: [Object], tail: [Object], length: 1 },
        length: 40,
        pipes: null,
        pipesCount: 0,
        flowing: null,
        ended: true,
        endEmitted: false,
        reading: false,
        sync: false,
        needReadable: false,
        emittedReadable: true,
        readableListening: false,
        resumeScheduled: false,
        emitClose: true,
        destroyed: false,
        defaultEncoding: 'utf8',
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: true,
     _events: { prefinish: [Function: prefinish] },
     _eventsCount: 1,
     _maxListeners: undefined,
     _writableState:
      WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: false,
        needDrain: false,
        ending: true,
        ended: true,
        finished: true,
        destroyed: false,
        decodeStrings: true,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        bufferedRequest: null,
        lastBufferedRequest: null,
        pendingcb: 0,
        prefinished: true,
        errorEmitted: false,
        emitClose: true,
        bufferedRequestCount: 0,
        corkedRequestsFree: [Object] },
     writable: false,
     allowHalfOpen: true,
     _transformState:
      { afterTransform: [Function: bound afterTransform],
        needTransform: false,
        transforming: false,
        writecb: null,
        writechunk: null,
        writeencoding: 'buffer' } },
  bodyUsed: false,
  size: 0,
  timeout: 0,
  _raw: [],
  _abort: false }
``
rocky commented 5 years ago

Done in last release.