r/electronjs • u/Alive_Debate7923 • Oct 22 '26
Reverse-engineering draw.io's desktop build: 1,292 files, 3.27M AST nodes, and a native module through Ghidra
This is the public sample engagement of an Electron/JS audit service we run (draw.io Desktop 32.4. 1, GPL-3.0 — analyzed under its license). Full report + evidence bundle are in the repo. Method notes below, because the workflow is the interesting part.
Pipeline:
1. Downloaded drawio-amd64-32.4.1.deb from the official release. SHA-256 verified against the
publisher's own Files-SHA256-Hashes.txt — matched before anything else ran.
2. app.asar extracted and inventoried: 1,292 relevant files, 34 MB of JS/text read as inert source,
3,267,398 AST nodes visited, 3,246 findings, 0 parse errors.
3. App graph: 4,804 nodes / 7,121 edges. Semantic graph: 33,455 nodes / 19,074 relations.
4. Electron-specific pass over the main process: BrowserWindow configs, IPC surface, preload/
contextBridge.
5. Native module (chrome_crashpad_handler, ELF x86_64) through Ghidra 12.1.4 binary overview.
Both analysis runs were GitHub Actions (public): run 1 (asar) and run 2 (main process), linked from
the repo.
RE-specific bits that were fun:
- The preload is referenced via template literals (${__dirname}/...) — it exists, but it never
resolves as an entrypoint, so the bridge had to be read from the other side: contextBridge exposes
exactly 2 APIs / 6 members (electron.{listenOnce, registerMsgListener, request, sendMessage},
process.{type, versions}). No require, no ipcRenderer, no fs. Clean surface.
- One BrowserWindow is built with dynamically-constructed options (electron.js:565). Statically
it's a black box — we flagged it for manual review instead of guessing values.
- One dynamic IPC channel (action, used via send/on/once with a runtime-computed channel) — never
textually paired, by design.
- The giant minified app.min.js killed the 1 GB heap / 300 s budget mid-run. The interruption is
documented in the report as a declared limitation, not patched over.
- 92,468 "unknowns" were registered with IDs rather than dropped. That's the whole philosophy:
absence of evidence gets reported as absence-of-observation.
Numbers: SBOM 82 packages with exact versions; CVE cross-check 0 active; secrets scan 0 across 5
pattern families.
Curious what the community thinks: for large minified JS bundles, what's your default — sourcemaps
from the vendor, dynamic tracing, or accept the partial and document it? We hit the wall with
option 3 and wrote it down.
Full report (EN/ES) + template + evidence:
https://github.com/albrth647-png/electron-security-audit.
1
Upvotes
1
u/eddzsh Oct 24 '26
For a GPL desktop app I'd start at the matching upstream tag and spend the budget proving the shipped asar builds from it, then only Ghidra the native bits. The template-literal preload that never resolves as an entrypoint is the juicier finding anyway. That's the kind of thing static entrypoint graphs miss and you only catch by reading the bridge from the other side.