Repository navigation
v2.5.6
HexDB 2.5.6 fixes the findings of an independent security and reliability review of 2.5.5: access control across combined roles, stream credentials and egress, queue and plugin delivery guarantees, script cleanup, the Docker image's TypeScript runtime, and a sorted-query scaling problem. Upgrade every hex.
Security
- Combined row-restricted roles. A user holding two roles with different row filters (say tenant A with
secrethidden, tenant B unrestricted) saw tenant A's hidden fields, because field protections were combined across every role regardless of which role let a document through. A role's hidden and masked fields now go with its row filter: each document is shown as the roles whose filters include it show it, and writes are judged the same way. Filters, sorts, aggregates, SQL columns and detokenizing treat a field as protected if any visible document protects it. - Stream credentials.
GET /streamsandGET /streams/{name}returned destination headers (anAuthorizationvalue, say) to anyone who could read the stream. Header values and URL query values are now never returned, to anyone; they read as********, and a configuration sent back with********keeps the stored value. URLs with a user name or password are refused. If readers who shouldn't have had them could read your streams, rotate those destination credentials. - Internal stream cursors. A stream reader could commit an offset to
__destination:0and skip deliveries. Consumer groups starting with__are now reserved, a commit must name a message of the stream, and offsets never move back. - Stream destinations on private networks. Whoever manages a stream could make the server POST to loopback or private addresses. Destinations must now resolve to public addresses, checked on save and before every delivery. Upgrading: a destination on a private address (
localhost,10.x,192.168.x, ...) stops delivering until an administrator setsstreams.private_networks = truein the lattice config. - Script sessions. A script whose request timed out kept its session token valid for up to an hour. The session now expires a minute after the script's timeout and is revoked however the run ends; the run's temporary folder is private and removed, and processes the script started are stopped with it (a process group on Linux and macOS, a job object on Windows).
- Plugin sandbox. What the sandbox enforces is now probed rather than assumed:
GET /pluginsshows it undersandbox, and the log says at startup when file access can't be confined (Linux without Landlock, macOS).plugins.require_full_sandbox = truerefuses to start plugins there instead of running them with less.
Delivery guarantees
- Queues and cancelled requests. A send or receive whose request was cancelled while its write waited for the disk could leave a stored message invisible, or a leased one handed to a second consumer. The queue's index is now rebuilt from the stored messages after any operation that didn't finish, and a lease is checked against the stored message.
- Dead letters. Moving a message to its dead-letter queue is now one atomic write, so it can't disappear from both queues. Dead-letter queues can't form a cycle.
- Queue de-duplication keys are now stored with their message, so they hold across restarts and failovers for their five minutes.
- Process plugins were checkpointed as soon as changes reached their stdin. A stream plugin can now acknowledge (
acks = truein plugin.toml, then{"ack": <seq>}on stdout, or the SDK'sack(change)), and its position moves only to what it acknowledged: at-least-once end to end. The bundled Kafka, Kinesis, AI keywords and change-logger plugins acknowledge. Plugins without acks are no longer checkpointed past changes written just before they failed. - Plugin SDK.
api()retried writes after 502/503 without an idempotency key, so an insert could be applied twice. Every write now carries a key reused across its retries.
Fixed
-
The request after a refused upload. An upload refused before its body was read (over a quota, not signed in) left the connection unusable without saying so, so a client's next request on it could fail with "connection closed". Such a body is now read and dropped first (up to 32 MB, for 5 seconds); anything bigger or slower, or a body abandoned part way (a request timeout), ends the connection with
Connection: close. -
No failed writes during a handover. A write that reached the Overseer just as it began handing its role over (a graceful stop, a rolling update, a hand-back) could fail with 503. Such a write is refused untouched and now goes on to the next Overseer, as a replica would send it.
-
TypeScript functions in the Docker image. The image shipped Debian's Node.js 20, which can't run TypeScript. It now ships Node.js 24 (and Debian's security updates); the release runs every script runtime in the built image before publishing. The server logs at startup whether
functions.nodecan run TypeScript. -
Script timeouts now include delivering the input, so a script that never reads its stdin can't run past its timeout.
-
Sorted pages answered from an index copied the whole index first. They now read the index a page at a time, so the cost of
LIMIT 10no longer grows with the size of the tessellation. -
Query plans report
index_entriesbesidescanned: how many index entries a query looked at, so index work no longer hides behind a smallscanned. -
SQL memory. A statement with joins, subqueries or expressions may hold at most
limits.sql_max_mb(256 MB) of documents across its reads; more is refused with a message, never cut short. -
The document cache evicts its least recently used entries without sorting all of them under its lock.
Release process
- Nothing is published (GitHub release, images, npm, PyPI, NuGet, Maven) unless CI passed on the tagged commit. The image is smoke-tested and scanned before it's pushed, carries an SBOM and build provenance, and its digest is signed with Sigstore (see packaging/RELEASING.md to verify). Every GitHub Action the builds use is pinned to a commit. The bundled plugins have lockfiles (
npm ci), and CI audits them.
Upgrading
Restart the hexes one at a time, as usual: replicas first, the Overseer last. Check stream destinations on private addresses (see above).
What's Changed
- Bump @vscode/vsce from 4.1.0 to 4.1.1 in /extensions/vscode in the vscode-extension group by @dependabot[bot] in #74
- Bump the dotnet group with 1 update by @dependabot[bot] in #76
Full Changelog: v2.5.5...v2.5.6