Skip to content

Security and limits

David Reed edited this page Nov 20, 2026 · 3 revisions

The honest limit

estrogen raises the cost of reading a build. It does not make the build secret.

The output ships a decoder and a key in each file, because the browser has to run the code. Anyone with devtools can run that code and read what it produces. TLS is the only protection on the wire. Do not describe estrogen output, the DOM, or the bundle as secret in any user-facing copy.

This is the same limit the site scripts estrogen replaces already state. estrogen is build tooling that makes a build expensive to read, not a confidentiality mechanism.

What estrogen does

  • Rewrites string and template literals into an encrypted per-file pool, with a compact ChaCha20 decoder in each file.
  • Renames proxy and store names to per-build substitutes, in strings, regex literals, and vendored markup.
  • Rewrites embedded wasm names and their base64 to match.
  • Rewrites HTML shells and SVG cloaks.
  • Strips sourceMappingURL comments and, by default, writes no source map. See Source maps.
  • Checks the output against the canary list and fails if sensitive plaintext survives.

The output behaves the same as the input. estrogen does not change what the code does; it changes how hard the source text is to read.

What estrogen does not do

  • It does not keep anything secret from a user with devtools.
  • It does not protect the transport; TLS does that.
  • It does not run the bundler or change program behavior.
  • It does not obfuscate vendored transport assets (epoxy, libcurl, the STomp runtime), which it leaves as shipped. It still canary-checks them.
  • It is not the bytecode shield VM, which compiles chunks to encrypted bytecode and is a heavier, separate mechanism. estrogen is the string, name, asset, and markup layer.

The canary check

The canary list checks that the obfuscation actually removed the plaintext it was meant to. It is a list of literals that must not appear in the output verbatim. After the rewrite, estrogen checks every processed file, including the vendored assets it does not re-obfuscate, and fails the run if any listed literal survives. A build that still contains a canary literal does not ship.

Keep the list current: a new user-visible sensitive literal is a regression the moment it ships in plaintext, so add it to the canary list when you add it to the code.

Fail closed

estrogen fails closed. Anything it cannot fully handle (a parse error, a store name outside the allow-list, a proxy name across a regex escape, a wasm literal in mixed base64 alphabets, a surviving canary literal) fails the run. It writes no partial output for that file and exits nonzero. A build that cannot be fully protected fails the build rather than shipping half protected.

Clone this wiki locally