sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sks-devel] simple DoS against SKS's HKP interface :/


From: Yaron Minsky
Subject: Re: [Sks-devel] simple DoS against SKS's HKP interface :/
Date: Sun, 6 May 2012 09:29:54 -0400

There may be a way around this problem now, but really, to make SKS good at this kind of situation,s omeone needs to port SKS to a concurrency library like LWT or Async.  That will make it much easier to deal with these problems, and to be able to handle multiple concurrent clients properly.

Unfortunately, I don't expect to have the time to do such a port myself.

y

On Wed, Apr 25, 2012 at 4:40 AM, Kim Minh Kaplan <address@hidden> wrote:
John Clizbe writes:

> Oddly, I was looking at a different problem last night and noticed this
> snippet appearing twice in wserver.ml:
>
> 188-189
> let rec parse_headers map cin =
>   let line = input_line cin in (* DOS attack: input_line is unsafe on
> sockets *)
>
> 201-202
> let parse_request cin =
>   let line = input_line cin in (* DOS attack: input_line is unsafe on
> sockets *)
>
> So, it would appear to my barely apprentice level OCaml, that our
> solution lies in a socket-safe implementation of input_line

I suspect it is more involved and that here all that "unsafe" really
means is that it can block. But you can not really avoid this blocking
with TCP: it is a consequence of the reliability it provides. All the
solutions for handling this blocking phenomenon will involve multiple
simultaneous sockets handling and therefore either multiprocessing or
select-like interface... That is Daniel Kahn Gillmor's suggestion. Also
note that blocking can also occur during writes so prints are also
"unsafe".

Installing a proxy to handle all this sounds like the easiest way to go.
But I do not know enough about those to be certain that they handle all
cases of blocking. I'm specifically wary about malicious slow POST and
prints.
--
Kim Minh

_______________________________________________
Sks-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/sks-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]