-
Notifications
You must be signed in to change notification settings - Fork 1.7k
in_syslog: fix null byte handling in message parsing #10437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Is that true?
So, non-transparent framing messages contain null byte as a one of the delimiter. So, it's still required to handle null-byte should be treated as a delimiter. |
This PR is controversial and open to debate. My interpretation here is If we're using non-transparent framing null bytes could be treated as delimiters, but If a message legitimately contains a null byte within its content (not as a Perhaps the best option here is to (need your feedback)
|
I'd like to choose 1. behavior. Behavior 2. should be chosen but we need to refer the octet count and to use the count for determinating that a null-byte should be able to skip / safe to skip within the non-framing messages. |
Description
Null bytes in syslog messages are incorrectly treated as message delimiters, causing message fragmentation and parser errors. This violates RFC 6587 section 3.4.1 which specifies that for octet-counting framing, only the calculated length determines message boundaries, and section 3.4.2 which specifies newline as the delimiter for non-transparent framing.
Current behaviour
When a syslog message contains a null byte, the parser treats it as a message boundary:
Expected behaviour
Null bytes should be preserved in message content and not treated as delimiters:
Changes
Modified
syslog_prot_process()
to skip null bytes when scanning for message boundaries, only treating newlines as delimiters per RFC 6587 section 3.4.2.Fixes #2741