Date: 25 November 2026. Scope: src/crypto, src/acl.rs, src/server (HTTP, auth, audit, cluster), src/wal.rs, index persistence, document parsers, CLI flag handling, Docker / Helm, Python connectors.
| # | Finding | Impact | Fix |
|---|
| 1 | SSO tokens were accepted without an audience check when --jwt-audience was not given | a token the company IdP issued for any other application would open synrag | --jwt-audience is required with --jwks / HS256; --jwt-any-audience waives it explicitly |
| 2 | Conflicting duplicate Content-Length headers were not rejected (first one used); +4 style values accepted | request smuggling behind a proxy that reads the other header | conflicting or non-digit lengths → 400 |
| 3 | No deadline on reading a started request | slow-header / slow-body (slowloris) clients hold workers | headers within 10 s; body at ≥ 64 KB/s after a 10 s grace → 408 |
| 4 | termstats (cluster phase one) returned document frequencies over all documents to any reader | a restricted user could test whether a word occurs in documents they may not see | only callers with read-all get it; for others the coordinator falls back to shard-local idf |
| 5 | Index snapshots, journals and audit logs were created with the default mode (usually 0644) | other accounts on the host could read document text and audit records | created 0600; warning if the encryption key file is readable by others |
| 6 | Encrypted journal records were authenticated individually only | with write access to the disk (no key), records could be reordered, deleted from the middle, or an older journal restored next to a newer snapshot (resurrecting deleted documents) | each record's associated data = journal magic + snapshot generation + record position; snapshots store the current and previous generation. Reordering, deletion in the middle and foreign journals fail authentication; records of the previous generation (crash between snapshot and journal reset) are dropped, not replayed |
| 7 | Text-format request logs printed URL-decoded paths raw | %0A in a path forges log lines | control characters replaced in text logs (JSON logs were already escaped) |
| 8 | Index decoding sized buffers from counts in the file | a corrupted snapshot could request a huge allocation and abort | capacities bounded by the file size |
| 9 | CLI switches --trust-proxy, --metrics-public, --insecure-no-auth were parsed as options taking a value | the next option was swallowed: in the Helm chart --trust-proxy --acl-default deny silently dropped deny | switches declared; any option followed by another option is treated as a switch |
| 10 | (from fuzzing) release builds used panic = "abort"; PDF parser out-of-range panic; no total decompression budget or nesting limit for archives | one malformed upload could stop the server; zip bombs | panic = "unwind" + isolation of parser and request panics; PDF fix; 1 GB budget per document, nesting depth 4 |
| # | Item | Result |
|---|
| 11 | HTTP framing beyond Content-Length (RFC 9112): space before the colon, obsolete line folding, bare CR, non-token header names, control characters, missing / duplicate Host, request-target forms | all refused with 400 (absolute-form is accepted as RFC 9112 requires: the path is used). Probes through nginx 1.27 with keep-alive to the backend (CL.TE, TE.CL, CL.CL, space-colon, obs-fold TE, xchunked, TE with tab, bare CR, duplicate Host): no request was smuggled to synrag |
| 12 | Writes partially applied (one replica yes, one no) and concurrent writers in different order | per-source write versions, last writer wins on every replica, tombstones for deletes; write_ack all / available; stale replicas excluded from reads and repaired automatically; replica import holds writes across fetch and swap |
| 13 | Rollback of a whole data volume (consistent older snapshot + journal) | state anchor outside the data volume (HMAC) refuses older data at start (with encryption at rest) |
| 14 | Audit log rewritten as a whole with a recomputed chain | HMAC checkpoints to an external sink; audit-verify --anchors |
| 15 | Key rotation | synrag rekey |
| 16 | Unprotected node-to-node traffic | cluster refuses remote replicas without a declared transport; Helm: Istio STRICT mTLS / Linkerd, NetworkPolicy; tested with ghostunnel mutual TLS across two machines |
| # | Item | Result |
|---|
| 17 | Equal versions from two coordinators could be applied in different orders | versions carry a 12-bit node id: never equal across coordinators; strictly increasing per coordinator (unit test: 10 000 versions, no collision) |
| 18 | Last-writer-wins is not strict consistency | compare-and-set if_version on add / delete (all-or-nothing, 409 with the current version) |
| 19 | Replica repair by snapshot copy loses writes accepted on the other side of a partition | repair merges in both directions by version (documents with ACLs, tombstones); test: two replicas with diverging writes, a newer delete and a version conflict converge to the same state |
| 20 | Anchor not synced on every write | synced by default; --state-anchor-sync off documented as an explicit trade-off |
| 21 | Durability of acknowledged writes unspecified | contract per write_ack mode and failure in ENTERPRISE.md |
| 22 | Interrupted key rotation | rekey is atomic per file and idempotent |
| 23 | Timing side channels | dudect-style Welch t-test (examples/ct_timing.rs): with a leaky early-exit compare as positive control ( | t | 8 000–13 000), ct_eq, the AEAD tag check (bad tag at byte 0 vs 15), API-key verification (stored hash differing at the first vs the last byte), HMAC and ChaCha20-Poly1305 with key A vs key B: max | t | below 4.5 (1 M measurements per test; HMAC A-vs-B 1.2–4.4 on a noisy laptop, not growing with the sample size). A fixed-vs-random-key comparison shows a signal that changes between machines (ChaCha20 0.4 on the server, 13–15 on the laptop) while key A vs key B stays clean — an effect of the CPU repeating identical inputs, not of the key value; it is reported, not used for the verdict. This is a statistical test, not a proof |
| # | Item | Result |
|---|
| 24 | Defect found from the reviewer's scenario. With write_ack: available, a write could be acknowledged by a replica other than the primary (primary cut off). After the primary came back — before repair — a conditional write expecting the pre-partition version was decided on the primary's stale copy: 200, and its decided version then overwrote the acknowledged write on the other replica | reproduced by a test (failed: 200 instead of 409). Fix: in available mode the coordinator collects the document's version from every other replica first; the primary checks the precondition against the newest copy (409 with that version; primary marked stale and merged); a replica that does not answer → 503. New route versions requires role write (versions reveal whether a document exists). With all the primary holds every acknowledged write and decides alone (no extra round trip) |
| 25 | Node ids could be left to chance (random 12-bit id when node_id was missing) | node_id required (number, or "ordinal" from the host name; Helm: coordinator StatefulSet); with a service key each coordinator leases its id on every shard replica (30 s, renewed every 3 s): a second coordinator with the same id does not start, a coordinator that lost its lease refuses writes; /node-claim requires role admin (tested) |
| 26 | The guide said a partition merge loses no accepted write | corrected: replicas converge to the newest version of every document; for a document changed on both sides only the later change survives (LWW); conditional writes cannot succeed on both sides |
| 27 | Concurrency test size (20 rounds) | 400 rounds (200 with write_ack: all, 200 with available), two coordinators, repeated 5 times: always exactly one 200 and one 409, replicas identical |