Otherwise you may have a command injection vulnerability similar to what matrix-appservice-irc used to have: https://pktz.fr/matrix/security/2022-appservice-irc-command-... (though with carriage returns instead of null bytes)
> You need to split on (or sanitize) null bytes
Do you mean splitting on (or sanitising of) carriage returns (CR or 0xD) and newlines (LF or 0xA)? I read your security advisory and as far as I understand, the issue occurs due to improper handling of CR and LF characters. I don't see anything about null bytes there.
Some IRC servers (especially those written in C) may interpret it as a line end, so you would have a similar issue
It is late here but I have pushed a quick fix to plug this loophole: <https://github.com/susam/nimb/commit/1c02137>. Review comments, feedback, pull requests, patches, etc. are very welcome! Thank you for this comment thread which has been constructive as well as productive.
If you find any issues, bugs, etc. in this tool, please let me know. Although this tool works well for my modest requirements, someone else may find issues while using this tool that I have not encountered yet. In such a case, bug reports, pull requests, patches, etc. are very welcome!