First published: Tue Oct 30 2012(Updated: )
Florian Weimer of the Red Hat Product Security Team reported many instances of overflow checks in libssh's buffer.c that were incorrect: if ((buffer->pos + hostlen) > buffer->used) { This should probably be: if (hostlen > buffer->used - buffer->pos) { It seems this could be used to trigger a large memory allocation which is immediately freed, so this is mostly harmless (not exploitable for code execution or denial of service). A similar problem occurs in buffer_add_data(): if (buffer->allocated < (buffer->used + len)) { len should stand on its own. Likewise in buffer_prepend_data(): if (buffer->allocated < (buffer->used - buffer->pos + len)) { And buffer_pass_bytes(), buffer_pass_bytes_end(), buffer_get_mpint(): if(buffer->used < buffer->pos+len) if(buffer->used < buffer->pos + len) if ((buffer->pos + len) > buffer->used) { While it is not certain that any of these are actually be exploitable, the checks are incorrect and need to be fixed.
Credit: secalert@redhat.com
Affected Software | Affected Version | How to fix |
---|---|---|
Libssh Libssh | <=0.5.2 | |
Libssh Libssh | =0.4.7 | |
Libssh Libssh | =0.4.8 | |
Libssh Libssh | =0.5.0 | |
Libssh Libssh | =0.5.0-rc1 | |
Libssh Libssh | =0.5.1 | |
redhat/libssh | <0.5.3 | 0.5.3 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.