https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8590

            Bug ID: 8590
           Summary: spamd: a client can hold a child with no time limit
                    (PING and SKIP headers, a long unknown request line)
           Product: Spamassassin
           Version: 4.0.2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: spamc/spamd
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: Undefined

Created attachment 6313
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=6313&action=edit
patch to read PING and SKIP headers under the socket timeout and cut the echo
of an unknown request line

This is hardening of spamd, not a fix for a vulnerability. spamd relies on
being accessed only by trusted clients. By default it binds to a loopback
interface only. --allowed-ips names the authorized hosts that can connect.
Trusting clients is still different from letting one that stalls part way
through a request keep a child busy with no time limit.

A client can hold a spamd child for as long as it keeps the connection open, by
sending a PING or SKIP request line and nothing more. spamd reads the headers
of those requests with no timeout. With the two children that spamd starts by
default both held, no other client gets an answer. A request line of a few
megabytes with no known command holds a child the same way when the client does
not read the reply, because spamd writes the line back whole. It also logs the
whole line. The POD of --timeout-tcp incorrectly says it bounds the wait for
headers. It bounds only the request line.

The attached patch reads the headers of PING and SKIP under the --timeout-tcp
alarm, as the request line is read. It writes back and logs at most 256 bytes
of an unknown line. It corrects the POD of --timeout-tcp and --timeout-child.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to