Generative AI is transforming the software industry, with tools like Claude Code, GitHub Copilot or others, enabling developers to achieve unprecedented levels of efficiency. While this is exciting progress, it also raises important concerns, encouraging stakeholders to approach these technologies with care. Current AI tools often lack the nuanced understanding necessary to address subtle, yet critical aspects of software development, particularly in the domain of security.

This course provides a comprehensive insight into the responsible use of generative AI in coding. Participants delve into topics in software development that are most likely to be impacted by careless use of generative AI, including authentication, authorization, and cryptography. The curriculum also includes an analysis of how Claude Code, GitHub Copilot or others handle secure coding practices related to key vulnerabilities outlined in the OWASP Top Ten, such as path traversal, SQL injection, or cross-site scripting.

Through hands-on learning and experimenting, participants will get a solid understanding of both the strengths and limitations of AI-assisted development. In addition, case studies of real-world incidents showcase the consequences of insecure code and demonstrate the dual nature of generative AI as both a resource and a potential risk.

By the end of the course, developers will be equipped with the knowledge and skills to integrate AI tools into the software development lifecycle responsibly, enhancing efficiency without compromising security or product quality.

This variant of the C and C++ security course deals extensively with how certain security problems in code are handled by GenAI. Through a number of hands-on labs participants will get first-hand experience about how to use GenAI responsibly, and how to prompt it to generate the most secure code. In some cases it is trivial, but in most cases it is not; and in yet some other cases it is basically impossible. At the same time, the labs provide general experience with using GenAI in everyday coding practice - what you can expect from it, and what are those areas where you shouldn't rely on it.

 

PRACTICAL INFO

  • If on-site training is not feasible, we can discuss providing a live, interactive online (virtual) or hybrid training. The standard program with 3-day content can also be delivered in 5 half days (from Monday to Friday).
  • Curious about how to quantify the return on investment (ROI) of secure coding trainings? Check out this article.

Objective

  • Understanding the essentials of responsible AI

  • Getting familiar with essential cyber security concepts

  • Correctly implementing various security features

  • Identify vulnerabilities and their consequences

  • Learn the security best practices in C++

  • Managing vulnerabilities in third party components

  • Input validation approaches and principles.

Target Audience

C and C++ developers using GenAI tools.

Preparedness:
General C++ and C development.
 

Delivery In-company (on-site or online)
Duration 3 consecutive days
Group size Up to 12 participants
Customization The training can be tailored to your organization, context, and learning objectives
Language English
Investment On request
Download brochure

Program

Day 1
Coding responsibly with GenAI 
What is security?
Threat and risk
Cyber security threat types – the CIA triad
Cyber security threat types – the STRIDE model
Consequences of insecure software
What is responsible AI?
Security and responsible AI in software development
Memory management vulnerabilities
Assembly basics and calling conventions
•    x64 assembly essentials
•    Registers and addressing
•    Most common instructions
•    Calling conventions on x64
o    Calling convention – what it is all about
o    Calling convention on x64
o    The stack frame
o    Stacked function calls
Buffer overflow
•    Memory management and security
•    Buffer security issues
•    Buffer overflow on the stack
o    Buffer overflow on the stack – stack smashing
o    Exploitation – Hijacking the control flow
o    Lab – Buffer overflow 101, code reuse
o    Exploitation – Arbitrary code execution
o    Injecting shellcode
o    Lab – Code injection, exploitation with shellcode
o    Case study – Stack BOF in FriendlyName handling of the Wemo Smart Plug
•    Pointer manipulation
o    Modification of jump tables
o    Overwriting function pointers
Best practices and some typical mistakes 
•    Unsafe functions
•    Dealing with unsafe functions
•    Lab – Fixing buffer overflow
•    Using std::string in C++
•    Unterminated strings
•    readlink() and string termination
•    Manipulating C-style strings in C++
•    Malicious string termination
•    Lab – String termination confusion
•    String length calculation mistakes
Day 2
Memory management hardening 
Securing the toolchain
Compiler options and instrumentation
•    Securing the toolchain in C++
•    Using FORTIFY_SOURCE
•    Lab – Effects of FORTIFY
•    AddressSanitizer (ASan)
o    Using AddressSanitizer (ASan)
o    Lab – Using AddressSanitizer
•    Stack smashing protection
o    Detecting BoF with a stack canary
o    Argument cloning
o    Stack smashing protection on various platforms
o    SSP changes to the prologue and epilogue
o    Lab – Effects of stack smashing protection
Runtime protections 
•    Runtime instrumentation
•    Address Space Layout Randomization (ASLR)
o    ASLR on various platforms
o    Lab – Effects of ASLR
o    Circumventing ASLR – NOP sleds
•    Non-executable memory areas
o    The NX bit
o    Write XOR Execute (W^X)
o    NX on various platforms
o    Lab – Effects of NX
o    NX circumvention – Code reuse attacks
-    Return-to-libc / arc injection
o    Return Oriented Programming (ROP)
-    Protection against ROP
-    Case study – Systematic exploitation of a MediaTek buffer overflow
Common software security weaknesses
Security features 
•    Authentication
•    Password management 
o    Storing account passwords
o    Password in transit
o    Lab – Is just hashing passwords enough?
o    Dictionary attacks and brute forcing
o    Salting
o    Adaptive hash functions for password storage
•    Password policy
o    NIST authenticator requirements for memorized secrets
o    Password database migration
Code quality 
•    Code quality and security
•    Data handling
o    Type mismatch
o    Lab – Type mismatch
o    Initialization and cleanup
-    Constructors and destructors
-    Initialization of static objects
-    Lab – Initialization cycles
o    Unreleased resource
-    Array disposal in C++
-    Lab – Mixing delete and delete[]
•    Object oriented programming pitfalls
o    Inheritance and object slicing
o    Implementing the copy operator
o    The copy operator and mutability
o    Mutability
-    Mutable predicate function objects
-    Lab – Mutable predicate function object
Using vulnerable components 
Security of AI generated code
•    Practical attacks against code generation tools
•    Dependency hallucination via generative AI
•    Case study – A history of GitHub Copilot weaknesses (up to mid-2025)
•    Case study – Agentic coding and code security (mid-2025 onward)
Day 3
Common software security weaknesses
Input validation 
•    Input validation principles
•    Denylists and allowlists
•    What to validate – the attack surface
•    Where to validate – defense in depth
•    When to validate – validation vs transformations
•    Injection 
o    Code injection
-    OS command injection
-    Lab – Command injection
-    OS command injection best practices
-    Avoiding command injection with the right APIs
-    Lab – Command injection best practices
-    Lab – Experimenting with command injection in GenAI
-    Case study – Command injection in Zyxel IKE packet decoder
•    Integer handling problems
o    Representing signed numbers
o    Integer visualization
o    Integer promotion
o    Integer overflow
o    Lab – Integer overflow
o    Lab – Experimenting with integer overflow in GenAI
o    Case study – Integer underflows in IPv6 handling of tcpip.sys
o    Signed / unsigned confusion
o    Case study – Signed/unsigned confusion DoS in DrayTek Vigor routers
o    Lab – Signed / unsigned confusion
o    Lab – Experimenting with signed / unsigned confusion in GenAI
o    Integer truncation
o    Lab – Integer truncation
o    Lab – Experimenting with integer truncation in GenAI
o    Best practices
-    Upcasting
-    Precondition testing
-    Postcondition testing
-    Using big integer libraries
-    Best practices in C
-    UBSan changes to arithmetics
-    Lab – Handling integer overflow on the toolchain level in C++
-    Best practices in C++
-    Lab – Integer handling best practices in C++
-    Case study – Integer check failure in Skia
•    Files and streams 

o    Path traversal
o    Lab – Path traversal
o    Path traversal-related examples
o    Case study – File spoofing in WinRAR
o    Virtual resources
o    Path traversal best practices
o    Lab – Path canonicalization
o    Lab – Experimenting with path traversal in GenAI
•    Format string issues 
o    The problem with printf()
o    Lab – Exploiting format string
Wrap up 
Secure coding principles
•    Principles of robust programming by Matt Bishop
•    Secure design principles of Saltzer and Schroeder
And now what?
•    Software security sources and further reading
•    C and C++ resources
•    Generative AI – Resources and additional guidance.
 

Methods

A blended learning journey: live instructor-led training with lab exercises in a top-notch e-learning system. You will keep access to the e-learning system 3-months post-training to revisit the lab exercises and material. 

29 labs and 9 case studies.

Standards and references:
SEI CERT, CWE and Fortify Taxonomy.
 

 

Certification

After attending this training, participants will receive a High Tech Institute certificate.