Skip to content
Platforms / 07ASARElectron security audits

Electron.

What your build
gives away.

Your interface and application logic travel in an ASAR archive. JavaScript, source maps, preload bridges and local settings can expose far more than the window on screen. We inspect the complete packaged app.

Get a free first look Explore the build
A desktop application window separated into interface, content and web logic layers.
Build / ASARIllustrated, layer by layer
  • app.asar
  • main.js
  • preload.js
  • .map
  • .node
  • latest.yml

01 / Inside the build

A package.
Many ways in.

Select a layer to see what it contains and which tools can read it.

Inside the package

resources/app.asar

The whole application: main-process JavaScript, renderer HTML/CSS/JS bundles, preload scripts, package.json (entry point, version, dependency list) and bundled node_modules.

Reads as source

Fully readable. ASAR is a simple uncompressed, tar-like archive; `npx @electron/asar list` / `extract` dumps it to plain files. Electron's own docs say it only conceals source 'from cursory inspection'.

Indicative readability. Build settings, obfuscation and access to a running device change the effort.

Tools that can read these layers

@electron/asar (npx @electron/asar) · @electron/fuses · Chrome DevTools / Node inspector · Electronegativity (Doyensec) · sourcemapper

02 / The method

One build.
Six ways to inspect it.

Agents inspect the package, trace its behaviour and collect evidence through six stages. An engineer verifies each finding before it enters your report.

Unpack.

Opens the build and lists every file, format and layer.

Tools used in this stage
  • inspect_artifact
  • extract_artifact
  • inspect_electron_fuses
  • inspect_signature
Illustrative run log
  1. unpack
    inspect_electron_fuses

    ASAR integrity off, RunAsNode on

  2. unpack
    extract_artifact app.asar

    main, preload and renderer, with source maps

  3. read
    recover_javascript_sources

    original file tree and names restored

  4. map
    analyze_javascript_application

    contextIsolation on, 23 IPC handlers

  5. hunt
    trace_javascript_semantics ipcMain

    1 handler runs any path it is sent

  6. hunt
    search_strings "sk_live|secret"

    1 payments key in main.js

  7. run
    capture_electron_scenario

    edited archive loads without complaint

  8. prove
    export_evidence_bundle

    5 findings, ranked, sent to the engineer

8 / 8 eventsEngineer review follows ↗

A written example of the report format. Replay is condensed; the real time budget is agreed before a run and printed on the report.

03 / Exposure areas

What can
escape the build.

The places we look on Electron, the business risk behind them, and the changes that reduce exposure.

Readability alone is not a vulnerability. Impact depends on what the recovered material lets someone do.

01

Full application source readable from app.asar

Everything the app does ships as JavaScript inside an unencrypted archive that one command extracts. Business logic, internal endpoints, feature flags and comments are all visible to anyone holding the installer.

The fix

Treat the bundle as public: move sensitive logic and decisions to the server and strip source maps and debug code from release builds.

CWE-540

02

Secrets and API keys in the bundle

Third-party API keys, service tokens and internal URLs are often baked into renderer or main-process code or a packaged.env file. Once extracted they work from any machine, billed to the vendor.

The fix

Remove long-lived keys from the client, proxy third-party calls through an authenticated backend, issue short-lived per-user tokens, and rotate anything that shipped.

CWE-798

03

Context isolation, sandbox or nodeIntegration misconfigured

If a renderer runs without context isolation or sandboxing, or with Node integration, any script injection in that window can reach Node or preload internals. That turns a plain XSS into code execution on the user's machine, as in the 2020 Discord chain.

The fix

Keep nodeIntegration off and contextIsolation and sandbox on (defaults since Electron 5, 12 and 20) for every window, including legacy ones.

04

Over-broad preload and IPC handlers

Preload scripts sometimes expose raw ipcRenderer or generic 'run this' channels, and main-process handlers act without checking who sent the message. Any compromised or embedded frame can then call privileged functions such as file access or process launch.

The fix

Expose a small set of purpose-built functions via contextBridge, allow-list channels and arguments, and validate event.senderFrame before acting.

05

Unrestricted navigation, new windows and openExternal

If the app does not limit where windows can navigate or what shell.openExternal will open, attacker content can steer a privileged window to a hostile page or launch local handlers. Navigation bypass was one of the three links in the Discord RCE chain.

The fix

Handle will-navigate and setWindowOpenHandler with a strict allow-list and never pass untrusted URLs to shell.openExternal.

06

Fuses left at defaults, no ASAR integrity

By default RunAsNode, NODE_OPTIONS and --inspect are honoured and app.asar is not integrity-checked, so an edited archive runs under the vendor's signed binary. Attackers use this to hide inside trusted, signed apps and evade application control and EDR (Trail of Bits cites the Loki C2 framework and MITRE ATT&CK T1218.015).

The fix

At build time disable RunAsNode, NodeOptions and NodeCliInspect, enable EmbeddedAsarIntegrityValidation together with OnlyLoadAppFromAsar, and keep Electron patched (integrity bypasses CVE-2023-44402 and CVE-2025-55305 were fixed in later releases).

07

Insecure auto-update path

The updater trusts a manifest (latest.yml) and a download; if signature checks fail open or the channel can be intercepted, an attacker can push a malicious 'update'. Doyensec showed in 2020 that electron-updater's Windows signature check could be bypassed this way.

The fix

Serve updates only over TLS from infrastructure you control, sign every artifact, keep electron-updater current, and make verification failures abort the update.

CWE-494

08

Tokens and keys stored in plaintext on disk

Session tokens, cookies and database keys often end up in unencrypted LevelDB, Cookies or config.json files in the user profile. Any process running as the user can copy them and replay the session, as Vectra showed with Microsoft Teams in 2022.

The fix

Encrypt secrets with safeStorage or the OS keychain, enable the cookieEncryption fuse, and keep tokens short-lived and revocable.

CWE-312

09

Licence and paywall checks in client JavaScript

Feature gates like isPro() that read a local flag or validate a key in JS can be found by name and edited in the extracted archive. Without ASAR integrity the patched app keeps running normally.

The fix

Enforce entitlements on the server, deliver premium functionality or data only after a signed server check, and turn on ASAR integrity to stop trivial patching.

CWE-602

04 / Sample findings

From recovered evidence
to a fix you can check.

Explore three illustrative Electron reports. Switch to the re-test to see what the next build changes.

01 / 03

Illustrative example · Electron desktop CRM client with built-in AI assistant

A billable key in the bundle.

The renderer bundle inside app.asar contains a live, unrestricted key for the app's LLM provider plus the URL of an internal admin API. Anyone who extracts the installer can call the paid API on the vendor's account and probe the admin endpoint directly.

Evidence comes first

The full teardown records the recovered artifact, its business impact and a fix for your stack.

Recovered artifactEXAMPLE / 01
// resources/app.asar -> dist/renderer/main.3f9c2a.js (formatted)
const LLM_API_KEY = 'sk-••••91ad';
const ADMIN_BASE = 'https://admin-api.internal.example.com/v2';
export const ai = new Client({ apiKey: LLM_API_KEY });

These fictional examples show the report format. All names, hostnames and credentials are made up. They do not describe real customer work.

05 / On the record

The risk
has a history.

These reports show what other researchers found in released software. Each links to the original source.

  1. 2022

    Authentication tokens kept in readable local storage

    Vectra reported that the Electron-based Teams client stored authentication tokens in local databases and storage files. Its findings highlight the value of inspecting what the installed client leaves on disk.

    Vectra AI, 13 Sep 2022 (opens in a new tab)
  2. 2020

    An isolation failure in a desktop application

    Masato Kinugawa documented a Discord desktop vulnerability chain combining missing context isolation, an injected script and a navigation restriction bypass. The report shows how renderer boundaries can affect the whole application.

    Masato Kinugawa (mksben blog), 17 Oct 2020 (opens in a new tab)

Before the review

Electron
audit questions.

Compare pricing and scope, or read how we verify findings.

What does an Electron security teardown inspect?

Your interface and application logic travel in an ASAR archive. JavaScript, source maps, preload bridges and local settings can expose far more than the window on screen. We inspect the complete packaged app. An engineer verifies the findings, explains their business impact and writes fixes for your stack.

Does an ASAR archive protect Electron source code?

An ASAR archive packages application files; it is not a confidentiality boundary. JavaScript, resources and any included source maps need review. Integrity checks can help detect modified archives, while secrets and valuable authorisation decisions should not depend on the archive being unreadable.

What does an Electron teardown report include?

The paid teardown includes recovered evidence, findings ranked by business impact and a fix written for your stack. Audit and re-test adds a same-budget check of the updated build and a dated statement. The free first look reports counts and excludes recovered code and credential values.

Page updated . Samples are illustrative; public research is attributed above.

Your build. Your evidence.

See what
yours gives away.

Start with counts of exposed keys, files and readable logic. A full teardown adds verified evidence, business impact and a fix written for your stack.

Only software you own or are authorised to submit. No code or credential values in the free counts-only result.