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-zkis 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.0runtime. - 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โ generatesflash_wrap_โฆโ.flash-wrap, seals master โ.flash-take(FLASHTAKE1only). Secrets never printed.FlashClientโ optional auto-unseal via.flash-take+.flash-wraporFLASH_WRAP_KEY(wrapKeyDiroption).src/security/key_wrap.mjsโ seal/unseal API exported fromflash-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.
secretKeystrength: at least 16 bytes in apps (8 in the test runner). Common weak strings are rejected.FlashServerrequiresauthKey. Binding0.0.0.0also requiresallowPublicBind: true./healthstays public; everything else needsx-flash-server-key. Per-IP rate limit (200 / 10s).- Remote
FlashClient.urirequiresauthKey. - Intelligence Console requires
token. Document explorer (GET /api/docs) is off unlessallowDataExplorer: true. fieldPolicy: plaintextrequiresallowPlaintextFields: true.- gRPC and replication daemons require
authKey. Replica sets generate a cluster key automatically. - CLI:
flash-serverdefaults to127.0.0.1and exits withoutFLASH_AUTH_KEY/--authKey.flash-consoleacceptsflashsh wrap-keyfiles orFLASH_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,
_encchecks 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.secretKeynever belongs on the server.FlashSQL.execute(client, sql)andFlashGraphQL(client)requireFlashClient. The storage engine does not evaluate SQL/GraphQL over plaintext.FlashRBACcan be passed toFlashServer(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.uriaccepts only FLASH URLs (flash://,http://,https://).- New example:
examples/standalone-vault.
Honesty โ
- Key agreement is ECDH + SHA3, not ML-KEM/Kyber.
pqcHardenedis 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, andFlashReplicationServerto127.0.0.1(localhost) instead of0.0.0.0(all interfaces) to prevent accidental public exposure. - Timing-Safe Credential Verification: Replaced basic string comparison with a cryptographically secure
timingSafeCompareusing HMAC and constant-time equality checks forauthKeyinFlashServer,FlashGRPCServer, replication, andFlashWebSocketServer, as well astokeninFlashDashboard. - CORS Protection: Hardened CORS validation in
FlashServerandFlashDashboardto 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
Originheader 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) inFlashServerandFlashDashboardand frame-levelmaxPayloadbuffers inFlashWebSocketServerto 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
FlashPQCwith 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-saltfile. - Nonce Reuse & Deterministic Encryption: Upgraded deterministic encryption in
FlashCipherto 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_bundleextraction inFlashPortableBundleby resolving paths withpath.resolveand enforcing strict boundary checks to prevent directory traversal / Zip Slip attacks. - Regex Query Sandboxing (ReDoS Protection): Wrapped all
$regexevaluations in a securenode:vmsandbox with an absolute execution timeout of 50ms to completely block Regular Expression Denial of Service (ReDoS) CPU exhaustion. - AI Prompt Firewall Injection Filters: Upgraded
FlashPromptFirewallto 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 transientENOTEMPTYconditions.
v1.0.3 โ Companion foundation (honest config) โ
trashanddeletionLogon theFlashClientroot throw. They only work underengineOptions.- The same guard reads FlashClient, FlashDatabase, FlashServer, and
engineOptionsvalues (types, enums, nested keys). listTrash/listDeletions/purge*throw when the feature is disabled โ they no longer return[].FlashClient.urirejects foreign database URLs (FLASHflash:/// 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:
npm install flash-zkawait 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):
npm install flash-zkimport { 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 โ
| API | Where | Purpose |
|---|---|---|
client.encryptToBuffer(doc) | FlashClient | Plain doc โ encrypted Buffer (one serialize) |
client.decryptFromBuffer(buf) | FlashClient | Encrypted Buffer โ plain doc (partial field read) |
FlashRecordCodec | export | Low-level encode/decode helpers |
FlashBinary.decodeRecord(buf) | export | Engine buffer โ object (for SQL/Wire/etc.) |
FlashBinary.decodeRecords(bufs) | export | Batch decode |
Behavior changes (low-level) โ
If you use FlashCollection directly (not FlashClient.collection()):
| Method | Before | Now |
|---|---|---|
find() | object[] | Buffer[] |
findOne() | object | null | Buffer | null |
insertOne() | object only | object | 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:
{ "_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) โ
| Feature | API |
|---|---|
| Turbo profile | engineOptions: { performanceProfile: 'turbo' } |
| In-memory engine | inMemory: true or storagePath: ':memory:' |
| Lazy field decrypt | .select('field1 field2') |
| Partial buffer decrypt | FlashRecordCodec.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:
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 },
});| Policy | Blind index | Typical size vs searchable |
|---|---|---|
encrypted / zk-secret | none | ~5โ15ร smaller (strings) |
exact | exact trapdoor only | ~3โ8ร smaller |
searchable | exact + ngrams + range | baseline |
plaintext | none | smallest + SSTable compresses |
Plugin hooks โ
beforeUpdate and afterUpdate are fully supported:
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()typingFlashRecordCodec,encryptToBuffer,decryptFromBufferFlashCollectionbuffer return typesFlashPlugin.afterUpdateFlashDatabaseconstructor acceptsengineOptions
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 โ
| Issue | Fix |
|---|---|
| TTL only scanned memtable | TTL sweeps memtable + SSTables |
getMerkleProof() async bug | Sync returns null if dirty; use getMerkleProofAsync() |
count() loaded all docs | Uses engine count() when no filter |
Missing beforeUpdate hook | Added on updateOne |
Schema expireAfterSeconds | Also registers lifecycle() |
New client foundations โ
| API | Use 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 |
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
Migration checklist โ
From โค1.3.0 โ 1.3.2 โ
- No breaking changes if you only use
FlashClient.collection()CRUD. - Engine-level code (
FlashDatabase.collection().find()): decode buffers withFlashBinary.decodeRecord(). - Custom server clients: expect
_flashRecordbase64 over REST if reading raw responses. - Enable timestamps: default on โ pass
autoTimestamps: falseto disable. - Run tests after upgrade; 146 tests cover buffer + remote + foundations paths.
Recommended client setup (1.3.0) โ
flashsh wrap-keyimport { 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)