Secure coding in C++ with Claude Code

CYDCpp3dClaude
3 days
On-site or online
Hands-on
C
C++
Developer
Instructor-led
labs

29 Labs

case_study

8 Case Studies

Platform

Claude Code, Generative AI

Audience

C and C++ developers using Claude Code

Preparedness

General C++ and C development

Standards and references

SEI CERT, CWE and Fortify Taxonomy

Group size

12 participants

Outline

  • Coding responsibly with Claude Code
  • Memory management vulnerabilities
  • Memory management hardening
  • Common software security weaknesses
  • Using vulnerable components
  • Wrap up

What you will learn

  • 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
  • All this put into the context of Claude Code

Description

Claude Code is transforming the way developers interact with software projects, enabling AI-assisted development directly within the development environment. Its ability to understand codebases, modify files, run commands, and assist with complex development tasks can significantly improve developer productivity. At the same time, giving an AI tool a deeper role in the development process introduces important security and quality considerations, requiring developers to use it responsibly.

This course provides a comprehensive insight into the responsible use of Claude Code for secure software development. Participants explore how AI-assisted development can affect security-critical areas such as authentication, authorization, cryptography, input validation, and secure handling of sensitive data. The curriculum also examines how Claude Code approaches secure coding practices and common vulnerabilities from the OWASP Top Ten, including path traversal, SQL injection, and cross-site scripting.

Through hands-on exercises and experimentation with Claude Code, participants gain a practical understanding of both its capabilities and limitations. They learn how to critically review AI-generated and AI-modified code, identify security weaknesses that may be introduced or overlooked, and use AI assistance without surrendering control over important development and security decisions. Real-world case studies illustrate the potential consequences of insecure AI-assisted development and the dual role of AI as both a powerful development resource and a potential security risk.

By the end of the course, developers will be equipped with the knowledge and practical skills to use Claude Code responsibly throughout the software development lifecycle, taking advantage of AI-assisted development while maintaining appropriate security, code quality, and developer oversight.

Table of contents

  • Coding responsibly with Claude Code
  • Memory management vulnerabilities
    • Assembly basics and calling conventions
      • x64 assembly essentials
      • Registers and addressing
      • Most common instructions
      • Calling conventions on x64
        • Calling convention – what it is all about
        • Calling convention on x64
        • The stack frame
        • Stacked function calls
    • Buffer overflow
      • Memory management and security
      • Buffer security issues
      • Buffer overflow on the stack
        • Buffer overflow on the stack – stack smashing
        • Exploitation – Hijacking the control flow
        • Lab – Buffer overflow 101, code reuse
        • Exploitation – Arbitrary code execution
        • Injecting shellcode
        • Lab – Code injection, exploitation with shellcode
        • Case study – Stack BOF in FriendlyName handling of the Wemo Smart Plug
      • Pointer manipulation
        • Modification of jump tables
        • 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
  • Memory management hardening
    • Securing the toolchain
      • Securing the toolchain in C++
      • Using FORTIFY_SOURCE
      • Lab – Effects of FORTIFY
      • AddressSanitizer (ASan)
        • Using AddressSanitizer (ASan)
        • Lab – Using AddressSanitizer
      • Stack smashing protection
        • Detecting BoF with a stack canary
        • Argument cloning
        • Stack smashing protection on various platforms
        • SSP changes to the prologue and epilogue
        • Lab – Effects of stack smashing protection
    • Runtime protections
      • Runtime instrumentation
      • Address Space Layout Randomization (ASLR)
        • ASLR on various platforms
        • Lab – Effects of ASLR
        • Circumventing ASLR – NOP sleds
      • Non-executable memory areas
        • The NX bit
        • Write XOR Execute (W^X)
        • NX on various platforms
        • Lab – Effects of NX
        • NX circumvention – Code reuse attacks
          • Return-to-libc / arc injection
        • Return Oriented Programming (ROP)
          • Protection against ROP
          • Case study – Systematic exploitation of a MediaTek buffer overflow
  • Common software security weaknesses
    • Security features
    • Code quality
      • Code quality and security
      • Data handling
        • Type mismatch
        • Lab – Type mismatch
        • Initialization and cleanup
          • Constructors and destructors
          • Initialization of static objects
          • Lab – Initialization cycles
        • Unreleased resource
          • Array disposal in C++
          • Lab – Mixing delete and delete[]
      • Object oriented programming pitfalls
        • Inheritance and object slicing
        • Implementing the copy operator
        • The copy operator and mutability
        • 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 – Agentic coding and code security (mid-2025 onward)
  • 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
        • 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 Claude Code
            • Case study – Command injection in Zyxel IKE packet decoder
      • Integer handling problems
        • Representing signed numbers
        • Integer visualization
        • Integer promotion
        • Integer overflow
        • Lab – Integer overflow
        • Lab – Experimenting with integer overflow in Claude Code
        • Case study – Integer underflows in IPv6 handling of tcpip.sys
        • Signed / unsigned confusion
        • Case study – Signed/unsigned confusion DoS in DrayTek Vigor routers
        • Lab – Signed / unsigned confusion
        • Lab – Experimenting with signed / unsigned confusion in Claude Code
        • Integer truncation
        • Lab – Integer truncation
        • Lab – Experimenting with integer truncation in Claude Code
        • 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
        • Path traversal
        • Lab – Path traversal
        • Path traversal-related examples
        • Case study – File spoofing in WinRAR
        • Virtual resources
        • Path traversal best practices
        • Lab – Path canonicalization
        • Lab – Experimenting with path traversal in Claude Code
      • Format string issues
        • The problem with printf()
        • 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

Pricing

3 days Session Price

2250 EUR / person

  • Live, instructor led classroom training
  • Discussion and insight into the hacker’s mindset
  • Hands-on practice using case studies based on high-profile hacks and live lab exercises
Customized course

Tailor a course to your preferences

  • Send us a brief description of your business’s training needs
  • Include your contact information
  • One of our colleagues will be in touch to schedule a free consultation about training requirements

Inquiry

Interested in the trainings but still have some questions? Curious about how you can customize a training for your team? Send us a message and a team member will be in touch within 24 hours.

This field is required

This field is required

Send us your phone number if you prefer to discuss further on a call

This field is required

This field is required

This field is required

This field is required