exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

PuTTY 0.62 Heap Overflow

PuTTY 0.62 Heap Overflow
Posted Aug 6, 2013
Authored by Gergely Eberhardt

PuTTY versions 0.62 and below suffer from an SSH handshake heap overflow vulnerability.

tags | advisory, overflow
advisories | CVE-2013-4852
SHA-256 | e29077b43031296e74b1211a81e961e5d6dfe9cf8695d7e7b120536e82fc21a0

PuTTY 0.62 Heap Overflow

Change Mirror Download
PuTTY SSH handshake heap overflow (CVE-2013-4852)

Description:
PuTTY versions 0.62 and earlier - as well as all software that
integrates these versions of PuTTY - are vulnerable to an integer overflow
leading to heap overflow during the SSH handshake before authentication,
caused
by improper bounds checking of the length parameter received from the
SSH server.
This allows remote attackers to cause denial of service, and may have more
severe impact on the operation of software that uses PuTTY code.

Affected software products:
- PuTTY up to and including 0.62
- WinSCP before 5.1.6
- all other software that uses vulnerable (revision 9895 or earlier)
PuTTY code

Details:
A malformed size value in the SSH handshake could cause an integer
overflow, as
the getstring() function in sshrsa.c and sshdss.c read the handshake
message
length without checking that it was not a negative number.

Specifically, the bignum_from_bytes() function invoked by getstring()
received a
data buffer along with its length represented by a signed integer
(nbytes) and
performed the following arithmetical operation before allocating memory
to store
the buffer:

w = (nbytes + BIGNUM_INT_BYTES - 1) / BIGNUM_INT_BYTES; /*
bytes->words */
result = newbn(w);

If the value of nbytes was -1 (0xffffffff), the value of w would
overflow to a
very small positive number (depending on the value of BIGNUM_INT_BYTES),
causing
newbn() to reserve a very small memory area. Then a large number of
bytes would
be copied into the data buffer afterwards, resulting in a heap overflow.

Similarly, if nbytes was chosen so that w would be -1, the newbn() function
would allocate zero bytes in memory via snewn() and attempt to write the
size of
the Bignum (in four bytes) into the allocated zero-byte area, also
resulting in
a heap overflow.

Consequences:
In the standalone PuTTY client the attacker does not have precise
control over
the memory corruption, so this bug can only cause a local denial-of-service
(crash). However, in other software that uses PuTTY code, such heap
corruption
could have more severe effects. Specifically in case of WinSCP, this
vulnerability could potentially lead to code execution due to the exception
handling employed by the program.

Solution:
This vulnerability has been fixed in the development version of PuTTY
[2]. All
developers using PuTTY code are recommended to use revision 9896 or later.
The potential code execution vulnerability has been addressed in WinSCP
5.1.6
[3].

Credits:
This vulnerability was discovered and researched by Gergely Eberhardt
from SEARCH-LAB Ltd. (www.search-lab.hu)

References:
[1] http://www.search-lab.hu/advisories/secadv-20130722
[2] http://svn.tartarus.org/sgt?view=revision&sortby=date&revision=9896
[3] http://winscp.net/tracker/show_bug.cgi?id=1017
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    19 Files
  • 23
    Jul 23rd
    17 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close