A security release: tenant isolation on every path-tenant handler, the
platform:admin scope, globally unique SMTP usernames, the fail-closed
bootstrap gate, and seven RUSTSEC advisories closed. Three of those break
an existing deployment and the changelog marks each one, the object store
swap included - an upgrade keeps the old minio_data volume while Sentio
talks to an empty store.
cargo update took every compatible bump; all 61 direct dependencies were
already on their latest major line.
Gate 7/7 with 752 tests, e2e 19/19.
rspamd and mailpit tracked `latest`, so the stack you got depended on the
day you pulled it and dependabot had nothing to raise a pull request
against. Pinned at 4.2.2 and v1.31.6, and NATS moved 2.11 -> 2.15 while
I was in there.
publish.yml still said main was validated by ci.yml, which is gone.
scripts/check.sh and scripts/e2e/run-e2e.sh are the gate, run before a
tag goes up.
MinIO's community edition was archived and its images withdrawn. Both
quay.io/minio/minio and quay.io/minio/mc now answer 401/404 to an
anonymous pull and they are off Docker Hub entirely, so `docker compose
up -d` could not fetch them and the quickstart was broken for anyone
without a local cache.
`weed mini` is master, volume server, filer and S3 gateway in one
process. It takes its admin identity from AWS_ACCESS_KEY_ID /
AWS_SECRET_ACCESS_KEY and creates the bucket named by S3_BUCKET, so the
mc one-shot goes away - and ensure_bucket() in sentio-storage already did
that job anyway. Its S3 port, 8333, is the one config/default.toml has
always pointed at.
e2e: 19/19 against it, including the attachment round-trip and raw .eml
archival through the store.
Wildcard scope was doing two jobs. A new tenant could never get its
first API key: ensure_tenant_match is strict equality and nothing
bypassed it, so only SQL could provision one. And every handler in
routes/tenants.rs was scope-gated only, so any `*` key could read,
rename, suspend or delete another tenant, including a `*` key a tenant
minted for itself.
Cross-tenant reach is now platform:admin. `*` does not cover it, and a
session cannot grant it unless it holds it, so a tenant has no way to
mint itself out of its tenant. Migration 005 gives it to the system
tenant's wildcard keys, which are the ones that already had the reach.
RUSTSEC-2026-0367, -0368 and -0369 landed against zip 8, which mail-auth
pins and which has no fix below zip 9: SUID/SGID bits kept from an archive,
and symlinks written outside the destination. All three are in extraction
code.
The only thing pulling zip in was mail-auth's "report" feature, on by
default for DMARC aggregate report parsing. We verify DKIM, SPF, DMARC and
ARC and never extract an archive - our own DmarcReport types are in
sentio-core - so turning it off costs nothing and takes zip and quick-xml
out of the tree. aws-lc-rs and dns-hickory were default's other two and
stay.
Regenerated docs/openapi.json and THIRD-PARTY-NOTICES.md, which the bump
makes stale. utoipa 6 stops writing empty description fields and puts the
$ref before the null in a nullable oneOf; 85 paths, 116 operations and 182
schemas before and after, so nothing moved but the formatting.
Two things the security work needs to land cleanly here.
The startup gate and migration 002 cannot both hold on a first run: the
migration seeds a publicly-known admin key, the gate then refuses to
start, and there is no way to rotate a key through an API that will not
boot. docker compose up -d crash-looped, and the e2e harness could not
authenticate. The evaluation stack now sets
SENTIO_ALLOW_BOOTSTRAP_KEY=1 with the reason written next to it, and the
README gives the rotate-then-remove sequence. A manual install gets no
exemption, which is where the gate matters.
The README's rotation snippet also said data.key; the field is
data.raw_key, and the bootstrap key's id is the same well-known UUID as
the admin tenant.
Drops .github/workflows/ci.yml: this repository has no hosted CI by
decision, and scripts/check.sh is the gate. Worth noting what that
costs - the seven repo-layer isolation tests skip unless DATABASE_URL is
set, so nothing runs them automatically.
Review pass 1 (architectural) follow-ups on top of the previously
addressed CRITICAL create/inbound-route IDORs:
- #9 smtp-credential create: unique-violation (23505) now maps to
SentioError::Conflict -> ApiError::Conflict -> HTTP 409 instead of an
opaque 500; message names the taken username.
- #6 bootstrap-key gate now fails CLOSED: a database error during the
startup check refuses to start (was: debug! + continue, letting a
transient outage defeat the gate). SENTIO_ALLOW_BOOTSTRAP_KEY=1
remains the explicit recovery hatch.
- #7 README documents the refuse-to-start behavior, the recovery hatch,
and the manual SQL rotation path (API rotation is impossible when the
server won't bind).
- #8 migration 003 raises a NOTICE per renamed credential so operators
see which SMTP usernames stop authenticating (breaking change).
- #5 new GitHub Actions workflow (ci.yml): postgres service container,
migrations + full workspace tests + explicit tenant-isolation suite —
the regression tests previously skipped silently without DATABASE_URL
and nothing ran them.
- #11 tests clean up their tenant rows (cleanup_tenant) and a unit test
pins the handler-level guard contract: mismatched path tenant must
serialize as 404 (concrete assert on the response status).
- migration 004 extends error_events.error_type CHECK with 'conflict'.
cargo test --workspace --all-targets: 744 passed, 0 failed.
The test double in sentio-smtp-server kept the old 2-param
update/delete after the tenant_id parameter was added, breaking the
workspace test build. Full workspace suite now passes: 388 passed,
0 failed.
Review pass 2 (Kimi) verdict was reject: two CRITICAL IDORs remained —
inbound-route update/delete took the route id from the path but never
checked the owning tenant, so tenant A could rewrite delete tenant B's
routes. Now:
- InboundRouteRepository::update/delete take TenantId and the SQL is
scoped 'WHERE id = AND tenant_id = ' (trait + Pg impl); handler
guards with ensure_tenant_match and passes auth.tenant_id.
- Migration 003 is idempotent (constraint guard via pg_constraint) and
renames duplicates with a 'migration_003_' prefix so a literal
'<uuid>.<name>' credential can't collide with a renamed one.
- warn_if_bootstrap_key_active now runs in main() right after the pool
connects, BEFORE any SMTP/API listener binds (closes the split-brain
window where the bootstrap key could AUTH during startup).
- ensure_tenant_match deduplicated into routes::mod and shared.
- Two regression tests: inbound route update/delete cannot cross
tenants (7/7 pass). Test fixture INSERT moved to a runtime query so
test targets do not need .sqlx cache entries.
- .sqlx: 2 new tenant-scoped inbound-route queries (upstream cache
format, no origin churn); 3 superseded unscoped entries removed.
Review pass 1 found the same bug family one layer up: create_api_key
and create_smtp_credential minted the resource under the client-
controlled path tenant (and list endpoints read it), letting an admin
of tenant A mint a wildcard-scope key IN tenant B and authenticate as
tenant B (worse than the revoke IDOR — full takeover).
Fix: ensure_tenant_match(auth, path_tenant) guard on every handler
that binds tenant_id from the path with an AuthContext present
(api_keys create+list, smtp_credentials create+list, inbound_routes
create+list, ip_pools list/assign/unassign/update_priority) — 404
unless path tenant == session tenant, so other tenants' resources
don't leak existence. Tracking endpoints are exempt: their tenant
comes from a signed tracking token, not the client.
Also: migration 003 uses DROP CONSTRAINT IF EXISTS (review NIT), test
file gains a create-scoping regression + a note that the handler
guard is exercised by live post-deploy verification.
Four route handlers discarded the tenant_id path parameter and the
repository SQL had no tenant filter, so an authenticated admin of one
tenant could revoke / delete / disable another tenant's resources by
enumerating UUIDs (cross-tenant IDOR):
- DELETE /v1/tenants/{_}/api-keys/{id}
- DELETE /v1/tenants/{_}/smtp-credentials/{id}
- PUT /v1/tenants/{_}/smtp-credentials/{id}/enabled
- POST /v1/oauth/clients/{id}/revoke + DELETE (same family)
Fix: handlers pass the authenticated session's tenant_id into the
repository, and every affected UPDATE/DELETE adds 'AND tenant_id = $N'.
The SMTP AUTH credential lookup stays intentionally tenant-less (it is
what establishes the session tenant); cross-tenant ambiguity there is
closed by making smtp_credentials.username globally UNIQUE (migration 003
renames existing cross-tenant duplicates deterministically).
Also: refuse to start while the publicly-known bootstrap admin key is
active, unless SENTIO_ALLOW_BOOTSTRAP_KEY=1 (recovery hatch).
Tests: crates/sentio-store/tests/tenant_isolation.rs — two-tenant
regression tests asserting cross-tenant revoke/delete/disable fails,
own-tenant succeeds, plus global username uniqueness. Skipped when
DATABASE_URL is unset.
Four advisories were open against rustls, all fixed in 0.23.46:
RUSTSEC-2026-0346 Debug impls for client session values leak TLS secrets
RUSTSEC-2026-0347
RUSTSEC-2026-0348
RUSTSEC-2026-0349 unauthenticated ServerHello can downgrade a later
connection to classical key exchange
0.23.45 -> 0.23.46 covers one of the two copies. The other was rustls
0.21.12, which is EOL and has no fix on that line. It arrived because
aws-sdk-s3 enables "rustls" by default, which maps through
aws-smithy-runtime/tls-rustls to aws-smithy-http-client's
legacy-rustls-ring. Its own default-https-client already provides HTTPS
over rustls 0.23, so the legacy stack was redundant rather than needed.
Dropping it also removed rustls-webpki 0.101 and h2 0.3 from the tree,
so four ignores in deny.toml are obsolete and go with them. One rustls
version in the lockfile now, and cargo deny passes without them.
Combines all five production fixes rolled out on the RabbitMQ branch
into one patch against the NATS/Trove codebase.
1. STARTTLS handshake timeout. TlsConnector::connect in starttls_upgrade
has no built-in timeout; wrapping it in tokio::time::timeout(
command_timeout) at both call sites (relay path and try_mx_host)
prevents a remote that stalls after ACKing 220 STARTTLS from parking
the delivery future indefinitely and leaking a per-domain pool
permit on every occurrence.
2. Per-MX attempt backstop. deliver_to_domain now wraps each
try_mx_host call in a 5-minute tokio::time::timeout. On elapsed the
next MX is tried; no single await can hang the task.
3. Top-level handler timeout. The MessageHandler impl wraps
self.deliver() in a 10-minute timeout. On elapsed, logs an error
and returns HandlerResult::RetryAfter so JetStream re-delivers the
message after a backoff instead of leaving the task leaked.
4. classify_bounce scans the response text for DNSBL / reputation /
policy keywords (Spamhaus, SORBS, PBL/SBL/XBL, "poor reputation",
"blocked using", "temporarily blocked", etc.) and classifies those
as Block instead of Hard. A 5xx without an enhanced code was
previously treated as a bad address, so any Spamhaus-worded 550 or
"poor reputation" 554 flagged recipients for permanent auto-
suppression even though the problem was ours.
5. Suppressed recipients now go through record_outcome (writing a
Dropped event and publishing to the events exchange) and, when
every recipient is suppressed, the message transitions to
MessageStatus::Dropped. Previously suppressions produced zero rows
in message_events, zero webhooks, and left the message stuck as
`queued` indefinitely. The handler log line for Suppressed is
also promoted from debug to info.
Also adds explicit timeouts to the MTA-STS reqwest client — the
default client has no timeout, so an unresponsive mta-sts.<domain>
policy server would otherwise block the entire delivery task.
routing.rs reads only the category and summary, and the score-band
helper that would apply score_delta has no callers, so the claim that
Jev moves the score was wrong in the README, the changelog and the
provider's own doc comment. The delta is still computed and returned;
the docs now say nothing applies it.
Also corrects the pipeline description: labelling depends on a route
having llm_classify set, not on the score falling in a review band.
Three paragraphs of prose buried in the spam-pipeline section became a
short subsection with a copy-paste config block, a body_mode table and
the measured cost.
The snippet I first wrote would have failed for anyone who used it:
temperature, max_input_tokens and classify_outbound have no serde
defaults, so a partial [llm] block is a fatal config error. Verified the
corrected block by running it through the binary - it reaches 'LLM
backend initialized provider=jev'.
Found by running it in the pipeline rather than against a mock.
config/oss.toml ships base_url = "", which deserializes to Some("")
and not None, so the default never applied and every request built a
relative URL and died in reqwest's builder. All 17 mocked tests passed a
real URL, so none of them could see it.
A builder error is also deterministic, so retrying it spent the whole
backoff budget on every message for a failure that can never clear. Only
failures that reached the network retry now.
In-pipeline result: a phishing message classifies as threat
(unsolicited=0.84, phishing=0.88), an ordinary one as support
(0.16, 0.13), both persisted on the message row and carried on the
webhook payload.
Read their error reference properly this time. It documents 401, 422,
429 and 529 and asks for exponential backoff; my retry was linear, and
treated 503 as transient while ignoring 500. Both of those statuses are
undocumented but observed, so both retry now - a classification has no
side effects beyond billing.
Also corrects the earlier reasoning in this branch: criteria is optional
for a noul, so the request that returned 500 was valid per their docs.
Re-running it once the service recovered returns 200 every time, so that
500 was their instability, not the missing field.
Documents what enabling this actually commits you to: closed weights, no
self-host path, and a service that returned four different failure codes
in one afternoon.
Jev is a structured-decision model: typed questions in, calibrated
probabilities out, no prose. That makes it the first provider that can
return a real score_delta - the chat providers all hardcode 0.0 and only
set a category, so the adjusted_score path in classifier.rs has never
done anything.
Splits LlmProvider into MessageClassifier and ResponseGenerator, since a
decision model can do the first and not the second. LlmProvider stays as
a supertrait with a blanket impl, so the other providers are unaffected.
Pairing jev with auto_respond is refused at startup rather than failing
on the first message that needs a reply.
Verified against the live API. Two things it taught us:
- noul answers carry no confidence field, only choice does, so the
gating uses the category answer's confidence. The mocks are shaped to
match, since a mock with confidence on a noul would test a path that
never runs.
- the service returns 429/503/529 often, so transient statuses get a
bounded retry while 401 and 422 fail immediately.
body_mode controls how much of a message leaves the server. An earlier
include_body bool implied that 'off' kept the body local; it did not - a
preview is a truncation of the body. Three explicit values now.
Removes .github/workflows/ci.yml. Everything it ran lives in
scripts/check.sh instead: fmt, clippy, tests, release build, cargo-deny,
the third-party notices diff and the OpenAPI spec diff. It reports every
failure in one pass rather than stopping at the first.
publish.yml stays - that builds and publishes releases on a tag, which
is not a check.
Contributing guide and pull request template now say plainly that
nothing runs these for you.
0.6 moves SaltString into the phc module and draws the salt inside
hash_password, which now takes one argument. Six call sites, four of
them test helpers.
Adds a test pinning a hash written by 0.5: the PHC format is unchanged,
so stored credentials keep working, and this fails loudly if that ever
stops being true.
Weekly cargo updates with only minor/patch grouped, plus ungrouped
actions, produced six open PRs in a month - four of them one-line action
bumps. Everything is grouped now, majors included, on a monthly
schedule. Security advisories are a separate channel and still open
immediately.
Both are aliases for InitializeResult, so the rename is mechanical, but
the deprecation trips clippy -D warnings. Notices regenerated for the 18
crates in the group.
CI triggered on both push to any branch and pull_request, so every branch
ran twice and main ran again after merge. Push is limited to main now, and
a concurrency group cancels superseded runs. publish gets a group too, but
never cancels - a half-published release leaves a manifest without its
binaries.
Adds a pre-push hook installer for fmt and clippy.
The image now carries both binaries, so the release job lifts sentio-mcp
out of it the same way and no second set of release builds is needed.
Each gets its own archive: an MCP client host does not want the mail
server, and vice versa.
Notices are generated with --workspace now. Without it cargo-about
crawls only the root package, so rmcp and schemars would ship
unattributed.