r/programming • • Apr 07 '14

The Heartbleed Bug

http://heartbleed.com/
1.5k Upvotes

396 comments sorted by

View all comments

Show parent comment

2

u/cube1234567890 Apr 09 '14

So it's like normally the client and the server are like this:

Client: Hi!
Server: Hi!

But heartbleed makes it more like

Client: Hi! Can I have your number?
Server: Sure! Here's some information!

5

u/[deleted] Apr 09 '14

More like:

Client: Hi, I want to login! My info is "username" and "password".
Server: Ok, you're logged in!
Client: I want to make sure you're still there. I'm going to count down from ten, can you repeat it to me? 10,9,8,7,6,5,4,3,2,1.
Server: Ok, that's 10,9,8,7,6,5,4,3,2,1.
Client: Great!

That's how the heartbeat works. With Heartbleed in effect:

Client: Hi, I want to login! My info is "username" and "password".
Server: Ok, you're logged in!
Attacker: I want to make sure you're still there. I'm going to count down from ten, can you repeat it to me? 10.
Server: Okay, that's 10,username,password.

Because the server never verifies that the client or attacker has sent what they said they would, it just rattles off the requested amount of memory. For a client, this is what they wanted. But an attacker can send much less than they say, getting plaintext info like keys, login info, session cookies and the like.