SlideShare a Scribd company logo
Heartbleed Bug– A case study
Adri Jovin J J, M.Tech., Ph.D.
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 2
Heartbleed Bug
• Vulnerability in OpenSSL cryptographic software library
• Allows stealing of information by the SSL/TLS encryption
• SSL/TLS- security and privacy over the internet for most applications
• Discovered by Riku, Antti and Matti at Codenomicon and Neel Mehta
of Google Security and reported on April, 2014
• Allows attackers to
 eavesdrop on communications
 steal data directly from the services and users and
 impersonate services and users
} Release of message content
Masquerading
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 3
Why heartbleed?
Bug discovered in the heartbeat extension of TLS
Exploitation leaked contents from server to client and from client to server
Left a large amount of private keys and other secrets exposed to the internet
Is the protocol specification wrong???
No….problem with implementation…a programming mistake
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 4
What’s wrong with implementation???
Heartbeat message structure:
struct
{
HeartbeatMessageType type;
uint16 payload_length;
opaque payload[HeartbeatMessage.payload_length];
opaque padding[padding_length];
} HeartbeatMessage;
/* Read type and payload length first */
hbtype = *p++;
n2s(p, payload);
pl = p;
Incoming Heartbeat message:
/* Enter response type, length and copy payload */
*bp++ = TLS1_HB_RESPONSE;
s2n(payload, bp);
memcpy(bp, pl, payload);
Response Heartbeat message:
hbtype = *p++;
n2s(p, payload);
if (1 + 2 + payload + 16 > s->s3->rrec.length)
return 0; /* silently discard per RFC 6520 sec. 4 */
pl = p;
Fixed Incoming Heartbeat message:
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 5
What is leaked?
1. Primary key material
2. Secondary key material
3. Protected content
4. Collateral
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 6
Leaked primary key material and
recovery
Leakage
• Encryption keys
• Leaked key allows attacker to decrypt any past or future traffic to protected services and impersonate
Recovery
• Requires vulnerability patch
• Revocation of compromised keys
• Reissuing/redistribution of new keys
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 7
Leaked secondary key material and
recovery
Leakage
• User credentials used in vulnerable services
Recovery
• Restore trust
• Users can change their password and possible encryption keys
• Session keys and session cookies should be invalidated
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 8
Leaked protected content and recovery
Leakage
• Actual content handled by the vulnerable service (e.g.)personal/financial details
Recovery
• Provider should inform users of the leakage
• Restore trust to the primary and secondary key material
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 9
Leaked collateral and recovery
Leakage
• Other details exposed to the attacker in the leaked memory content
• Technical details such as memory addresses and security measures such as canaries
Recovery
• Can be fixed using patch
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 10
Vulnerability of OpenSSL
• OpenSSL 1.0.1 through 1.0.1f (inclusive) are vulnerable
• OpenSSL 1.0.1g is NOT vulnerable
• OpenSSL 1.0.0 branch is NOT vulnerable
• OpenSSL 0.9.8 branch is NOT vulnerable
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 11
Vulnerable Operating Systems
• Debian Wheezy (stable), OpenSSL 1.0.1e-2+deb7u4
• Ubuntu 12.04.4 LTS, OpenSSL 1.0.1-4ubuntu5.11
• CentOS 6.5, OpenSSL 1.0.1e-15
• Fedora 18, OpenSSL 1.0.1e-4
• OpenBSD 5.3 (OpenSSL 1.0.1c 10 May 2012) and 5.4 (OpenSSL 1.0.1c 10 May 2012)
• FreeBSD 10.0 - OpenSSL 1.0.1e 11 Feb 2013
• NetBSD 5.0.2 (OpenSSL 1.0.1e)
• OpenSUSE 12.2 (OpenSSL 1.0.1c)
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 12
Non-vulnerable Operating Systems
• Debian Squeeze (oldstable), OpenSSL 0.9.8o-4squeeze14
• SUSE Linux Enterprise Server
• FreeBSD 8.4 - OpenSSL 0.9.8y 5 Feb 2013
• FreeBSD 9.2 - OpenSSL 0.9.8y 5 Feb 2013
• FreeBSD 10.0p1 - OpenSSL 1.0.1g (At 8 Apr 18:27:46 2014 UTC)
• FreeBSD Ports - OpenSSL 1.0.1g (At 7 Apr 21:46:40 2014 UTC)
20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 13
References
The Heartbleed Bug “https://heartbleed.com/”
What is the Heartbleed bug, how does it work and how was it fixed? “https://www.csoonline.com/article/3223203/what-is-
the-heartbleed-bug-how-does-it-work-and-how-was-it-fixed.html”
Anatomy of OpenSSL's Heartbleed: Just four bytes trigger horror bug
“https://www.theregister.co.uk/2014/04/09/heartbleed_explained/”

More Related Content

PPTX
Heartbleed Bug: A case study
PDF
Managing the SSL Process
PDF
Sergio González - WiFiSlax 4.0 [RootedCON 2010]
PDF
Central Iowa Linux Users Group May 2020 Meeting: WireGuard
PDF
Basic Network Security_Primer
PDF
Zephyr Introduction - Nordic Webinar - Sept. 24.pdf
PDF
Securing your Cloud Environment
PDF
Apache web-server-security
Heartbleed Bug: A case study
Managing the SSL Process
Sergio González - WiFiSlax 4.0 [RootedCON 2010]
Central Iowa Linux Users Group May 2020 Meeting: WireGuard
Basic Network Security_Primer
Zephyr Introduction - Nordic Webinar - Sept. 24.pdf
Securing your Cloud Environment
Apache web-server-security

Similar to Heart Bleed Bug - A case study (Course: Cryptography and Network Security) (20)

PDF
Introduction to Mobile Application Security - Techcity 2015 (Vilnius)
PPSX
Wireless Network Security
PDF
Leverage the Network
PDF
Security events in 2014
PDF
VoIP Wars: Destroying Jar Jar Lync (Unfiltered version)
PPTX
Securing your Cloud Environment v2
PDF
Juniper heartbleed bug
PDF
Cotopaxi - IoT testing toolkit (3rd release - Black Hat Europe 2019 Arsenal)
PPTX
Encryption 2021
PDF
The Considerations for Internet of Things @ 2017
PDF
Decrypting and Selectively Inspecting Modern Traffic
PDF
Protegendo sua cloud
PDF
Securing Data in Transit -
PPTX
Analysis of exposed ICS//SCADA/IoT systems in Europe
PPTX
IoTNEXT 2016 - SafeNation Track
PDF
St Louis Linux Users Group Wireguard (for Fun and Networking)
PDF
Common crypto attacks and secure implementations
PDF
Fundamentals of network hacking
PDF
OpenStack Ops Meetup
PPTX
Обнаружение вредоносного кода в зашифрованном с помощью TLS трафике (без деши...
Introduction to Mobile Application Security - Techcity 2015 (Vilnius)
Wireless Network Security
Leverage the Network
Security events in 2014
VoIP Wars: Destroying Jar Jar Lync (Unfiltered version)
Securing your Cloud Environment v2
Juniper heartbleed bug
Cotopaxi - IoT testing toolkit (3rd release - Black Hat Europe 2019 Arsenal)
Encryption 2021
The Considerations for Internet of Things @ 2017
Decrypting and Selectively Inspecting Modern Traffic
Protegendo sua cloud
Securing Data in Transit -
Analysis of exposed ICS//SCADA/IoT systems in Europe
IoTNEXT 2016 - SafeNation Track
St Louis Linux Users Group Wireguard (for Fun and Networking)
Common crypto attacks and secure implementations
Fundamentals of network hacking
OpenStack Ops Meetup
Обнаружение вредоносного кода в зашифрованном с помощью TLS трафике (без деши...
Ad

More from Adri Jovin (20)

DOCX
Curriculum Vitae of Adri Jovin John Joseph
PPTX
Introduction to Relational Database Management Systems
PPTX
Introduction to ER Diagrams
PPTX
Introduction to Database Management Systems
PPTX
Neural Networks
PPTX
Introduction to Genetic Algorithm
PPTX
Introduction to Fuzzy logic
PPTX
Introduction to Artificial Neural Networks
PPTX
Introductory Session on Soft Computing
PPTX
Creative Commons
PPTX
Image based security
PPTX
Blockchain Technologies
PPTX
Introduction to Cybersecurity
PPTX
Advanced Encryption System & Block Cipher Modes of Operations
PPTX
Zoom: Privacy and Security - A case study
PPTX
Elliptic Curve Cryptography
PPTX
El Gamal Cryptosystem
PPTX
Data Encryption Standard
PPTX
Classical cryptographic techniques, Feistel cipher structure
PPTX
Mathematical Foundations of Cryptography
Curriculum Vitae of Adri Jovin John Joseph
Introduction to Relational Database Management Systems
Introduction to ER Diagrams
Introduction to Database Management Systems
Neural Networks
Introduction to Genetic Algorithm
Introduction to Fuzzy logic
Introduction to Artificial Neural Networks
Introductory Session on Soft Computing
Creative Commons
Image based security
Blockchain Technologies
Introduction to Cybersecurity
Advanced Encryption System & Block Cipher Modes of Operations
Zoom: Privacy and Security - A case study
Elliptic Curve Cryptography
El Gamal Cryptosystem
Data Encryption Standard
Classical cryptographic techniques, Feistel cipher structure
Mathematical Foundations of Cryptography
Ad

Recently uploaded (20)

PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PDF
ETO & MEO Certificate of Competency Questions and Answers
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PPTX
436813905-LNG-Process-Overview-Short.pptx
PPTX
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
PPTX
Glazing at Facade, functions, types of glazing
PPTX
OOP with Java - Java Introduction (Basics)
PDF
flutter Launcher Icons, Splash Screens & Fonts
PPTX
“Next-Gen AI: Trends Reshaping Our World”
PDF
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
PDF
Queuing formulas to evaluate throughputs and servers
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PDF
Geotechnical Engineering, Soil mechanics- Soil Testing.pdf
PPTX
web development for engineering and engineering
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
ETO & MEO Certificate of Competency Questions and Answers
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Simulation of electric circuit laws using tinkercad.pptx
436813905-LNG-Process-Overview-Short.pptx
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
Glazing at Facade, functions, types of glazing
OOP with Java - Java Introduction (Basics)
flutter Launcher Icons, Splash Screens & Fonts
“Next-Gen AI: Trends Reshaping Our World”
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
Queuing formulas to evaluate throughputs and servers
bas. eng. economics group 4 presentation 1.pptx
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Geotechnical Engineering, Soil mechanics- Soil Testing.pdf
web development for engineering and engineering
Model Code of Practice - Construction Work - 21102022 .pdf

Heart Bleed Bug - A case study (Course: Cryptography and Network Security)

  • 1. Heartbleed Bug– A case study Adri Jovin J J, M.Tech., Ph.D. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY
  • 2. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 2 Heartbleed Bug • Vulnerability in OpenSSL cryptographic software library • Allows stealing of information by the SSL/TLS encryption • SSL/TLS- security and privacy over the internet for most applications • Discovered by Riku, Antti and Matti at Codenomicon and Neel Mehta of Google Security and reported on April, 2014 • Allows attackers to  eavesdrop on communications  steal data directly from the services and users and  impersonate services and users } Release of message content Masquerading
  • 3. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 3 Why heartbleed? Bug discovered in the heartbeat extension of TLS Exploitation leaked contents from server to client and from client to server Left a large amount of private keys and other secrets exposed to the internet Is the protocol specification wrong??? No….problem with implementation…a programming mistake
  • 4. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 4 What’s wrong with implementation??? Heartbeat message structure: struct { HeartbeatMessageType type; uint16 payload_length; opaque payload[HeartbeatMessage.payload_length]; opaque padding[padding_length]; } HeartbeatMessage; /* Read type and payload length first */ hbtype = *p++; n2s(p, payload); pl = p; Incoming Heartbeat message: /* Enter response type, length and copy payload */ *bp++ = TLS1_HB_RESPONSE; s2n(payload, bp); memcpy(bp, pl, payload); Response Heartbeat message: hbtype = *p++; n2s(p, payload); if (1 + 2 + payload + 16 > s->s3->rrec.length) return 0; /* silently discard per RFC 6520 sec. 4 */ pl = p; Fixed Incoming Heartbeat message:
  • 5. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 5 What is leaked? 1. Primary key material 2. Secondary key material 3. Protected content 4. Collateral
  • 6. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 6 Leaked primary key material and recovery Leakage • Encryption keys • Leaked key allows attacker to decrypt any past or future traffic to protected services and impersonate Recovery • Requires vulnerability patch • Revocation of compromised keys • Reissuing/redistribution of new keys
  • 7. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 7 Leaked secondary key material and recovery Leakage • User credentials used in vulnerable services Recovery • Restore trust • Users can change their password and possible encryption keys • Session keys and session cookies should be invalidated
  • 8. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 8 Leaked protected content and recovery Leakage • Actual content handled by the vulnerable service (e.g.)personal/financial details Recovery • Provider should inform users of the leakage • Restore trust to the primary and secondary key material
  • 9. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 9 Leaked collateral and recovery Leakage • Other details exposed to the attacker in the leaked memory content • Technical details such as memory addresses and security measures such as canaries Recovery • Can be fixed using patch
  • 10. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 10 Vulnerability of OpenSSL • OpenSSL 1.0.1 through 1.0.1f (inclusive) are vulnerable • OpenSSL 1.0.1g is NOT vulnerable • OpenSSL 1.0.0 branch is NOT vulnerable • OpenSSL 0.9.8 branch is NOT vulnerable
  • 11. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 11 Vulnerable Operating Systems • Debian Wheezy (stable), OpenSSL 1.0.1e-2+deb7u4 • Ubuntu 12.04.4 LTS, OpenSSL 1.0.1-4ubuntu5.11 • CentOS 6.5, OpenSSL 1.0.1e-15 • Fedora 18, OpenSSL 1.0.1e-4 • OpenBSD 5.3 (OpenSSL 1.0.1c 10 May 2012) and 5.4 (OpenSSL 1.0.1c 10 May 2012) • FreeBSD 10.0 - OpenSSL 1.0.1e 11 Feb 2013 • NetBSD 5.0.2 (OpenSSL 1.0.1e) • OpenSUSE 12.2 (OpenSSL 1.0.1c)
  • 12. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 12 Non-vulnerable Operating Systems • Debian Squeeze (oldstable), OpenSSL 0.9.8o-4squeeze14 • SUSE Linux Enterprise Server • FreeBSD 8.4 - OpenSSL 0.9.8y 5 Feb 2013 • FreeBSD 9.2 - OpenSSL 0.9.8y 5 Feb 2013 • FreeBSD 10.0p1 - OpenSSL 1.0.1g (At 8 Apr 18:27:46 2014 UTC) • FreeBSD Ports - OpenSSL 1.0.1g (At 7 Apr 21:46:40 2014 UTC)
  • 13. 20IT021 CRYPTOGRAPHY AND NETWORK SECURITY 13 References The Heartbleed Bug “https://heartbleed.com/” What is the Heartbleed bug, how does it work and how was it fixed? “https://www.csoonline.com/article/3223203/what-is- the-heartbleed-bug-how-does-it-work-and-how-was-it-fixed.html” Anatomy of OpenSSL's Heartbleed: Just four bytes trigger horror bug “https://www.theregister.co.uk/2014/04/09/heartbleed_explained/”