J-Security Center

Title: Sshd RSAREF Buffer Overflow Vulnerability

Severity: CRITICAL

Description:

There is a serious remote buffer overflow vulnerability in ssh 1.2.27 and previous versions if it is compiled with RSAREF. The vulnerable buffer is input_data[MAX_RSA_MODULUS_LEN], defined in rsa_private_decrypt() and passed by reference to several different functions along with the length of the buffer. In one function, mp_linearize_msb_first(), the length of the actual buffer is not checked against the length value that it is passed while it is being written to. This allows for injection and possible execution of malicious arbitrary code.

It is not that simple, however.

The data which is written to input_data[] are the limbs of the multiple precision integer that session_key_int (from the client to the server) would normally be. To successfully exploit this, the egg must hidden in a precision integer which will lay out correct shellcode in the buffer when its limbs are extracted.

Though it is a little more complicated to exploit, it is still very serious and the patch posted to BugTraq should be applied immediately.

Affected Products:

  • SSH Communications Security SSH 1.2.27

References:

Juniper Networks provides this content via a wide variety of sources and production methods. If notified of errors or omissions in the content of this page, Juniper Networks, at its discretion, will modify or remove the page or leave the content as is, depending on various factors including but not limited to the reputation and authority of the party providing the notification. Please use the contact information displayed elsewhere on this page to report any errors or omissions regarding the content on this page.