<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE FL_Course SYSTEM "https://www.flane.de/dtd/fl_course095.dtd"><?xml-stylesheet type="text/xsl" href="https://portal.flane.ch/css/xml-course.xsl"?><course productid="36438" language="fr" source="https://portal.flane.ch/swisscom/fr/xml-course/36438" lastchanged="2025-10-29T08:42:31+01:00" parent="https://portal.flane.ch/swisscom/fr/xml-courses"><title>Code responsibly with generative AI in C++</title><productcode>CRWGAIC++</productcode><vendorcode>CY</vendorcode><vendorname>Cydrill</vendorname><fullproductcode>CY-CRWGAIC++</fullproductcode><version>1.0</version><objective>&lt;ul&gt;
&lt;li&gt;Understanding the essentials of responsible AI&lt;/li&gt;&lt;li&gt;Getting familiar with essential cyber security concepts&lt;/li&gt;&lt;li&gt;Correctly implementing various security features&lt;/li&gt;&lt;li&gt;Identify vulnerabilities and their consequences&lt;/li&gt;&lt;li&gt;Learn the security best practices in C++&lt;/li&gt;&lt;li&gt;Managing vulnerabilities in third party components&lt;/li&gt;&lt;li&gt;Input validation approaches and principles&lt;/li&gt;&lt;li&gt;All this put into the context of GitHub Copilot&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Wrap up&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Secure coding principles
&lt;ul&gt;
&lt;li&gt;Principles of robust programming by Matt Bishop&lt;/li&gt;&lt;li&gt;Secure design principles of Saltzer and Schroeder&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;And now what?&lt;/li&gt;&lt;li&gt;Software security sources and further reading
&lt;ul&gt;
&lt;li&gt;C and C++ resources&lt;/li&gt;&lt;li&gt;Responsible AI principles in software development&lt;/li&gt;&lt;li&gt;Generative AI &amp;ndash; Resources and additional guidance&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</objective><essentials>&lt;p&gt;General C++ and C development&lt;/p&gt;</essentials><audience>&lt;p&gt;C/C++ developers using Copilot or other GenAI tools&lt;/p&gt;</audience><contents>&lt;h4&gt;Day 1&lt;/h4&gt;
&lt;h4&gt;Coding responsibly with GenAI&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;What is responsible AI?&lt;/li&gt;&lt;li&gt;What is security?&lt;/li&gt;&lt;li&gt;Threat and risk&lt;/li&gt;&lt;li&gt;Cyber security threat types &amp;ndash; the CIA triad&lt;/li&gt;&lt;li&gt;Cyber security threat types &amp;ndash; the STRIDE model&lt;/li&gt;&lt;li&gt;Consequences of insecure software&lt;/li&gt;&lt;li&gt;Security and responsible AI in software development&lt;/li&gt;&lt;li&gt;GenAI tools in coding: Copilot, Codeium and others&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;Memory management vulnerabilities&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Assembly basics and calling conventions
&lt;ul&gt;
&lt;li&gt;x64 assembly essentials&lt;/li&gt;&lt;li&gt;Registers and addressing&lt;/li&gt;&lt;li&gt;Most common instructions&lt;/li&gt;&lt;li&gt;Calling conventions on x64&lt;/li&gt;&lt;li&gt;Calling convention &amp;ndash; what it is all about&lt;/li&gt;&lt;li&gt;Calling convention on x64&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;The stack frame&lt;/li&gt;&lt;li&gt;Stacked function calls&lt;/li&gt;&lt;li&gt;Buffer overflow
&lt;ul&gt;
&lt;li&gt;Memory management and security&lt;/li&gt;&lt;li&gt;Buffer security issues&lt;/li&gt;&lt;li&gt;Buffer overflow on the stack&lt;/li&gt;&lt;li&gt;Buffer overflow on the stack &amp;ndash; stack smashing&lt;/li&gt;&lt;li&gt;Exploitation &amp;ndash; Hijacking the control flow&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Buffer overflow 101, code reuse&lt;/li&gt;&lt;li&gt;Exploitation &amp;ndash; Arbitrary code execution&lt;/li&gt;&lt;li&gt;Injecting shellcode&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Code injection, exploitation with shellcode&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Stack BOF in FriendlyName handling of the Wemo Smart Plug&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Pointer manipulation
&lt;ul&gt;
&lt;li&gt;Modification of jump tables&lt;/li&gt;&lt;li&gt;Overwriting function pointers&lt;/li&gt;&lt;li&gt;Best practices and some typical mistakes&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Unsafe functions
&lt;ul&gt;
&lt;li&gt;Dealing with unsafe functions&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Fixing buffer overflow (exploring with Copilot)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Using std::string in C++
&lt;ul&gt;
&lt;li&gt;Manipulating C-style strings in C++&lt;/li&gt;&lt;li&gt;Malicious string termination&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; String termination confusion (exploring with Copilot)&lt;/li&gt;&lt;li&gt;String length calculation mistakes&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Day 2&lt;/h4&gt;&lt;h4&gt;Memory management hardening&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Securing the toolchain
&lt;ul&gt;
&lt;li&gt;Securing the toolchain in C++&lt;/li&gt;&lt;li&gt;Using FORTIFY_SOURCE&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Effects of FORTIFY&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;AddressSanitizer (ASan)
&lt;ul&gt;
&lt;li&gt;Using AddressSanitizer (ASan)&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Using AddressSanitizer&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Stack smashing protection
&lt;ul&gt;
&lt;li&gt;Detecting BoF with a stack canary&lt;/li&gt;&lt;li&gt;Argument cloning&lt;/li&gt;&lt;li&gt;Stack smashing protection on various platforms&lt;/li&gt;&lt;li&gt;SSP changes to the prologue and epilogue&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Effects of stack smashing protection&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Runtime protections
&lt;ul&gt;
&lt;li&gt;Runtime instrumentation&lt;/li&gt;&lt;li&gt;Address Space Layout Randomization (ASLR)
&lt;ul&gt;
&lt;li&gt;ASLR on various platforms&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Effects of ASLR&lt;/li&gt;&lt;li&gt;Circumventing ASLR &amp;ndash; NOP sleds&lt;/li&gt;&lt;li&gt;Circumventing ASLR &amp;ndash; memory leakage&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Non-executable memory areas
&lt;ul&gt;
&lt;li&gt;The NX bit&lt;/li&gt;&lt;li&gt;Write XOR Execute (W^X)&lt;/li&gt;&lt;li&gt;NX on various platforms&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Effects of NX&lt;/li&gt;&lt;li&gt;NX circumvention &amp;ndash; Code reuse attacks&lt;/li&gt;&lt;li&gt;Return-to-libc / arc injection&lt;/li&gt;&lt;li&gt;Return Oriented Programming (ROP)&lt;/li&gt;&lt;li&gt;Protection against ROP&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Systematic exploitation of a MediaTek buffer overflow&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Day 3&lt;/h4&gt;&lt;h4&gt;Common software security weaknesses&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Security features
&lt;ul&gt;
&lt;li&gt;Authentication&lt;/li&gt;&lt;li&gt;Password management
&lt;ul&gt;
&lt;li&gt;Inbound password management&lt;/li&gt;&lt;li&gt;Storing account passwords&lt;/li&gt;&lt;li&gt;Password in transit&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Is just hashing passwords enough?&lt;/li&gt;&lt;li&gt;Dictionary attacks and brute forcing&lt;/li&gt;&lt;li&gt;Salting&lt;/li&gt;&lt;li&gt;Adaptive hash functions for password storage&lt;/li&gt;&lt;li&gt;Password policy&lt;/li&gt;&lt;li&gt;NIST authenticator requirements for memorized secrets&lt;/li&gt;&lt;li&gt;Password database migration&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Code quality
&lt;ul&gt;
&lt;li&gt;Code quality and security&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Data handling
&lt;ul&gt;
&lt;li&gt;Type mismatch&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Type mismatch (exploring with Copilot)&lt;/li&gt;&lt;li&gt;Initialization and cleanup
&lt;ul&gt;
&lt;li&gt;Constructors and destructors&lt;/li&gt;&lt;li&gt;Initialization of static objects&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Initialization cycles (exploring with Copilot)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Unreleased resource&lt;/li&gt;&lt;li&gt;Array disposal in C++&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Mixing delete and delete[] (exploring with Copilot)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Object oriented programming pitfalls
&lt;ul&gt;
&lt;li&gt;Accessibility modifiers&lt;/li&gt;&lt;li&gt;Are accessibility modifiers a security feature?&lt;/li&gt;&lt;li&gt;Inheritance and object slicing&lt;/li&gt;&lt;li&gt;Implementing the copy operator&lt;/li&gt;&lt;li&gt;The copy operator and mutability&lt;/li&gt;&lt;li&gt;Mutability&lt;/li&gt;&lt;li&gt;Mutable predicate function objects&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Mutable predicate function object&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;Using vulnerable components&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Security of AI generated code&lt;/li&gt;&lt;li&gt;Practical attacks against code generation tools&lt;/li&gt;&lt;li&gt;Dependency hallucination via generative AI&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; A history of GitHub Copilot weaknesses (up to mid 2024)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
[/list]&lt;/p&gt;</contents><outline>&lt;ul&gt;
&lt;li&gt;Coding responsibly with GenAI&lt;/li&gt;&lt;li&gt;Memory management vulnerabilities&lt;/li&gt;&lt;li&gt;Memory management hardening&lt;/li&gt;&lt;li&gt;Common software security weaknesses&lt;/li&gt;&lt;li&gt;Using vulnerable components&lt;/li&gt;&lt;li&gt;Wrap up&lt;/li&gt;&lt;/ul&gt;</outline><objective_plain>- 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 GitHub Copilot
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
- Responsible AI principles in software development
- Generative AI – Resources and additional guidance</objective_plain><essentials_plain>General C++ and C development</essentials_plain><audience_plain>C/C++ developers using Copilot or other GenAI tools</audience_plain><contents_plain>Day 1


Coding responsibly with GenAI


- What is responsible AI?
- What is security?
- Threat and risk
- Cyber security threat types – the CIA triad
- Cyber security threat types – the STRIDE model
- Consequences of insecure software
- Security and responsible AI in software development
- GenAI tools in coding: Copilot, Codeium and others

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 (exploring with Copilot)
- Using std::string in C++

- Manipulating C-style strings in C++
- Malicious string termination
- Lab – String termination confusion (exploring with Copilot)
- String length calculation mistakes
Day 2

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
- Circumventing ASLR – memory leakage
- 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
Day 3

Common software security weaknesses


- Security features

- Authentication
- Password management

- Inbound password management
- Storing account passwords
- Password in transit
- Lab – Is just hashing passwords enough?
- Dictionary attacks and brute forcing
- Salting
- Adaptive hash functions for password storage
- Password policy
- NIST authenticator requirements for memorized secrets
- Password database migration
- Code quality

- Code quality and security
- Data handling

- Type mismatch
- Lab – Type mismatch (exploring with Copilot)
- Initialization and cleanup

- Constructors and destructors
- Initialization of static objects
- Lab – Initialization cycles (exploring with Copilot)
- Unreleased resource
- Array disposal in C++
- Lab – Mixing delete and delete[] (exploring with Copilot)
- Object oriented programming pitfalls

- Accessibility modifiers
- Are accessibility modifiers a security feature?
- 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 – A history of GitHub Copilot weaknesses (up to mid 2024)

[/list]</contents_plain><outline_plain>- Coding responsibly with GenAI
- Memory management vulnerabilities
- Memory management hardening
- Common software security weaknesses
- Using vulnerable components
- Wrap up</outline_plain><duration unit="d" days="3">3 jours</duration><pricelist><price country="DE" currency="EUR">2250.00</price><price country="SI" currency="EUR">2250.00</price><price country="AT" currency="EUR">2250.00</price><price country="SE" currency="EUR">2250.00</price><price country="CH" currency="CHF">2250.00</price></pricelist><miles/></course>