Node.js introduced SEA (Self-Extracting Archive) to help package JS apps into a single binary. Sounds great, until you realize it barely protects anything!
Here’s what happens:
- your JS files are bundled into a blob,
- bootstrapped by a minimal JS file (main.js), and
- compiled into a binary using Node's runtime.
- At runtime, Node unpacks that blob into a temporary file or memory and
- starts execution from there!
But here's the catch: that blob is just opaque, not encrypted. With basic reverse engineering, it's trivial to extract the .js
files from the binary. All your business logic is visible, including variable names, function names, etc. And since the bootstrap logic is open and predictable, an attacker knows exactly where to look.
To me, SEA feels like a bundler with convenience, not a security boundary. There's no bytecode, no obfuscation, no VM sandboxing, no integrity check. Just a zipped version of your app, hidden behind an ELF or Mach-O(iOS) header.
For seasoned devs distributing binaries to clients or embedding logic on-prem, SEA won’t protect IP. It’s immature, and worse—it gives a false sense of safety.
Use it for packaging convenience, maybe. But for real source protection? Look elsewhere (like V8 snapshots, bytenode, or WebAssembly).