mirror of https://github.com/embarklabs/embark.git
74e2935846
The profiler was not formatted correctly in the console as `util.inspect` was being applied to the ASCII table before being output to the console REPL. In addition, functions containing solidity assertions (require, revert, assert) that cause the function to fail when estimating gas would print an error to embark’s console log, and would show nothing as their gas estimate in the table. Do not `util.inspect` command output if the result is a string. For API commands being run, allow the command to specify whether or not the output of the command should be HTML escaped. This could pose security risks! For functions that have errors during gas estimation, add a message in the embark console explaining that the error may be due to solidity assertions in the function that prevent the gas from being estimated correctly. For functions that error, show `-ERROR-` in the gas estimation column. Additionally, show a description in the table footer explaining that the error may be due to solidity assertions in the function. For events with no gas estimate, show `-EVENT-` in the gas estimate column of the profile table, and a description in the table footer explaining that there is no gas estimate for events. ### Warnings This PR allows the console command to specify whether or not it should allow for a string result of the command to be HTML-escaped before being sent in the API response. Combining this with Cockpit’s `dangerouslySetInnerHTML`, this could allow a plugin to register a console command that injects XSS in to Cockpit. ![Imgur](https://i.imgur.com/1Rqkjyx.png) ![Imgur](https://i.imgur.com/s6Y1Ecy.png) ![Imgur](https://i.imgur.com/BhsjkBs.png) |
||
---|---|---|
.. | ||
code-runner | ||
console | ||
core | ||
engine | ||
i18n | ||
logger | ||
reset | ||
utils |