chiark / gitweb /
SECURITY: actually reject messages with improper lengths
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Jun 2012 20:42:32 +0000 (21:42 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2012 19:02:09 +0000 (20:02 +0100)
commit20138876b39edc6b9bbcc79789c5aa1a684d3312
treefac7196ad5d8ae680e6de30a56330c1d7e1415a8
parentbdd4351ff2fc6dc8b1dad689f751ac46347636cf
SECURITY: actually reject messages with improper lengths

transform_reverse checks to see if the incoming message is a multiple
of the block cipher block size.  If the message fails this check, it
sets *errmsg but it fails to return.  Instead, it proceeds to attempt
to decrypt it.  This will involve a buffer read/write overrun.

It transform_reverse fails to check to see if the incoming message is
long enough to contain the IV, MAC and padding.  This can easily be
exploited to cause secnet to segfault.

buffer_unprepend should check that the buffer has enough data in it to
unprepend.  With the other patches, this should be irrelevant, but it
turns various other potential read overrun bugs into crashes.

site_incoming should check that the incoming message is long enough.
Again, without this, this is an buffer read overrun or possibly a
segfault.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
site.c
transform.c
util.c