5 ms·
> and actually knowing, on code level, how it manifests and how you avoid these things You avoid them by using tools that make it difficult or impossible to in
by p-e-w 3y ago
> and actually knowing, on code level, how it manifests and how you avoid these things
You avoid them by using tools that make it difficult or impossible to introduce such vulnerabilities to begin with. Such as modern, memory safe programming languages.
For many decades, carpenters have been educated about table saw safety. But what finally stopped thousands of fingers getting chopped off every year was the introduction of the SawStop, and similar technologies.
Safety is a matter of using the right tools, not of "taking better care".
- wffurr 3y agoC is the table saw of programming. C++ is the band saw.
- p-e-w 3y agoI've used both saws and both programming languages. I still don't know which is worse.
- davemp 3y ago> For many decades, carpenters have been educated about table saw safety. But what finally stopped thousands of fingers getting chopped off every year was the introduction of the SawStop, and similar technologies. Afaik the technology isn’t widespread and there are still 10s of thousands of injuries per year.
- HideousKojima 3y agoAlso SawStop doesn't prevent kickback, one of the other major sources of injury from a table saw.
- chefandy 3y agoYeah at least in the US, it looks like tablesaw accidents that put people in the ER are about as common as they were 15 years ago. I have a buddy who just lost 6 months work because of a tablesaw accident.
- pjmlp 3y agoYou mean tecnhology like bounds checking, invented during the 1950's decade, with the creation of Fortran, Lisp and Algol, and every other language derived from them, with exception of C, C++ and Objective-C?
- geodel 3y agoAnd why the whole world wrote so much code in C, C++ and Objective-C when bound checking existing long before these languages without boundcheck?
- pjmlp 3y agoIt started like this, "Although we entertained occasional thoughts about implementing one of the major languages of the time like Fortran, PL/I, or Algol 68, such a project seemed hopelessly large for our resources: much simpler and smaller tools were called for. All these languages influenced our work, but it was more fun to do things on our own." -- https://www.bell-labs.com/usr/dmr/www/chist.html https://www.bell-labs.com/usr/dmr/www/chist.html Then source tapes with an almost symbolic license price for its time, and a commentary book did the rest.
- j16sdiz 3y agowith bounds checking, out of range index still trigger exception or runtime error. Many of them results in DoS.
- pjmlp 3y agoMuch better than silent data corruption. Then there is the whole issue of making it more interesting to look elsewhere instead. When a door is locked I can still break in by throwing a rock to the window, yet most people do lock the door nonetheless, while most thieves only bother to break the window if there is anything actually valuable in doing so.
- nojvek 3y agoWow! SawStop is incredible tech. the blade stops within 5ms. That's insane.
- chefandy 3y agoThose two things aren't mutually exclusive. I'll bet a non-trivial number of XSS and SQL injection vulnerabilities came from people disabling input and output sanitation on solid frameworks and libraries because they didn't know why they shouldn't. Tools won't solve all of your problems-- you need knowledge, diligence, and tools that make doing the right thing easy.
- UncleMeat 3y ago> I'll bet a non-trivial number of XSS and SQL injection vulnerabilities came from people disabling input and output sanitation on solid frameworks and libraries because they didn't know why they shouldn't. I will take this bet.
- chefandy 3y agoSearching Google for disabled sanitation "vulnerability", the first two hits are articles admonishing developers to not do it, and the third is a CVE, CVE-2023-1159, from a month ago that affects WordPress installations on which the developer disabled unfiltered_html, which is it's built-in sanitation functionality.
- rainonmoon 3y agoMemory safety won't stop you writing SQL queries or dynamically generating HTML that accepts unsanitised user input.
- p-e-w 3y agoYou're right. Those things are stopped by other tools, such as query builders and web frameworks.
- witrak 3y ago>Those things are stopped by other tools, such as query builders and web frameworks. No. All tools can be used with an improper attitude which leads to the creation of weak points. The proper way is to have a deep understanding of the role of design rules. A programmer who does not pay attention to design (very basic principles of the design process) can create a good game, and even if this game contains weaknesses the risk related isn't a reason to not use it. The same programmer when creating critical infrastructure software is a source of potential nightmare. Unfortunately, software business accepts such specialists for projects both of kinds. Why? Who knows? Perhaps because of legal regulations? Why when an engineer designs a car they don't try to "Move fast and break things"?
- j16sdiz 3y ago> Why when an engineer designs a car they don't try to "Move fast and break things" They do when they design submersible or rockets
- boveus 3y agoXSS and SQLi can happen independently of the memory safety of your chosen programming language. You can use relatively safe frameworks or ORMs to generate HTML and interact with your DB, but there will sometimes be complex use cases that require you to extend or otherwise not use those safeguards. Similarly, I imagine that there are cases where someone needs to do complex wood working tasks that involve dangers which are a less obvious than with a table saw.
- waihtis 3y agoI agree 100%, but in reality most people work with the language they are presented with.