![]() |
|
Message-ID: <0e66197d-9ccd-4e03-948d-e96d2cd2e465@gmail.com> Date: Thu, 29 May 2025 09:54:18 +0200 From: Gabriel Ravier <gabravier@...il.com> To: musl@...ts.openwall.com, Rich Felker <dalias@...c.org>, whistle@...l.ustc.edu.cn Subject: Re: Potential Injection Vulnerability in _vsyslog Function On 5/9/25 1:02 AM, Rich Felker wrote: > On Thu, May 08, 2025 at 11:14:55PM +0800, whistle@...l.ustc.edu.cn wrote: >> In the current _vsyslog function, if the log contains characters >> like \r or \n, according to CWE-93: Improper Neutralization of CRLF >> Sequences ('CRLF Injection'), this could potentially lead to an >> injection vulnerability. >> >> >> When using musl, would it be safer to explicitly handle \r and \n >> here as an extra security measure? > I don't think there's any reason we should be munging the contents of > the log message here. The syslogd receiving the datagram is free to > reject embedded newlines (meaning \n; \r is completely irrelevant here > AFAICT) or store them in some storage-backend-specific way. If it > stores them in a manner where they can be misinterpreted as the start > of a new log record with different process credentials, that seems > like a weakness in the syslogd not in the libc. Especially since > someone wanting to do that could just write their own client sending > the datagrams with embedded newlines to /dev/log, no? > > Rich I imagine for the last question the idea is that a program that lets someone log arbitrary data (or that one can trick into doing so) could be used for this (I otherwise fully agree with the rest of the analysis - it doesn't seem like a real concern given it shouldn't matter unless syslogd is already grievously broken).
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.