OxBat opened a new pull request, #587:
URL: https://github.com/apache/logging-log4cxx/pull/587

   ### Summary
   I identified a Denial of Service vulnerability in `TelnetAppender`.
   The appender performs synchronous blocking I/O on the logging thread.
   
   **The Attack (Slow Consumer):**
   If a connected Telnet client refuses to read data (e.g., malicious 
"Slowloris" style attack or network stall), the server's TCP Send Buffer fills 
up.
   Once full, the `write()` call blocks indefinitely because there was no 
timeout configured.
   Since Appenders are synchronized (mutex locked), this single blocked thread 
halts ALL logging threads, causing the entire application to hang/freeze.
   
   **The Fix:**
   1.  **Socket API:** Added `virtual void setSoTimeout(int)` to the `Socket` 
interface.
   2.  **TelnetAppender:** * Calls `newClient->setSoTimeout(1000)` immediately 
upon connection.
       * Catches `InterruptedIOException` in the `write()` loop. If a write 
blocks for > 1000ms, the connection is considered dead/malicious and is dropped 
to unblock the application.
   
   ### Impact
   This prevents a trivial remote DoS where a single unauthenticated connection 
could freeze the host application.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to