Skip to content

Node Integration Exposure

Description

Node integration exposes node.js APIs to the electron app and this can introduce remote code execution vulnerabilities to the application if the app is vulnerable to Cross Site Scripting (XSS).

Examples

Insecure Code

javascript
new BrowserWindow({webPreferences: {nodeIntegration: true}})

Secure Code

javascript
new BrowserWindow({webPreferences: {nodeIntegration: false}})

Remediation

Set nodeIntegration to false in BrowserWindow webPreferences to prevent exposure of node.js APIs.

Rule Details

FieldValue
IDCODE-0372
CategoryInsecureConfig
SeverityMEDIUM
CWECWE-272
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityMODERATE
TagsNode.js, Electron
OWASPA6:2017-Security Misconfiguration, A05:2021-Security Misconfiguration