Electronegativity is finally out!
24 Jan 2019 - Posted by Luca CarettoniWe’re excited to announce the public release of Electronegativity, an opensource tool capable of identifying misconfigurations and security anti-patterns in Electron-based applications.
Electronegativity is the first-of-its-kind tool that can help software developers and security auditors to detect and mitigate potential weaknesses in Electron applications.
If you’re simply interested in trying out Electronegativity, go ahead and install it using NPM:
$ npm install @doyensec/electronegativity -g
To review your application, use the following command:
$ electronegativity -i /path/to/electron/app
Results are displayed in a compact table, with references to application files and our knowledge-base.
The remaining blog post will provide more details on the public release and introduce its current features.
A bit of history
Back in July 2017 at the BlackHat USA Briefings, we presented the first comprehensive study on Electron security where we primarily focused on framework-level vulnerabilities and misconfigurations. As part of our research journey, we also created a checklist of security anti-patterns and must-have features to illustrate misconfigurations and vulnerabilities in Electron-based applications.
With that, me and Claudio Merloni started developing the first prototype for Electronegativity. Immediately after the BlackHat presentation, we received a lot of great feedback and new ideas on how to evolve the tool. Back home, we started working on those improvements until we realized that we had to rethink the overall design. The code repository was made private again and minor refinements were done in between customer projects only.
In the summer of 2018, we hired Doyensec’s first intern - Ibram Marzouk who started working on the tool again. Later, Jaroslav Lobacevski joined the project team and pushed Electronegativity to the finish line. Claudio, Ibram and Jaroslav, thanks for your contributions!
While certainly overdue, we’re happy that we eventually managed to release the tool in better shape. We believe that Electron is here to stay and hopefully Electronegativity will become a useful companion for all Electron developers out there.
How Does It Work?
Electronegativity leverages AST / DOM parsing to look for security-relevant configurations. Checks are standalone files, which makes the tool modular and extensible.
Building a new check is relatively easy too. We support three “families” of checks, so that the tool can analyze all resources within an Electron application:
- JS (using a combination of Esprima, Babel, TypeScript ESTree)
- HTML (using Cheerio)
- JSON (using the native
JSON.parse()
)
When you scan an application, the tool will unpack all resources (if applicable) and perform an audit using all registered checks. Results are displayed in the terminal, CSV file or SARIF format.
Supported Checks
Electronegativity currently implements the following checks. A knowledge-base containing information around risk and auditing strategy has been created for each class of vulnerabilities:
- ALLOWPOPUPS_HTML_CHECK
- AUXCLICK_JS_CHECK
- AUXCLICK_HTML_CHECK
- BLINK_FEATURES_JS_CHECK
- BLINK_FEATURES_HTML_CHECK
- CERTIFICATE_ERROR_EVENT_JS_CHECK
- CERTIFICATE_VERIFY_PROC_JS_CHECK
- CONTEXT_ISOLATION_JS_CHECK
- CUSTOM_ARGUMENTS_JS_CHECK
- DANGEROUS_FUNCTIONS_JS_CHECK
- ELECTRON_VERSION_JSON_CHECK
- EXPERIMENTAL_FEATURES_HTML_CHECK
- EXPERIMENTAL_FEATURES_JS_CHECK
- HTTP_RESOURCES_JS_CHECK
- HTTP_RESOURCES_HTML_CHECK
- INSECURE_CONTENT_HTML_CHECK
- INSECURE_CONTENT_JS_CHECK
- NODE_INTEGRATION_HTML_CHECK
- NODE_INTEGRATION_EVENT_JS_CHECK
- NODE_INTEGRATION_JS_CHECK
- OPEN_EXTERNAL_JS_CHECK
- PERMISSION_REQUEST_HANDLER_JS_CHECK
- PRELOAD_JS_CHECK
- PROTOCOL_HANDLER_JS_CHECK
- SANDBOX_JS_CHECK
- WEB_SECURITY_HTML_CHECK
- WEB_SECURITY_JS_CHECK
Leveraging these 27 checks, Electronegativity is already capable of identifying many vulnerabilities in real-life applications. Going forward, we will keep improving the detection and updating the tool to keep pace with the fast-changing Electron framework. Start using Electronegativity today!