Security of C++ Applications. Protecting Code from Attacks and Vulnerabilities
300 pages
English
PDF
4.5

Security of C++ Applications. Protecting Code from Attacks and Vulnerabilities

Security of C++ Applications. Protecting Code from Attacks and Vulnerabilities

Author:

Year:

Summary:

Modern C++ applications face a multitude of threats: from classic buffer overflows to complex memory integrity attacks. The book "Security of C++ Applications" is a practical guide that will teach you to identify, prevent, and eliminate vulnerabilities at all stages of development.



The author, Alexey Zakharov, a senior developer with 15 years of experience in system programming and pentesting, systematizes the best practices of secure programming. You will learn how hackers exploit weaknesses in C++ code and how to build reliable protection.



Who is this book for?

  • C++ developers (Junior, Middle, Senior) who want to improve the security level of their projects
  • Team Leads and architects responsible for codebase quality
  • Information security specialists studying protection at the source code level
  • Technical students deeply studying C++


What will you learn from the book?

  • Typical C++ vulnerabilities: buffer overflow, use-after-free, double free, data races
  • Safe memory management: rules for using smart pointers (unique_ptr, shared_ptr), RAII, and preventing leaks
  • Protection against attacks: ASLR, DEP, Stack Canaries, CFG (Control Flow Guard) and their implementation in C++
  • Standard library security: how to avoid dangerous constructs in STL, containers, and algorithms
  • Static and dynamic analysis: configuring Clang Static Analyzer, PVS-Studio, AddressSanitizer, UndefinedBehaviorSanitizer
  • Multithreading security: mutexes, lock-free structures, preventing deadlocks and races
  • Security anti-patterns: examples of vulnerable code and their refactoring
  • Safe handling of external data: input validation, protection against SQL injections (if C++ is used in the backend), XSS


Book features

  • Over 50 real-world examples of vulnerable and secure code
  • Step-by-step instructions for configuring analysis tools
  • Checklists for code review and security audit
  • Chapters dedicated to modern C++17/20/23 standards and their security capabilities
  • Coverage of both desktop applications and embedded systems in C++


This book will become your desktop reference for secure programming. You will not only learn to write code resistant to attacks but also be able to audit existing projects. After reading, you will confidently answer questions at C++ security interviews and protect your applications from the most common threats.



Note: The book is oriented towards practitioners. All examples have been tested on current compilers (GCC, Clang, MSVC) and can be immediately used in your work.

Recommendations