Continued attacks on HTTP/2
Continued attacks on HTTP/2
Posted Apr 15, 2024 12:22 UTC (Mon) by wtarreau (subscriber, #51152)In reply to: Continued attacks on HTTP/2 by epa
Parent article: Continued attacks on HTTP/2
What we need is computer teachers explaining first how to exploit a parser bug via a config file, a log line, a large HTTP header, etc so that early developers keep this in mind and never ever start with a bad habit. Laziness should not be an option. In parallel, compilers should make it easier to write correct code. For now they're doing the opposite, they're making it ultra-difficult to write correct code, forcing users to case, put attributes and what not to shut stupid warnings, so the simplest path to valid code is the least safe.
Posted Apr 15, 2024 12:47 UTC (Mon)
by Cyberax (✭ supporter ✭, #52523)
[Link] (1 responses)
When I was studying at a university about 25 years ago, we actually had a mandatory course where we wrote an exploit, with simple shell code, for a deliberately vulnerable server written in C. So people certainly know about the danger of OOB access.
Posted Apr 16, 2024 3:23 UTC (Tue)
by wtarreau (subscriber, #51152)
[Link]
Posted Apr 15, 2024 13:30 UTC (Mon)
by farnz (subscriber, #17727)
[Link]
The person I worked with who was worst for writing code with security bugs was taught in exactly the way you describe; his attitude after graduating was that this was "just theory", and therefore he didn't have to care about secure handling of predictable errors since "it crashes, so we'll know if it's got a bug because we'll get bug reports". He was great at exploiting bugs, but useless at preventing them.
IME, the thing that helps you learn is to work in languages where you simply cannot write certain classes of bug without a compiler error; writing code that compiles in Agda is a lot harder to learn to do than writing code that C compilers will accept, but if you're used to thinking in terms of "how do I write this in a way that the compiler can see is bug-free?", you're better at writing code that is genuinely bug free, even when you then learn how to write C (albeit that you're also more likely to write a program extractor that takes your Agda, removes the proof-related bits, and outputs C).
Posted Apr 15, 2024 19:52 UTC (Mon)
by epa (subscriber, #39769)
[Link] (1 responses)
Posted Apr 16, 2024 11:05 UTC (Tue)
by paulj (subscriber, #341)
[Link]
This solved the problem of buffer overflows. However, we would still generally have a DoS security bug from the process ending itself. Obviously, an abort() and possible DoS is still /way/ better than an overflow and RCE security bug, but also still not ideal.
The next challenge was to make the parsers logically robust. Memory safe languages do not solve this.
Explicit state machines, in languages (programming or DSLs) that can verify error events are always handled (e.g., by proceeding to some common error state) can help. And even C these days can trivially ensure that all events are handled in an a state machine. Requires programmer discipline though.
It's worth noting in this story (IIUC) that the implementations in "memory safe" languages were vulnerable to the bug, and implementation in the "unsafe" language was not. ;)
Continued attacks on HTTP/2
Continued attacks on HTTP/2
Continued attacks on HTTP/2
Continued attacks on HTTP/2
Continued attacks on HTTP/2