Vulnerable C++
summary
C++ has concrete hazards: undefined behavior lets optimizers eliminate code and time-travel effects, and a handful of real examples show dangling references (including a max() misuse) that crash under AddressSanitizer. WG23 catalogs 64 vulnerabilities (now 65) and produces ISO 24772‑1 plus a C++ part; mitigations demonstrated include using std::string not C string APIs, prefer make_unique / no new/delete, follow Rule of Zero, enable sanitizers and -Werror, and add unit tests and static analysis.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 0:46Questions
- 2:16What is vulnerable
- 3:20What makes code vulnerable
- 6:15Learning curve
- 9:07Good unit tests
- 10:41Vulnerable C
- 18:38IEC JTC SC22WG23
- 20:09Language Independent Document
- 21:36Point Arithmetic
- 22:54Vulnerabilities
- 24:09Top avoidance mechanisms
- 25:25String termination
- 32:39Side Track
- 33:49Preconditioned checks and error handling
- 36:13C with errors
- 40:26Postcondition violation
- 41:51Undefined behaviors
- 43:55Strategy
- 48:00Parameters
- 52:37C dangling references
related talks
51mSecure Programming Practices in C++
14mEmbedded C and C++: A Security Perspective
01h 06mSecurity Beyond Memory Safety - Using Modern C++ to Avoid Vulnerabilities by Design
01h 01mSoftware Security
50mSecure development with C++ - Lessons and techniques
01h 02mPractical Tips for Safer C++
53mFrom Chaos to Control: Overcoming C and C++’s Inherent Unsafety
01h 04mRemoving Needless Undefined Behavior for a Safer C++
