Skip to content

Release Notes (Developer Guide) โ€‹

What changed in recent FLASH releases and how to adopt it in your apps.

Current version: 1.3.1 ยท Tests: 198/198 ยท This release is documentation only โ€” no extra code.

This week: Do this first โ€” keep the key; do not weaken the default.

What's new in 1.3.1 โ€” mission, responsibility, protection first. Engine unchanged from 1.3.0. Previous: v1.3.0 key wrapping ยท v1.2.0 fail-closed.


v1.3.1 โ€” Forward docs only (no extra code) โ€‹

This version only publishes what FLASH is for, who is responsible, and that protection is the priority. It does not add engine, crypto, CLI, or API code.

  • Mission & responsibility โ€” first-line privacy while AI is built; default flash-zk is strong; the developer can weaken it; strongest when the key is kept.
  • Do this first โ€” what to do this week on the existing 1.3.0 runtime.
  • Security ahead โ€” what FLASH will refuse and raise next, written now so you are not surprised.
  • Home, README, trust model, positioning โ€” same split, said in the open.

Upgrade: none. Install 1.3.1 or stay on 1.3.0 for behavior; read the docs either way.


v1.3.0 โ€” Key wrapping & earned trust โ€‹

Developer-owned secret handling and honest public positioning โ€” no change to AES-256-GCM / PBKDF2 / fail-closed server defaults from 1.2.0.

  • flashsh wrap-key โ€” generates flash_wrap_โ€ฆ โ†’ .flash-wrap, seals master โ†’ .flash-take (FLASHTAKE1 only). Secrets never printed.
  • FlashClient โ€” optional auto-unseal via .flash-take + .flash-wrap or FLASH_WRAP_KEY (wrapKeyDir option).
  • src/security/key_wrap.mjs โ€” seal/unseal API exported from flash-zk.
  • Trust Model โ€” limits, SSE leakage, public audit roadmap (Phases Aโ†’E).
  • Docs โ€” tightened marketing claims; VitePress theme; flashsh CLI key-format spec.
  • Tests: 198/198 (includes tests/key_wrap.test.mjs).

Security: default flash-zk is strong; the wrap secret stays with the keyholder. The developer can weaken the model. Key wrapping is operational sealing, not a certification. Mission.


v1.2.0 โ€” Trust defaults (fail closed) โ€‹

Network and key handling now refuse insecure configurations instead of hoping the operator notices.

  • secretKey strength: at least 16 bytes in apps (8 in the test runner). Common weak strings are rejected.
  • FlashServer requires authKey. Binding 0.0.0.0 also requires allowPublicBind: true. /health stays public; everything else needs x-flash-server-key. Per-IP rate limit (200 / 10s).
  • Remote FlashClient.uri requires authKey.
  • Intelligence Console requires token. Document explorer (GET /api/docs) is off unless allowDataExplorer: true.
  • fieldPolicy: plaintext requires allowPlaintextFields: true.
  • gRPC and replication daemons require authKey. Replica sets generate a cluster key automatically.
  • CLI: flash-server defaults to 127.0.0.1 and exits without FLASH_AUTH_KEY / --authKey. flash-console accepts flashsh wrap-key files or FLASH_MASTER_KEY / --key, then prints a dashboard token.
  • Blind counters carry an HMAC tag so tampered hex is not mixed into sums blindly.
  • Performance (crypto unchanged): in-process PBKDF2 cache, lazy trash/deletion ciphers, _enc checks without JSON-parsing ciphertext, FAR2 CRC-32 WAL checksums (AES-GCM still authenticates records). Legacy FARC files still recover.

This is still not a formal proof system or an external pentest. It is fail-closed engineering.


v1.1.0 โ€” Architectural zero-knowledge + independent identity โ€‹

FLASH is a standalone encrypted intelligence database. Companion framing to other document stores is removed.

Zero-knowledge kernel โ€‹

  • FlashZKKernel โ€” the engine and network daemons refuse unsealed plaintext records and plaintext query fields.
  • FlashServer / FlashGRPCServer / replication accept sealed envelopes and trapdoor queries only. secretKey never belongs on the server.
  • FlashSQL.execute(client, sql) and FlashGraphQL(client) require FlashClient. The storage engine does not evaluate SQL/GraphQL over plaintext.
  • FlashRBAC can be passed to FlashServer (x-flash-user). Operations are authorized without reading document contents.
  • Query responses include a Merkle root of sealed records so clients can verify inclusion without the server knowing values.

Identity โ€‹

  • Positioning, examples, and docs no longer describe FLASH as a sidecar to another database.
  • FlashClient.uri accepts only FLASH URLs (flash://, http://, https://).
  • New example: examples/standalone-vault.

Honesty โ€‹

  • Key agreement is ECDH + SHA3, not ML-KEM/Kyber. pqcHardened is scrypt + SHA3 passphrase stretching.
  • Additive counters remain masked group sums, not Paillier/BFV. See Homomorphic Math.

Breaking: FlashSQL.execute and FlashGraphQL no longer take FlashDatabase. Pass FlashClient.


v1.0.4 โ€” Zero-Knowledge Security & Robust Hardening (Security Release) โ€‹

A major security release addressing 21 critical, high, and medium-severity vulnerabilities.

๐Ÿ›ก๏ธ Network and Authentication Hardening โ€‹

  • Local-First Default Host: Changed default host binding for FlashServer, FlashDashboard, FlashGRPCServer, and FlashReplicationServer to 127.0.0.1 (localhost) instead of 0.0.0.0 (all interfaces) to prevent accidental public exposure.
  • Timing-Safe Credential Verification: Replaced basic string comparison with a cryptographically secure timingSafeCompare using HMAC and constant-time equality checks for authKey in FlashServer, FlashGRPCServer, replication, and FlashWebSocketServer, as well as token in FlashDashboard.
  • CORS Protection: Hardened CORS validation in FlashServer and FlashDashboard to restrict access strictly to trusted local origins (e.g., localhost, 127.0.0.1), blocking wildcards * or untrusted cross-origin requests.
  • WebSocket CSWSH Defense: Implemented strict Origin header validation in upgrade requests to protect against Cross-Site WebSocket Hijacking (CSWSH).
  • DoS Payload Capping: Enforced a strict 10MB limit on raw HTTP request bodies (readBody) in FlashServer and FlashDashboard and frame-level maxPayload buffers in FlashWebSocketServer to prevent memory-exhaustion Denial of Service (DoS) attacks.

๐Ÿ” Cryptographic Robustness & Zero-Knowledge Gaps โ€‹

  • Authentic Post-Quantum Cryptography (PQC): Replaced the mock SHA3-based lattice key exchange in FlashPQC with real, production-ready ECDH (secp256k1) with SHA3-256 final shared secret encapsulation/decapsulation.
  • Hardened Key Expansion & PBKDF2: Enforced PBKDF2-HMAC-SHA256 key expansion for any passphrase master key of any length in FlashCipher, completely avoiding the bypass where 32-character keys were used directly.
  • Dynamic Database Salts: Replaced the static, hardcoded default salt (flash_db_default_salt_2026) with a cryptographically secure dynamic salt (crypto.randomBytes(32)) generated per-database and stored locally in a secure .flash-salt file.
  • Nonce Reuse & Deterministic Encryption: Upgraded deterministic encryption in FlashCipher to use AES-256-CBC with HMAC-SHA256-derived IVs (derived from both key and plaintext) to eliminate the risk of GCM nonce-reuse and decryption tag collision.

๐Ÿ›ก๏ธ Logic Flows & Input Sanitization โ€‹

  • Path Traversal & Zip Slip Prevention: Enhanced portable_bundle extraction in FlashPortableBundle by resolving paths with path.resolve and enforcing strict boundary checks to prevent directory traversal / Zip Slip attacks.
  • Regex Query Sandboxing (ReDoS Protection): Wrapped all $regex evaluations in a secure node:vm sandbox with an absolute execution timeout of 50ms to completely block Regular Expression Denial of Service (ReDoS) CPU exhaustion.
  • AI Prompt Firewall Injection Filters: Upgraded FlashPromptFirewall to scan and redact prompt injection payloads (e.g., system instructions bypass) alongside PII patterns to secure local LLM agent workloads.
  • Safer Resource Lifecycle Management: Updated FlashCollection.close() to close WAL and oplog file descriptors conditionally and gracefully. Resolved macOS directory deletion locks with a retry mechanism under transient ENOTEMPTY conditions.

v1.0.3 โ€” Companion foundation (honest config) โ€‹

  • trash and deletionLog on the FlashClient root throw. They only work under engineOptions.
  • The same guard reads FlashClient, FlashDatabase, FlashServer, and engineOptions values (types, enums, nested keys).
  • listTrash / listDeletions / purge* throw when the feature is disabled โ€” they no longer return [].
  • FlashClient.uri rejects foreign database URLs (FLASH flash:// / HTTP only).
  • Config guard on FlashClient, FlashDatabase, FlashServer, and engineOptions.

v1.0.2 โ€” Optional deletion log + trash purge on drop โ€‹

  • engineOptions.deletionLog โ€” opt-in permanent metadata-only activity log (.flash-deletion-log, sealed + compressed); disabled by default.
  • listDeletions() / purgeDeletionLog() on client and collection.
  • dropCollection(name) now purges trash entries for that collection.

See Trash & Restore โ€” Deletion activity log.


v1.0.1 โ€” Trash & Restore (undo delete) โ€‹

Every deleteOne / deleteMany archives the document into a single compressed .flash-trash file before hard delete. Restore without a full backup:

bash
npm install flash-zk
js
await col.deleteOne({ _id: "n1" });
await col.restoreOne("n1");
await col.listTrash();

Configure limits via engineOptions.trash (maxEntries, maxBytes, maxAgeMs). See Trash & Restore.


v1.0.0 โ€” npm flash-zk โ€‹

npm rejected the unscoped name flash-db (too similar to the existing flashdb package). The scoped name @moaaz-i/flash-db requires creating the @moaaz-i org on npm first.

The official npm name is flash-zk (short, unscoped, zero-knowledge):

bash
npm install flash-zk
js
import { FlashClient } from "flash-zk";

v1.3.2 โ€” Default Buffer Pipeline โ€‹

Summary โ€‹

The engine now keeps records as FlashBinary Buffers end-to-end. The SDK still accepts and returns plain JavaScript objects โ€” conversion happens once at the client boundary.

Your app (object) โ†’ encryptToBuffer() โ†’ Buffer โ†’ WAL / SSTable
WAL / SSTable โ†’ Buffer โ†’ decryptFromBuffer() โ†’ Your app (object)

New APIs โ€‹

APIWherePurpose
client.encryptToBuffer(doc)FlashClientPlain doc โ†’ encrypted Buffer (one serialize)
client.decryptFromBuffer(buf)FlashClientEncrypted Buffer โ†’ plain doc (partial field read)
FlashRecordCodecexportLow-level encode/decode helpers
FlashBinary.decodeRecord(buf)exportEngine buffer โ†’ object (for SQL/Wire/etc.)
FlashBinary.decodeRecords(bufs)exportBatch decode

Behavior changes (low-level) โ€‹

If you use FlashCollection directly (not FlashClient.collection()):

MethodBeforeNow
find()object[]Buffer[]
findOne()object | nullBuffer | null
insertOne()object onlyobject | Buffer
insertMany()object[] only(object | Buffer)[]

Use FlashBinary.decodeRecord() when you need plain objects from engine buffers.

Remote / FlashServer wire format โ€‹

Records over HTTP are sent as:

json
{ "_flashRecord": "<base64 FlashBinary buffer>" }

The remote client decodes automatically. No app changes if you use FlashClient with uri.

insertMany over remote uses POST /api/v1/insertMany/:collection (single round-trip batch).

Performance (v1.3.2) โ€‹

FeatureAPI
Turbo profileengineOptions: { performanceProfile: 'turbo' }
In-memory engineinMemory: true or storagePath: ':memory:'
Lazy field decrypt.select('field1 field2')
Partial buffer decryptFlashRecordCodec.decryptFields() / decryptFieldsFromBuffer()
Skip Merkle (turbo)disableMerkle: true (turbo default)

See Foundations ยง15.

Compact storage (storageProfile: 'compact') โ€‹

Minimal on-disk footprint โ€” use for bulk archives and non-searchable payloads:

javascript
const client = new FlashClient({
  storagePath: "./flash_data",
  storageProfile: "compact",
  fieldPolicy: {
    title: "exact", // equality search only
    body: "encrypted", // encrypt only โ€” smallest
    tags: "plaintext", // compressible metadata
  },
  engineOptions: { compressionLevel: 6 },
});
PolicyBlind indexTypical size vs searchable
encrypted / zk-secretnone~5โ€“15ร— smaller (strings)
exactexact trapdoor only~3โ€“8ร— smaller
searchableexact + ngrams + rangebaseline
plaintextnonesmallest + SSTable compresses

Plugin hooks โ€‹

beforeUpdate and afterUpdate are fully supported:

javascript
client.use({
  name: "audit",
  beforeUpdate(doc, col, previous) {
    doc.lastEditedBy = "system";
    return doc;
  },
  afterUpdate(doc, col) {
    console.log("updated", doc._id);
  },
});

TypeScript โ€‹

  • FlashQueryWhereBuilder<T> โ€” fixes fluent .where().gt() typing
  • FlashRecordCodec, encryptToBuffer, decryptFromBuffer
  • FlashCollection buffer return types
  • FlashPlugin.afterUpdate
  • FlashDatabase constructor accepts engineOptions

See Buffer Pipeline and TypeScript Support.


Included in v1.3.0 โ€” Engine fixes + foundations โ€‹

These landed in 1.3.0, not in the docs-only 1.3.1. Kept here so history is searchable.

Bug fixes โ€‹

IssueFix
TTL only scanned memtableTTL sweeps memtable + SSTables
getMerkleProof() async bugSync returns null if dirty; use getMerkleProofAsync()
count() loaded all docsUses engine count() when no filter
Missing beforeUpdate hookAdded on updateOne
Schema expireAfterSecondsAlso registers lifecycle()

New client foundations โ€‹

APIUse case
client.eventLog(name)Append-only time-ordered stream
client.counter(name)Atomic counters
client.queue(name)FIFO jobs with ack/fail
client.health()Engine capacity report
client.snapshot().flashpack export/import
autoTimestamps: true (default)Auto createdAt / updatedAt

See Universal Foundations.


v1.3.0 โ€” Universal Foundations (Cross-Domain) โ€‹

Introduced generic primitives instead of domain-named modules:

  • lifecycle(), paginate(), maintenance(), pipeline()
  • events(), use() plugins, tenant()
  • Positioning as zero-knowledge encrypted intelligence DB

See Positioning & Identity.


Migration checklist โ€‹

From โ‰ค1.3.0 โ†’ 1.3.2 โ€‹

  1. No breaking changes if you only use FlashClient.collection() CRUD.
  2. Engine-level code (FlashDatabase.collection().find()): decode buffers with FlashBinary.decodeRecord().
  3. Custom server clients: expect _flashRecord base64 over REST if reading raw responses.
  4. Enable timestamps: default on โ€” pass autoTimestamps: false to disable.
  5. Run tests after upgrade; 146 tests cover buffer + remote + foundations paths.
bash
flashsh wrap-key
javascript
import { FlashClient } from "flash-zk";

const client = new FlashClient({
  storagePath: "./data",
  engineOptions: { durability: "balanced" },
  autoTimestamps: true,
});

// Foundations client.maintenance({ autoStart: true }); const log = client.eventLog("events"); const jobs = client.queue("tasks");


---

## Related

- [Buffer Pipeline](/guide/buffer-pipeline)
- [Universal Foundations](/guide/foundations)
- [FlashClient API](/api/flash-client)
- [Client-Server Mode](/guide/client-server)
- [TypeScript Support](/guide/typescript)

Zero-knowledge encrypted intelligence ยท Apache 2.0