Conversation
861de5b to
8dfef30
Compare
Postgres cannot store NUL in text/jsonb columns, so an event carrying \u0000 in its content or a tag value passed validation and then failed at insert time, surfacing as a 500 internal error instead of a clean invalid: rejection. Fixes block#3116 Signed-off-by: Rocco Vaccone <rocco@vaccone.us>
8dfef30 to
9befca9
Compare
🔐 Codex Security Review
|
|
Bump on this one. Open since July 27 with no review, and CI hasn't run yet because the workflows are still waiting on maintainer approval (fork PR). Could someone approve the run and take a look? One file, +56 lines, fixes #3116, which is still open and still 500s on any event with an embedded NUL. Happy to rebase onto current main if that helps. |
Events with
\u0000in content or a tag value pass signature verification, thenfail at Postgres insert with
invalid byte sequence for encoding "UTF8": 0x00,surfacing as a 500. Postgres text and jsonb cannot contain the NUL character.
Fixes #3116.
ingest_event_innernow rejects NUL in content or any tag element, next to thecontent size check. Both transports route through it.
id,pubkey, andsigare hex and cannot carry NUL; profiles (kind 0) and workflow definitions
(kind 30620) are ordinary events, so the paths named in the issue are covered.
Verified live: 500 before, 400
invalid: content contains a NUL characterorinvalid: tag value contains a NUL characterafter, no row written, cleanevents unaffected. Four unit tests added; fmt and clippy pass. The 9 failing
buzz-relay --libtests also fail at the merge base (noted as preexistingin #3128).