Anti-AIClone

Log date · Wed

Does Node.js SEA vfsArchive protect embedded assets?

SEA vfsArchive embeds a ZIP unchanged; it packages assets but does not make them secret.

Does a Node.js SEA protect embedded assets?

Do not treat assets embedded in a Node.js SEA as secrets. Version 26.11.0 embeds the prebuilt vfsArchive ZIP unchanged for distribution and compression, not confidentiality. [1][2] In our Node.js 20.19.5 preparation-blob comparison, an exact placeholder was present when included as an asset and absent when omitted.

Results at a glance
QuestionFinding
How does the 26.11 ZIP ship?Embedded unchanged at build time and read through the VFS.
What happened to our placeholder?Found with the asset; absent without it.
Size and read time?In the PR’s 128MB tier: 284.7MB → 193.9MB; read all 269ms → 477ms.
What about secrets?Keep them out of the client package and on a controlled server.

What changed in the release

Node.js released 26.11.0 (Current) at 14:43 UTC on 2026-10-07. Its list includes PR #65810 and tests and documentation for import() with code cache. [1] The new option accepts a prebuilt ZIP: configuration must enable useVfs and cannot also specify assets. The build performs only a PK signature sanity check before embedding; at runtime the archive is mounted and its individual files are read through fs, not sea.getAsset(). [2]

Configuration from the official PR; illustrative, not run here.
{
  "main": "main.js",
  "output": "app",
  "useVfs": true,
  "vfsArchive": "assets.zip"
}

That does not give ZIP contents encryption. The documentation says files are inflated when read, so compression and confidentiality answer different questions. [3] Review ZIP inputs before building, not just the entry script. Test paths and module loading in the final executable on the actual target version as well.

A reproducible older SEA experiment

We had Node.js 20.19.5 available. With its SEA tool we generated two preparation blobs from the same entry script: one included our asset.txt and the other did not. The placeholder is explicitly fake. This tests the packaging boundary in an older version of the same tool; it is not a test of 26.11, vfsArchive, ZIP or a final executable.

Verbatim output; sizes apply only to this sample.
== exact placeholder in each preparation blob ==
without.blob | absent
with.blob | present
== blob sizes in bytes ==
without.blob | 58
with.blob | 127

The blobs were 58 and 127 bytes, a difference of 69 bytes, not the net length of the content: the container also records asset information. The search checks one complete literal; no match is not proof that sensitive information is absent. It illustrates a build decision: the omitted sample asset was absent from this blob, while the included content could be found directly.

Build and exact-match commands from the experiment.
node --experimental-sea-config=without.json
node --experimental-sea-config=with.json
LC_ALL=C grep -aqF 'DEMO-KEY-not-a-real-credential-0000' with.blob && echo present

Compression and read costs

The PR author used Linux x64 with a warm cache, 75% text and 25% random data in 16KB files, reporting medians of 15 runs. [2] At the 128MB asset tier the archive binary was 90.8MB smaller, while reading everything rose from 269ms to 477ms; startup increased by 8ms. These are the PR author’s results, not our measurements.

Compressibility and access patterns change the tradeoff. An application reading one small configuration at startup has a different workload from one walking every file. Hold inputs, machine and cache conditions constant; measure build size, startup, first read and reading all assets before switching. Code cache is a performance option, not encryption; current documentation says useVfs cannot be combined with useCodeCache. [3]

Recommendations before release

These are engineering recommendations, not effects measured in our experiment. Decide first whether every recipient may have each asset, then choose how to package it.

Recommendations by use case
QuestionFinding
Public UI assetsShip in the ZIP if appropriate; review the manifest and test reads.
Shared privileged secretKeep it on a controlled server; use scoped, revocable client credentials.
Offline licenceShip a verification public key; keep the signing private key with the issuer.
Core rules required offlineAccept that client logic can be analyzed; assess the risk and test.
Source maps and internal dataExclude by default; retain diagnostic files separately and privately.

Server tokens also need audience, scope and expiry checks. Rotate a shared secret already shipped and verify that the old value stops working; removing it from the next build does not change old packages. Offline verification also needs expiry and revocation rules, since an offline device cannot immediately receive a revocation.

Check your own SEA build

Inspect the ZIP intended for embedding first; do not treat a search with no matches as a security proof. Replace the path below with your own archive. The listing may contain internal filenames, so handle it as internal material. Confirm each file has a reason to ship, paying particular attention to configuration, test data, private keys and source maps.

For your own input ZIP: list entries and test archive integrity.
unzip -l path/to/assets.zip
unzip -t path/to/assets.zip

Build with the target Node.js version using the documented configuration, then test asset reads and critical paths in the final executable. Compare the archive inventory with the intended release manifest; do not put real secrets in command lines or public logs. Check __dirname-relative paths and calls formerly using sea.getAsset(), which cannot retrieve individual vfsArchive files. [2][3]

If JavaScript is also obfuscated, do it before packaging and verify behavior in the final artifact. Schedule macOS and Windows signing after resource injection; verify signatures and notarization as required by your distribution channel. Keep the build version, inventory and test results so upgrades can be compared.

Your checklist

  • Inventory the input ZIP and review why each file ships.
  • Remove shared secrets, private keys and unnecessary source maps.
  • Check the useVfs, vfsArchive and assets configuration constraints.
  • Test asset reads and critical paths in the final executable on the target version.
  • Sign after resource injection and verify signatures and applicable notarization.

Primary sources

All sources and reproduction status ↗