For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | 2014-04-07register
Stories from April 7, 2014
Go back a day, month, or year. Go forward a day, month, or year.
1.Show HN: Untrusted, a JavaScript adventure game you play by modifying its source (nisnevich.com)
555 points by alnis on April 7, 2014 | 235 comments
2.Comic Sans, meet Comic Neue (comicneue.com)
521 points by calibwam on April 7, 2014 | 157 comments
3.Raspberry Pi Compute Module (raspberrypi.org)
356 points by markhemmings on April 7, 2014 | 113 comments
4.How Zidisha (YC W14) Is Misleading the Public About Its Interest Rates (modernmicrocredit.blogspot.com)
364 points by modernm on April 7, 2014 | 128 comments
5.Superhero.js – One stop for JS Knowledge (superherojs.com)
322 points by sayanchowdhury on April 7, 2014 | 29 comments
6.Reasons Not To Raise Venture Capital (modelviewculture.com)
327 points by aaronbrethorst on April 7, 2014 | 85 comments
7.OpenSSL Security Advisory: TLS heartbeat read overrun (openssl.org)
297 points by moonboots on April 7, 2014 | 85 comments
8.The Decline of the Mobile Web (cdixon.org)
266 points by goronbjorn on April 7, 2014 | 202 comments
9.Yahoo breaks every mailing list in the world including the IETF's (ietf.org)
256 points by somerandomness on April 7, 2014 | 114 comments

There was a discussion here a few years ago (https://news.ycombinator.com/item?id=2686580) about memory vulnerabilities in C. Some people tried to argue back then that various protections offered by modern OSs and runtimes, such as address space randomization, and the availability of tools like Valgrind for finding memory access bugs, mitigates this. I really recommend re-reading that discussion.

My opinion, then and now, is that C and other languages without memory checks are unsuitable for writing secure code. Plainly unsuitable. They need to be restricted to writing a small core system, preferably small enough that it can be checked using formal (proof-based) methods, and all the rest, including all application logic, should be written using managed code (such as C#, Java, or whatever - I have no preference).

This vulnerability is the result of yet another missing bound check. It wasn't discovered by Valgrind or some such tool, since it is not normally triggered - it needs to be triggered maliciously or by a testing protocol which is smart enough to look for it (a very difficult thing to do, as I explained on the original thread).

The fact is that no programmer is good enough to write code which is free from such vulnerabilities. Programmers are, after all, trained and skilled in following the logic of their program. But in languages without bounds checks, that logic can fall away as the computer starts reading or executing raw memory, which is no longer connected to specific variables or lines of code in your program. All non-bounds-checked languages expose multiple levels of the computer to the program, and you are kidding yourself if you think you can handle this better than the OpenSSL team.

We can't end all bugs in software, but we can plug this seemingly endless source of bugs which has been affecting the Internet since the Morris worm. It has now cost us a two-year window in which 70% of our internet traffic was potentially exposed. It will cost us more before we manage to end it.

11.Halide, a language for image processing and computational photography (halide-lang.org)
194 points by roquin on April 7, 2014 | 36 comments
12.Show HN: An open-source, Raspberry-Pi-based Siri alternative (jasperproject.github.io)
191 points by shbhrsaha on April 7, 2014 | 81 comments
13.Oracle kills third-party JD Edwards reference website (jderef.com)
189 points by shrikant on April 7, 2014 | 90 comments
14.US burns through all high-skill visas for 2015 in less than a week (techcrunch.com)
189 points by sbashyal on April 7, 2014 | 197 comments
15.What Really Happened in that Double-Blind Violin Sound Test (violinist.com)
177 points by yonibot on April 7, 2014 | 90 comments
16.Fourier series visualisation with D3.js (ocks.org)
170 points by bprs on April 7, 2014 | 19 comments
17.S.F. cracks down on Airbnb rentals (sfgate.com)
181 points by timr on April 7, 2014 | 260 comments
18.Is Google crippling Firefox? (medium.com/p)
165 points by fivre on April 7, 2014 | 60 comments
19.R: the good parts (hackerretreat.com)
157 points by urlwolf on April 7, 2014 | 50 comments
20.Dead Man's Switch (deadmansswitch.org)
154 points by AndyBaker on April 7, 2014 | 99 comments
21.One reason we lack Internet competition: Starting an ISP is hard (arstechnica.com)
148 points by nols on April 7, 2014 | 56 comments
22.Why and How to Start Your SICP Trek (hackerretreat.com)
144 points by limist on April 7, 2014 | 60 comments
23.The Fall of Hacker Groups (phrack.org)
152 points by timgluz on April 7, 2014 | 62 comments
24.A dose of perspective (watsi.org)
141 points by gracegarey on April 7, 2014 | 38 comments
25.Internal Apple document: FY'14 Planning Offsite (scribd.com)
131 points by molf on April 7, 2014 | 196 comments
26.Don't design your own REST back end (plus.google.com)
135 points by rograndom on April 7, 2014 | 75 comments
27.Steve Jobs’ Itinerary for Apple's 2011 Top 100 Meeting (rapgenius.com)
129 points by sarreph on April 7, 2014 | 40 comments
28.Cover is joining Twitter (coverscreen.com)
132 points by mikeevans on April 7, 2014 | 73 comments
29.Ethereum, Bitcoin’s most ambitious successor (aljazeera.com)
129 points by Libertatea on April 7, 2014 | 52 comments

From a quick reading of the TLS heartbeat RFC and the patched code, here's my understanding of the cause of the bug.

TLS heartbeat consists of a request packet including a payload; the other side reads and sends a response containing the same payload (plus some other padding).

In the code that handles TLS heartbeat requests, the payload size is read from the packet controlled by the attacker:

  n2s(p, payload);
  pl = p;
Here, p is a pointer to the request packet, and payload is the expected length of the payload (read as a 16-bit short integer: this is the origin of the 64K limit per request).

pl is the pointer to the actual payload in the request packet.

Then the response packet is constructed:

  /* Enter response type, length and copy payload */
  *bp++ = TLS1_HB_RESPONSE;
  s2n(payload, bp);
  memcpy(bp, pl, payload);
The payload length is stored into the destination packet, and then the payload is copied from the source packet pl to the destination packet bp.

The bug is that the payload length is never actually checked against the size of the request packet. Therefore, the memcpy() can read arbitrary data beyond the storage location of the request by sending an arbitrary payload length (up to 64K) and an undersized payload.

I find it hard to believe that the OpenSSL code does not have any better abstraction for handling streams of bytes; if the packets were represented as a (pointer, length) pair with simple wrapper functions to copy from one stream to another, this bug could have been avoided. C makes this sort of bug easy to write, but careful API design would make it much harder to do by accident.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You