intelmq icon indicating copy to clipboard operation
intelmq copied to clipboard

Nullbytes can still be an issue in SQL output to JSONB

Open kamil-certat opened this issue 3 months ago • 0 comments

The PostgreSQL JSOB column explicitly disallow saving nullbytes like \u0000: https://www.postgresql.org/docs/current/datatype-json.html This has been previously addressed in https://github.com/certtools/intelmq/issues/2203

Yet, the fix based on simply replace causes another issue: if the data contains already escaped \\u0000, it will be rewritten to \\\u0000, effectively unescaping the data.

At the moment, the simplest working solution I see is removing the nullbyte at all.

kamil-certat avatar Sep 23 '25 07:09 kamil-certat