ID:

CVE-2014-0160 (NVD)

- Vulnerability Info (edit)
2014-04-07

Heartbleed - The (1) TLS and (2) DTLS implementations in OpenSSL 1.0.1 before 1.0.1g do not properly handle Heartbeat Extension packets, which allows remote attackers to obtain sensitive information from process memory via crafted packets that trigger a buffer over-read, as demonstrated by reading private keys, related to d1_both.c and t1_lib.c, aka the Heartbleed bug.

Products openssl
Type Improper Restriction of Operations within the Bounds of a Memory Buffer (CWE-119)
First patch
2014-04-07
http://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=96db9023b881d7cd9f379b0c154650d6c108e9a3
"Add heartbeat extension bounds check. A missing bounds check in the handling of the TLS heartbeat extension can be used to reveal up to 64k of memory to a connected client or server. Thanks for Neel Mehta of Google Security for discovering this bug and to Adam Langley <agl@chromium.org> and Bodo Moeller <bmoeller@acm.org> for preparing the..."
fix (CVE-2014-0160)


Stats: +36 lines / -13 lines (total: 49 lines)
Patches https://gist.github.com/chapmajs/10473815
http://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=96db9023b881d7cd9f379b0c154650d6c108e9a3
Relevant file/s • ./ssl/t1_lib.c
• ./ssl/d1_both.c
• ./CHANGES (modified, +9)
Links http://www.us-cert.gov/ncas/alerts/TA14-098A
http://rhn.redhat.com/errata/RHSA-2014-0396.html
http://marc.info/?l=bugtraq&m=139757726426985&w=2
http://download.schneider-electric.com/files?p_Doc_Ref=SEVD%202014-119-01
http://lists.fedoraproject.org/pipermail/package-announce/2014-April/131291.html
Annotation
Detailed repository view
The Hearbleed bug is an issue with the Heartbeat protocol that is used for [...]. It allows an attacker to exfiltrate up to 16 KB memory data from a target running a vulnerable OpenSSL version.
`pl` points at the reserved heartbeat data buffer. This buffer will be returned back to the user later on.
Allocate up to 1 + 2 + 65535(`payload`)+16(`padding`)=65554 bytes in `buffer` referenced as `bp`. Note that there is no bounds check in place for the user-supplied payload length `payload`.
The macro s2n takes a 16-bit value and writes two bytes to `bp`.
Copies `payload` bytes (up to 64KB) from `pl` (pointing on the resulting heartbeat buffer) into `bp`. The critical part is that `payload` (the user-supplied payload length) can be greater than the actual size of the `pl` memory segment leading to an out-of-bounds read effectively copying parts of the memory into `bp`.
The `buffer` with the memory is now sent back to the user effectively allowing an attacker to leak memory from the heap.
The same bug also exists in the dtls implementation.