This release includes 3 security fixes for security teams reviewing exposed deployments.
Topics
+8 more
Affected surfaces
Summary
AI summaryPOST /execute now requires RULE_WRITE permission and WAL/snapshot strict decryption is on by default.
Full changelog
Second wave of security fixes on top of v0.3.7. All 764 tests pass.
🛡️ Security
High
- Trusted-proxy-aware rate limiting —
AuthInterceptorand/auth/bootstrapnow honourX-Forwarded-Forwhen the TCP peer is listed inTRUSTED_PROXY_IPS. Without this, every client behind a reverse proxy shared a single bucket (DoS vector) and attackers upstream of the proxy could evade the limit entirely.
Medium
- Strict GCM decrypt for WAL + snapshots — when
ENCRYPTION_KEYis configured, lines/files that fail auth are skipped rather than silently accepted as plaintext, blocking injection of replayable records by someone with filesystem access. SetSTORAGE_STRICT_DECRYPT=falsefor a one-off legacy-data migration. - Log-injection guard —
CallLoggingsanitizes URI andX-Database/X-Tenant-IDheaders before logging (strips CRLF + control chars, caps length). POST /admin/backups— validates thedbquery param viaValidatorand returns only the relative backup name (previously leaked the absolute server-side path).POST /inferresult cap — bounded byINFERENCE_MAX_RESULTS(default 10 000) to prevent OOM from cartesian rule expansion.- Atomic snapshot rename —
SnapshotManager.saveSnapshotnow usesFiles.move(ATOMIC_MOVE, REPLACE_EXISTING)instead of the silent-failFile.renameTo.
Low
- API key pepper — when
API_KEY_PEPPERis set, new keys are stored asHMAC-SHA256(pepper, key). Legacy SHA-256 keys continue to validate for rolling migration. /llm.txtfilter — no longer advertises/admin/*,/auth/*(except/auth/status), or/replication/*routes. It was unauthenticated and functioning as a discovery aid.POST /executerequiresRULE_WRITE(wasFACT_WRITE) — the DSL is strictly more powerful than any single/assert/*route.- Parser command cap —
PARSER_MAX_COMMANDS(default 10 000) guards/executeagainst DoS via oversized scripts.
🔧 New environment variables
| Variable | Default | Purpose |
|----------|---------|---------|
| TRUSTED_PROXY_IPS | (empty) | Comma-separated proxy IPs whose X-Forwarded-For header is trusted |
| STORAGE_STRICT_DECRYPT | true | Fail-closed on GCM auth errors when ENCRYPTION_KEY is set |
| INFERENCE_MAX_RESULTS | 10000 | Cap on /infer response cardinality |
| PARSER_MAX_COMMANDS | 10000 | Cap on commands per /execute payload |
| API_KEY_PEPPER | (empty) | Secret used to HMAC API keys at rest; opt-in for new keys |
⚠️ Breaking changes
POST /executenow requiresRULE_WRITE. Any writer-scoped key that previously called/executemust be upgraded or the traffic moved to the narrower/assert/*routes.- WAL / snapshot strict decrypt is on by default. If your deployment has a mix of legacy plaintext and encrypted storage, set
STORAGE_STRICT_DECRYPT=falseduring migration.
Still on the backlog (tracked for a follow-up)
- SSE per-principal concurrency + idle-timeout caps
- Broader narrowing of
catch (Exception) { e.message }inAdminRoutesbeyond/admin/backups
Full diff: https://github.com/Auctalis/nocturnusai/compare/v0.3.7...v0.3.8
Breaking Changes
- POST /execute now requires RULE_WRITE permission (previously accepted FACT_WRITE).
- WAL and snapshot strict decryption is enabled by default when ENCRYPTION_KEY is set; legacy plaintext storage must opt out via STORAGE_STRICT_DECRYPT=false during migration.
Security Fixes
- High severity fix: AuthInterceptor and /auth/bootstrap now honour X-Forwarded-For from trusted proxies (prevents DoS vector).
- Medium severity fixes: Strict GCM decrypt for WAL/snapshots skips invalid records; Log-injection guard sanitizes headers; /admin/backups param validation prevents path leakage; /infer result cap prevents OOM; Atomic snapshot rename uses atomic move.
- Low severity fixes: API key pepper adds HMAC storage option; /llm.txt route filtering removes admin/auth/replication endpoints; Parser command cap via PARSER_MAX_COMMANDS.
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About Auctalis/nocturnusai
Deterministic reasoning engine for AI agent context compression. Extracts structured facts with logical inference, proof chains, and truth maintenance. REST API, Python/TypeScript SDKs, and MCP server integration.
Related context
Related tools
Beta — feedback welcome: [email protected]