SlideShare a Scribd company logo
1 of 26
Heartbleed Attack
- Shreyas Kothari
(140302003)
M.Tech (CNIS)
Manipal University Jaipur
Introduction
• Heartbleed is a security bug disclosed in April 2014 in the OpenSSL
cryptography library, which is a widely used for the implementation of
the Transport Layer Security (TLS) protocol.
• Heartbleed may be exploited regardless of whether the party using a
vulnerable OpenSSL instance for TLS is a server or a client.
• It results from improper input validation (due to a missing bounds
check) in the implementation of the TLS heartbeat extension, thus
the bug's name derives from "heartbeat”.
• The vulnerability is classified as a buffer over-read, a situation where
more data can be read than should be allowed.
OpenSSL
• OpenSSL is an open-source implementation of the SSL and TLS
protocols. The core library, written in the C programming language,
implements basic cryptographic functions and provides various utility
functions.
• The OpenSSL project was founded in 1998 to invent a free set of
encryption tools for the code used on the Internet. As of 2014 two
thirds of all webservers use it.
Heartbeat Extension
• The Heartbeat Extension provides a new protocol for TLS/DTLS
allowing the usage of keep-alive functionality without performing a
renegotiation.
• TLS is based on reliable protocols, but there is no feature available to
keep the connection alive without continuous data transfer.
• The Heartbeat Extension overcomes these limitations.
• The user can use the new HeartbeatRequest message, which has to
be answered by the peer with a HeartbeartResponse immediately.
Heartbeat Hello Extension
• A peer cannot only indicate that its implementation supports
Heartbeats, it can also choose whether it is willing to receive
HeartbeatRequest messages and respond with HeartbeatResponse
messages or only willing to send HeartbeatRequest messages.
• The former is indicated by using peer_allowed_to_send as the
HeartbeatMode; the latter is indicated by using
peer_not_allowed_to_send as the Heartbeat mode.
• This decision can be changed with every renegotiation.
The Heartbeat Protocol
• The Heartbeat protocol is a new protocol running on top of the
Record Layer. The protocol itself consists of two message types:
HeartbeatRequest and HeartbeatResponse.
• A HeartbeatRequest message can arrive almost at any time during the
lifetime of a connection.
• There must not be more than one HeartbeatRequest message in flight
at a time. A HeartbeatRequest message is considered to be in flight
until the corresponding HeartbeatResponse message is received, or
until the retransmit timer expires.
Heartbeat Request / Response Message
• The Heartbeat protocol messages consist of their type and an
arbitrary payload and padding.
• struct {
HeartbeatMessageType type;
uint16 payload_length;
opaque payload[HeartbeatMessage.payload_length];
opaque padding[padding_length];
} HeartbeatMessage;
Heartbeat Request / Response Message
• The total length of a HeartbeatMessage must not exceed 2^14 Bytes.
• type : The message type; either heartbeat_request or
heartbeat_response.
• payload_length : The length of the payload.
• payload : The payload consists of arbitrary content.
• Padding : It can be any random content and the sender of this
message must use at least 16 Bytes of padding.
Working
• When a HeartbeatRequest message is received and sending a
HeartbeatResponse is not prohibited, the receiver must send a
corresponding HeartbeatResponse message carrying an exact copy of
the payload of the received HeartbeatRequest.
• If a received HeartbeatResponse message does not contain the
expected payload, the message must be discarded. If it does contain
the expected payload, the retransmission timer must be stopped.
The Heartbleed Attack
• We had discussed earlier in the introduction part that this attack was
made possible because of the improper input validation of the TLS
Heartbeat extension. The vulnerability lies in the payload variable.
• Ideally the code must check the payload data length with the actual
length of data sent in the Heartbeat request, but it isn’t checking it.
• So if the payload exceeds the standard length in the request, the
server may return more data in response than what it should ideally
return.
The Heartbleed Attack
• This is a case of Buffer Overflow (BoF). Look at the following
vulnerable code:
The Heartbleed Attack
• The rrec contains all the incoming request data. The code reads the
data. The first byte is to check if it’s a Heartbeat protocol and then
another 2 bytes determine the length of the Heartbeat payload.
• Ideally the length of the payload must be equal to the payload_length
sent in the Heartbeat request. But as discussed, the code is not
checking actual length sent in the Heartbeat request.
The Heartbleed Attack
• So the code copies the amount of data requested by incoming
requests to the outgoing server response and possibly more than
requested in some cases.
• This may leak valuable information to attackers, such as session IDs,
tokens, keys, etc.
The Heartbleed Attack
• Let us try to understand this with the help of one scenario.
The Heartbleed Attack
The Heartbleed Attack
The Heartbleed Attack
What can be leaked ?
• As said earlier, much sensitive information from the server’s memory
can be sent in through the response.
• Some of them are session-related information such as session ID,
different tokens, keys, and some other sensitive internal information
such as queries, internal data, etc.
• The next image shows a real example of what we can receive in the
responses.
What can be leaked ?
Solution
• This vulnerability lies in the OpenSSL version 1.0.1f and 1.0.2 – beta1.
• Affected users should upgrade to OpenSSL 1.0.1g.
• Users unable to immediately upgrade can alternatively recompile
OpenSSL with -DOPENSSL_NO_HEARTBEATS.
• OpenSSL version 1.0.2 will be fixed in 1.0.2 – beta2.
To check whether your
website is safe visit
1) https://lastpass.com/heartbleed/
2) https://filippo.io/Heartbleed/
jaipur.manipal.edu
ams.muj.edu.in
Question ??
References
1. RFC 6520 - https://tools.ietf.org/html/rfc6520
2. www.heartbleed.com
3. Infosec Institute - http://resources.infosecinstitute.com/exploiting-
heartbleed/
4. https://xkcd.com/1354/
5. https://www.openssl.org/news/secadv_20140407.txt
6. https://lastpass.com/heartbleed/
OpenSSL Heartbleed Attack Explained

More Related Content

What's hot

Secure Code Warrior - CRLF injection
Secure Code Warrior - CRLF injectionSecure Code Warrior - CRLF injection
Secure Code Warrior - CRLF injectionSecure Code Warrior
 
Chapter 9 PowerPoint
Chapter 9 PowerPointChapter 9 PowerPoint
Chapter 9 PowerPointAmy McMullin
 
Web Security Attacks
Web Security AttacksWeb Security Attacks
Web Security AttacksSajid Hasan
 
Hashing vs Encryption vs Encoding
Hashing vs Encryption vs EncodingHashing vs Encryption vs Encoding
Hashing vs Encryption vs EncodingCheapSSLsecurity
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016bugcrowd
 
Ransomware Attack.pptx
Ransomware Attack.pptxRansomware Attack.pptx
Ransomware Attack.pptxIkramSabir4
 
Pentesting custom TLS stacks
Pentesting custom TLS stacksPentesting custom TLS stacks
Pentesting custom TLS stacksAlexandre Moneger
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityAbdul Wahid
 
Denial of Service Attacks (DoS/DDoS)
Denial of Service Attacks (DoS/DDoS)Denial of Service Attacks (DoS/DDoS)
Denial of Service Attacks (DoS/DDoS)Gaurav Sharma
 
Chapter 5 Presentation
Chapter 5 PresentationChapter 5 Presentation
Chapter 5 PresentationAmy McMullin
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key CryptosystemDevakumar Kp
 
Basics of Network Security
Basics of Network SecurityBasics of Network Security
Basics of Network SecurityDushyant Singh
 
Nmap basics
Nmap basicsNmap basics
Nmap basicsitmind4u
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap OWASP Delhi
 
Ssl (Secure Sockets Layer)
Ssl (Secure Sockets Layer)Ssl (Secure Sockets Layer)
Ssl (Secure Sockets Layer)Asad Ali
 

What's hot (20)

Nikto
NiktoNikto
Nikto
 
Web security
Web securityWeb security
Web security
 
Kali linux tutorial
Kali linux tutorialKali linux tutorial
Kali linux tutorial
 
Secure Code Warrior - CRLF injection
Secure Code Warrior - CRLF injectionSecure Code Warrior - CRLF injection
Secure Code Warrior - CRLF injection
 
Chapter 9 PowerPoint
Chapter 9 PowerPointChapter 9 PowerPoint
Chapter 9 PowerPoint
 
Web Security Attacks
Web Security AttacksWeb Security Attacks
Web Security Attacks
 
Hashing vs Encryption vs Encoding
Hashing vs Encryption vs EncodingHashing vs Encryption vs Encoding
Hashing vs Encryption vs Encoding
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016
 
Ransomware Attack.pptx
Ransomware Attack.pptxRansomware Attack.pptx
Ransomware Attack.pptx
 
Pentesting custom TLS stacks
Pentesting custom TLS stacksPentesting custom TLS stacks
Pentesting custom TLS stacks
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Denial of Service Attacks (DoS/DDoS)
Denial of Service Attacks (DoS/DDoS)Denial of Service Attacks (DoS/DDoS)
Denial of Service Attacks (DoS/DDoS)
 
SSL TLS Protocol
SSL TLS ProtocolSSL TLS Protocol
SSL TLS Protocol
 
Chapter 5 Presentation
Chapter 5 PresentationChapter 5 Presentation
Chapter 5 Presentation
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
 
ARP Spoofing.pptx
ARP Spoofing.pptxARP Spoofing.pptx
ARP Spoofing.pptx
 
Basics of Network Security
Basics of Network SecurityBasics of Network Security
Basics of Network Security
 
Nmap basics
Nmap basicsNmap basics
Nmap basics
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
 
Ssl (Secure Sockets Layer)
Ssl (Secure Sockets Layer)Ssl (Secure Sockets Layer)
Ssl (Secure Sockets Layer)
 

Viewers also liked

Heartbleed Explained
Heartbleed ExplainedHeartbleed Explained
Heartbleed ExplainedMike Chapple
 
What is Heartbleed?
What is Heartbleed?What is Heartbleed?
What is Heartbleed?Blue Coat
 
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and SolutionHeartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and SolutionCASCouncil
 
How to Protect Yourself From Heartbleed Security Flaw
How to Protect Yourself From Heartbleed Security FlawHow to Protect Yourself From Heartbleed Security Flaw
How to Protect Yourself From Heartbleed Security FlawConnectSafely
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets PresentationVolodymyr Lavrynovych
 
Heartache and Heartbleed - 31c3
Heartache and Heartbleed - 31c3Heartache and Heartbleed - 31c3
Heartache and Heartbleed - 31c3Nick Sullivan
 
Reverse Engineering the TomTom Runner pt. 2
Reverse Engineering the TomTom Runner pt. 2Reverse Engineering the TomTom Runner pt. 2
Reverse Engineering the TomTom Runner pt. 2Luis Grangeia
 
Image secret sharing using Shamir's Algorithm
Image secret sharing using Shamir's AlgorithmImage secret sharing using Shamir's Algorithm
Image secret sharing using Shamir's AlgorithmNikita Kasar
 
Heartbleed && Wireless
Heartbleed && WirelessHeartbleed && Wireless
Heartbleed && WirelessLuis Grangeia
 
Image secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with SteganographyImage secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with Steganography2510stk
 

Viewers also liked (13)

Heartbleed Explained
Heartbleed ExplainedHeartbleed Explained
Heartbleed Explained
 
What is Heartbleed?
What is Heartbleed?What is Heartbleed?
What is Heartbleed?
 
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and SolutionHeartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
 
Poodles!!!
Poodles!!!Poodles!!!
Poodles!!!
 
How to Protect Yourself From Heartbleed Security Flaw
How to Protect Yourself From Heartbleed Security FlawHow to Protect Yourself From Heartbleed Security Flaw
How to Protect Yourself From Heartbleed Security Flaw
 
Heartbleed
HeartbleedHeartbleed
Heartbleed
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentation
 
Heartache and Heartbleed - 31c3
Heartache and Heartbleed - 31c3Heartache and Heartbleed - 31c3
Heartache and Heartbleed - 31c3
 
Reverse Engineering the TomTom Runner pt. 2
Reverse Engineering the TomTom Runner pt. 2Reverse Engineering the TomTom Runner pt. 2
Reverse Engineering the TomTom Runner pt. 2
 
Image secret sharing using Shamir's Algorithm
Image secret sharing using Shamir's AlgorithmImage secret sharing using Shamir's Algorithm
Image secret sharing using Shamir's Algorithm
 
Heartbleed && Wireless
Heartbleed && WirelessHeartbleed && Wireless
Heartbleed && Wireless
 
Image secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with SteganographyImage secret sharing using Shamir's scheme with Steganography
Image secret sharing using Shamir's scheme with Steganography
 
Cybersecurity 2 cyber attacks
Cybersecurity 2 cyber attacksCybersecurity 2 cyber attacks
Cybersecurity 2 cyber attacks
 

Similar to OpenSSL Heartbleed Attack Explained

Report on Heartbleed
Report on HeartbleedReport on Heartbleed
Report on HeartbleedShiva Sagar
 
Transport Layer Security
Transport Layer SecurityTransport Layer Security
Transport Layer SecurityHuda Seyam
 
Session for InfoSecGirls - New age threat management vol 1
Session for InfoSecGirls - New age threat management vol 1Session for InfoSecGirls - New age threat management vol 1
Session for InfoSecGirls - New age threat management vol 1InfoSec Girls
 
BAIT1103 Chapter 4
BAIT1103 Chapter 4BAIT1103 Chapter 4
BAIT1103 Chapter 4limsh
 
Server Load Balancer Test Methodology
Server Load Balancer Test MethodologyServer Load Balancer Test Methodology
Server Load Balancer Test MethodologyIxia
 
Anatomy behind Fast Data Applications.pptx
Anatomy behind Fast Data Applications.pptxAnatomy behind Fast Data Applications.pptx
Anatomy behind Fast Data Applications.pptxdusavamsikrisna
 
Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfShivakrishnan18
 
Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guideSrihari
 
Arun prjct dox
Arun prjct doxArun prjct dox
Arun prjct doxBaig Mirza
 
network attacks
network attacks network attacks
network attacks MuskanSony
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocolsFabMinds
 
HTTP Request Smuggling
HTTP Request SmugglingHTTP Request Smuggling
HTTP Request SmugglingAkash Ashokan
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)Gurjot Singh
 
Hypertexttransferprotocolhttp 131012171813-phpapp02
Hypertexttransferprotocolhttp 131012171813-phpapp02Hypertexttransferprotocolhttp 131012171813-phpapp02
Hypertexttransferprotocolhttp 131012171813-phpapp02Nidhitransport
 
DDOS Mitigation Experience from IP ServerOne by CL Lee
DDOS Mitigation Experience from IP ServerOne by CL LeeDDOS Mitigation Experience from IP ServerOne by CL Lee
DDOS Mitigation Experience from IP ServerOne by CL LeeMyNOG
 

Similar to OpenSSL Heartbleed Attack Explained (20)

Heartbleed
HeartbleedHeartbleed
Heartbleed
 
Report on Heartbleed
Report on HeartbleedReport on Heartbleed
Report on Heartbleed
 
Transport Layer Security
Transport Layer SecurityTransport Layer Security
Transport Layer Security
 
Session for InfoSecGirls - New age threat management vol 1
Session for InfoSecGirls - New age threat management vol 1Session for InfoSecGirls - New age threat management vol 1
Session for InfoSecGirls - New age threat management vol 1
 
BAIT1103 Chapter 4
BAIT1103 Chapter 4BAIT1103 Chapter 4
BAIT1103 Chapter 4
 
HTTP(Hyper Text Transfer Protocol)
HTTP(Hyper Text Transfer Protocol)HTTP(Hyper Text Transfer Protocol)
HTTP(Hyper Text Transfer Protocol)
 
Chat application
Chat applicationChat application
Chat application
 
Server Load Balancer Test Methodology
Server Load Balancer Test MethodologyServer Load Balancer Test Methodology
Server Load Balancer Test Methodology
 
Anatomy behind Fast Data Applications.pptx
Anatomy behind Fast Data Applications.pptxAnatomy behind Fast Data Applications.pptx
Anatomy behind Fast Data Applications.pptx
 
Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdf
 
Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guide
 
Arun prjct dox
Arun prjct doxArun prjct dox
Arun prjct dox
 
network attacks
network attacks network attacks
network attacks
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Addios!
Addios!Addios!
Addios!
 
Http smuggling 1 200523064027
Http smuggling 1 200523064027Http smuggling 1 200523064027
Http smuggling 1 200523064027
 
HTTP Request Smuggling
HTTP Request SmugglingHTTP Request Smuggling
HTTP Request Smuggling
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 
Hypertexttransferprotocolhttp 131012171813-phpapp02
Hypertexttransferprotocolhttp 131012171813-phpapp02Hypertexttransferprotocolhttp 131012171813-phpapp02
Hypertexttransferprotocolhttp 131012171813-phpapp02
 
DDOS Mitigation Experience from IP ServerOne by CL Lee
DDOS Mitigation Experience from IP ServerOne by CL LeeDDOS Mitigation Experience from IP ServerOne by CL Lee
DDOS Mitigation Experience from IP ServerOne by CL Lee
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 

OpenSSL Heartbleed Attack Explained

  • 1. Heartbleed Attack - Shreyas Kothari (140302003) M.Tech (CNIS) Manipal University Jaipur
  • 2. Introduction • Heartbleed is a security bug disclosed in April 2014 in the OpenSSL cryptography library, which is a widely used for the implementation of the Transport Layer Security (TLS) protocol. • Heartbleed may be exploited regardless of whether the party using a vulnerable OpenSSL instance for TLS is a server or a client. • It results from improper input validation (due to a missing bounds check) in the implementation of the TLS heartbeat extension, thus the bug's name derives from "heartbeat”. • The vulnerability is classified as a buffer over-read, a situation where more data can be read than should be allowed.
  • 3. OpenSSL • OpenSSL is an open-source implementation of the SSL and TLS protocols. The core library, written in the C programming language, implements basic cryptographic functions and provides various utility functions. • The OpenSSL project was founded in 1998 to invent a free set of encryption tools for the code used on the Internet. As of 2014 two thirds of all webservers use it.
  • 4. Heartbeat Extension • The Heartbeat Extension provides a new protocol for TLS/DTLS allowing the usage of keep-alive functionality without performing a renegotiation. • TLS is based on reliable protocols, but there is no feature available to keep the connection alive without continuous data transfer. • The Heartbeat Extension overcomes these limitations. • The user can use the new HeartbeatRequest message, which has to be answered by the peer with a HeartbeartResponse immediately.
  • 5. Heartbeat Hello Extension • A peer cannot only indicate that its implementation supports Heartbeats, it can also choose whether it is willing to receive HeartbeatRequest messages and respond with HeartbeatResponse messages or only willing to send HeartbeatRequest messages. • The former is indicated by using peer_allowed_to_send as the HeartbeatMode; the latter is indicated by using peer_not_allowed_to_send as the Heartbeat mode. • This decision can be changed with every renegotiation.
  • 6. The Heartbeat Protocol • The Heartbeat protocol is a new protocol running on top of the Record Layer. The protocol itself consists of two message types: HeartbeatRequest and HeartbeatResponse. • A HeartbeatRequest message can arrive almost at any time during the lifetime of a connection. • There must not be more than one HeartbeatRequest message in flight at a time. A HeartbeatRequest message is considered to be in flight until the corresponding HeartbeatResponse message is received, or until the retransmit timer expires.
  • 7. Heartbeat Request / Response Message • The Heartbeat protocol messages consist of their type and an arbitrary payload and padding. • struct { HeartbeatMessageType type; uint16 payload_length; opaque payload[HeartbeatMessage.payload_length]; opaque padding[padding_length]; } HeartbeatMessage;
  • 8. Heartbeat Request / Response Message • The total length of a HeartbeatMessage must not exceed 2^14 Bytes. • type : The message type; either heartbeat_request or heartbeat_response. • payload_length : The length of the payload. • payload : The payload consists of arbitrary content. • Padding : It can be any random content and the sender of this message must use at least 16 Bytes of padding.
  • 9. Working • When a HeartbeatRequest message is received and sending a HeartbeatResponse is not prohibited, the receiver must send a corresponding HeartbeatResponse message carrying an exact copy of the payload of the received HeartbeatRequest. • If a received HeartbeatResponse message does not contain the expected payload, the message must be discarded. If it does contain the expected payload, the retransmission timer must be stopped.
  • 10. The Heartbleed Attack • We had discussed earlier in the introduction part that this attack was made possible because of the improper input validation of the TLS Heartbeat extension. The vulnerability lies in the payload variable. • Ideally the code must check the payload data length with the actual length of data sent in the Heartbeat request, but it isn’t checking it. • So if the payload exceeds the standard length in the request, the server may return more data in response than what it should ideally return.
  • 11. The Heartbleed Attack • This is a case of Buffer Overflow (BoF). Look at the following vulnerable code:
  • 12. The Heartbleed Attack • The rrec contains all the incoming request data. The code reads the data. The first byte is to check if it’s a Heartbeat protocol and then another 2 bytes determine the length of the Heartbeat payload. • Ideally the length of the payload must be equal to the payload_length sent in the Heartbeat request. But as discussed, the code is not checking actual length sent in the Heartbeat request.
  • 13. The Heartbleed Attack • So the code copies the amount of data requested by incoming requests to the outgoing server response and possibly more than requested in some cases. • This may leak valuable information to attackers, such as session IDs, tokens, keys, etc.
  • 14. The Heartbleed Attack • Let us try to understand this with the help of one scenario.
  • 18. What can be leaked ? • As said earlier, much sensitive information from the server’s memory can be sent in through the response. • Some of them are session-related information such as session ID, different tokens, keys, and some other sensitive internal information such as queries, internal data, etc. • The next image shows a real example of what we can receive in the responses.
  • 19. What can be leaked ?
  • 20. Solution • This vulnerability lies in the OpenSSL version 1.0.1f and 1.0.2 – beta1. • Affected users should upgrade to OpenSSL 1.0.1g. • Users unable to immediately upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS. • OpenSSL version 1.0.2 will be fixed in 1.0.2 – beta2.
  • 21. To check whether your website is safe visit 1) https://lastpass.com/heartbleed/ 2) https://filippo.io/Heartbleed/
  • 25. References 1. RFC 6520 - https://tools.ietf.org/html/rfc6520 2. www.heartbleed.com 3. Infosec Institute - http://resources.infosecinstitute.com/exploiting- heartbleed/ 4. https://xkcd.com/1354/ 5. https://www.openssl.org/news/secadv_20140407.txt 6. https://lastpass.com/heartbleed/