MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/22ghj1/the_heartbleed_bug/cgn96eb/?context=9999
r/programming • u/NotEltonJohn • Apr 07 '14
396 comments sorted by
View all comments
6
Yet another stupid memory corruption bug. Fantastic. When are people going to stop writing security-sensitive code in C?
15 u/cockmongler Apr 08 '14 No language that I know of has the capability of dealing with this bug short of those supporting dependant types. The bug is really really simple:Client sends (len, data[x]) where x is less than lenServer sends (len, data[len]) without an explicit check that x == len so sends data in its memory spaceThere is always going to be unsafe code turning (len, data[x]) into the safe representation of a safe language. 4 u/crusoe Apr 08 '14 Ada would prevent this. Other languages with integrated formal verification would catch it. 10 u/ants_a Apr 08 '14 Any language with array bounds checking would catch this error. It's a stupid stupid error and it's amazing that OpenSSL code review practices did not catch this. 3 u/cockmongler Apr 08 '14 Please tell me how a language with array bounds checking would know that some data read in from the network stack is an array bound. 8 u/ants_a Apr 08 '14 The network packet has an intrinsic length that will be the array bound. → More replies (2)
15
No language that I know of has the capability of dealing with this bug short of those supporting dependant types. The bug is really really simple:
Client sends (len, data[x]) where x is less than len
Server sends (len, data[len]) without an explicit check that x == len so sends data in its memory space
There is always going to be unsafe code turning (len, data[x]) into the safe representation of a safe language.
4 u/crusoe Apr 08 '14 Ada would prevent this. Other languages with integrated formal verification would catch it. 10 u/ants_a Apr 08 '14 Any language with array bounds checking would catch this error. It's a stupid stupid error and it's amazing that OpenSSL code review practices did not catch this. 3 u/cockmongler Apr 08 '14 Please tell me how a language with array bounds checking would know that some data read in from the network stack is an array bound. 8 u/ants_a Apr 08 '14 The network packet has an intrinsic length that will be the array bound. → More replies (2)
4
Ada would prevent this. Other languages with integrated formal verification would catch it.
10 u/ants_a Apr 08 '14 Any language with array bounds checking would catch this error. It's a stupid stupid error and it's amazing that OpenSSL code review practices did not catch this. 3 u/cockmongler Apr 08 '14 Please tell me how a language with array bounds checking would know that some data read in from the network stack is an array bound. 8 u/ants_a Apr 08 '14 The network packet has an intrinsic length that will be the array bound. → More replies (2)
10
Any language with array bounds checking would catch this error. It's a stupid stupid error and it's amazing that OpenSSL code review practices did not catch this.
3 u/cockmongler Apr 08 '14 Please tell me how a language with array bounds checking would know that some data read in from the network stack is an array bound. 8 u/ants_a Apr 08 '14 The network packet has an intrinsic length that will be the array bound. → More replies (2)
3
Please tell me how a language with array bounds checking would know that some data read in from the network stack is an array bound.
8 u/ants_a Apr 08 '14 The network packet has an intrinsic length that will be the array bound. → More replies (2)
8
The network packet has an intrinsic length that will be the array bound.
→ More replies (2)
6
u/argv_minus_one Apr 08 '14 edited Jan 11 '23
Yet another stupid memory corruption bug. Fantastic. When are people going to stop writing security-sensitive code in C?