by dlor on 7/13/23, 10:57 AM with 128 comments
by dlor on 7/13/23, 11:28 AM
* Out-of-bounds Write
* Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
* Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
* Use After Free
by BoppreH on 7/13/23, 1:08 PM
- Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (#2)
- Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (#3)
- Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (#4)
- Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (#8)
- Improper Neutralization of Special Elements used in a Command ('Command Injection') (#16)
- Improper Control of Generation of Code ('Code Injection') (#23)
All of these came from trying to avoid structured data, and instead using strings with "special characters". It's crazy how many times this mistake has been repeated: file paths, URLs, log files, CSV, HTML, HTTP (cookies, headers, query strings), domain names, SQL, shell commands, shell pipelines... One unescaped character, from anywhere in the stack, and it all blows up.
One could say "at least it's human-readable", but that's not reliable either. Take files names, for example. Two visually identical file names may map to different files (because confusables[1] or surrounding spaces), or two different names map to the same file (because normalization[2]), or the ".jpg" at the end may not actually be the extension (because right-to-left override[3]).
So the computer interpretation of a string might be wrong because a special character sneaked in. And even if everyone was perfectly careful, the human interpretation might still be wrong. For the sake of the next generations, I hope we leave strings for human text and nothing more.
[1] https://unicode.org/cldr/utility/confusables.jsp
[2] https://developer.apple.com/library/archive/qa/qa1173/_index...
[3] https://krebsonsecurity.com/2011/09/right-to-left-override-a...
by heelix on 7/13/23, 12:27 PM
Thank god Spring dropped this interface in the Framework 6.x / Boot 3.x release, and the end for non-commercial support is this year for the old stuff.
https://github.com/spring-projects/spring-framework/issues/2... https://github.com/advisories/GHSA-4wrc-f8pq-fpqp
by matt2000 on 7/13/23, 1:32 PM
by pulse7 on 7/13/23, 12:12 PM
1. CWE-787 Out-of-bounds Write: C, C++, Assembly
4. CWE-416 Use After Free: C, C++
7. CWE-125 Out-of-bounds Read: C, C++
10. CWE-434 Unrestricted Upload of File with Dangerous Type: ASP.NET, PHP, Class: Not Language-Specific
12. CWE-476 NULL Pointer Dereference: C, C++, Java, C#, Go
15. CWE-502 Deserialization of Untrusted Data: Java, Ruby, PHP, Python, JavaScript
17. CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer: C, C++, Assembly
21. CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'): C, C++, Java
23. CWE-94 Improper Control of Generation of Code ('Code Injection'): Interpreted
by amelius on 7/13/23, 1:00 PM
I've noticed that using Valgrind on Python systems is almost impossible because most modules have not been built with Valgrind in mind and thus you get swamped in noise.
I suppose the same is true for any large system that uses many different third party libraries.
by gemanor on 7/13/23, 12:48 PM
From the optimistic side, it looks like the safest language to write an app today with is TypeScript.
by timewasterthrow on 7/14/23, 12:25 AM
by badrabbit on 7/13/23, 6:50 PM