CodeQL documentation

Enabling Electron allowRunningInsecureContent

ID: js/enabling-electron-insecure-content
Kind: problem
Security severity: 8.8
Severity: error
Precision: very-high
Tags:
   - security
   - frameworks/electron
   - external/cwe/cwe-494
Query suites:
   - javascript-code-scanning.qls
   - javascript-security-extended.qls
   - javascript-security-and-quality.qls

Click to see the query in the CodeQL repository

Electron is secure by default through a policy banning the execution of content loaded over HTTP. Setting the allowRunningInsecureContent property of a webPreferences object to true will disable this policy.

Enabling the execution of insecure content is strongly discouraged.

Recommendation

Do not enable the allowRunningInsecureContent property.

Example

The following example shows allowRunningInsecureContent being enabled.

const mainWindow = new BrowserWindow({
  webPreferences: {
    allowRunningInsecureContent: true
  }
})

This is problematic, since it allows the execution of code from an untrusted origin.

References

  • © GitHub, Inc.
  • Terms
  • Privacy
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy