Re: Preventing Denial of Service Attack In IPC Serialization
On Jul 9, 4:17 pm, Hyman Rosen <hyro...@mail.com> wrote:
Le Chaud Lapin wrote:
....however, eventually, after the receiver pieces together the 64KB
chunks, the string will be 16MB long in the end?
No. The idea is that the receiver knows that no legitimate string that
it expects to see will ever exceed 16MB, and so rejects any attempt by
a sender to exceed that limit. The sending party and receiving party
(humans, not computers) will have to negotiate the limit upwards if it
is truly necessary.
The receiver isn't saying "break it into smaller pieces", it is saying
"you cannot send me a string that is more than 16MB". If the receiver
does not have a preset size limit, then it cannot distinguish between a
a very large legitimate request and a DoS attack.
Right.
Actually, the pro-buffer people are saying that the string should be
broken into smaller pieces.
David Harris, for example, indicated that the amount of data allowed
into the receiver should be roughly proportional to the amount of data
sent.
I keep saying that, no matter which pre-set limit is chosen, that if
it is fixed, it is inappropriate. If it is dynamic, it is
inappropriate if it is done in the manner in which some people propose
(not using the Archive or objects themselves).
If the size is fix, it will be too small for some situations, and too
large for others.
If the size is dynamic, then there will be great convolution of the
serialization library, unless the sizes are established dynamically
deep inside the object hierarchy. Someone implied earlier that
"serialization code does not need to be in a library". I am guessing
that, in their model, every time a piece of data is transferred over a
socket, a buffer is allocated first, not by the library writer, but by
the programmer using the library. This would be extremely wasteful,
as in the case where a legitimate 16MB is about to be sent, their
model would call for pre-allocating, or allocating-and-reallocating
buffers to be received from, while my method requires no buffers at
all.
-Le Chaud Lapin-
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]