]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Tweak bounds checks in pageant_add_keyfile.
authorSimon Tatham <anakin@pobox.com>
Mon, 23 Jan 2017 20:08:18 +0000 (20:08 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 29 Jan 2017 22:50:30 +0000 (22:50 +0000)
commit54cc0c5b296ee7c27b48a3c8e7aead6e74f2abf1
treeaadab4edf6e9f1708a3390eadff83ed87d1c0781
parent4ff22863d895cb7ebfced4cf923a012a614adaa8
Tweak bounds checks in pageant_add_keyfile.

When we're going through the response from an SSH agent we asked for a
list of keys, and processing the string lengths in the SSH-2 sequence
of (public blob, comment) pairs, we were adding 4 to each string
length, and although we checked if the result came out to a negative
value (if interpreted as a signed integer) or a positive one going
beyond the end of the response buffer, we didn't check if it wrapped
round to a positive value less than 4. As a result, if an agent
returned malformed data sent a length field of 0xFFFFFFFC, the pointer
would advance no distance at all through the buffer, and the next
iteration of the loop would check the same length field again.

(However, this would only consume CPU pointlessly for a limited time,
because the outer loop up to 'nkeys' would still terminate sooner or
later. Also, I don't think this can sensibly be classed as a serious
security hazard - it's arguably a borderline DoS, but it requires a
hostile SSH _agent_ if data of that type is to be sent on purpose, and
an untrusted SSH agent is not part of the normal security model!)
pageant.c