Skip to content

Origin validation error

Description

Disabling webSecurity will disable the same-origin policy and allows the execution of insecure code from any domain.

Examples

Insecure Code

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

Secure Code

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

Remediation

Enable webSecurity in BrowserWindow options to enforce the same-origin policy and prevent insecure code execution.

Rule Details

FieldValue
IDCODE-0370
CategoryWeb
SeverityCRITICAL
CWECWE-346
ConfidenceHIGH
ImpactHIGH
LikelihoodHIGH
ExploitabilityEASY
Tagssame-origin policy, web security
OWASPA6:2017-Security Misconfiguration, A05:2021-Security Misconfiguration