From the course: Secure Coding in C++

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Exploitable language features in C++

Exploitable language features in C++ - C++ Tutorial

From the course: Secure Coding in C++

Exploitable language features in C++

- [Eduardo] One of the greatest strengths of C++ is also its biggest risk: Low-Level Control. Features like raw pointers, let you access any memory address and potentially corrupt or expose data. C++ also puts lifetime management in your hands. Forget to clean up properly and you risk leaks or dangling references. The language has a flexible but weak type system, allowing unsafe casts and unions that bypass type checking, sometimes unintentionally. Let me tell you about a few frequent sources of vulnerabilities in C++. Buffer overflows occur when code writes beyond allocated memory, potentially enabling attackers to inject malicious code. Integer overflows, particularly with unsigned integers, can bypass expected bounds checks, creating exploitable bugs. Format string vulnerabilities occur when user inputs directly control formatting operations, risking memory exposure or execution of unintended actions. Like most programming languages, C++ uses defaults but some can unintentionally…

Contents