<?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="24032" language="de" source="https://portal.flane.ch/swisscom/xml-course/cydrill-secc-ccppa" lastchanged="2026-01-12T11:37:18+01:00" parent="https://portal.flane.ch/swisscom/xml-courses"><title>Secure Coding in C and C++ for Automotive</title><productcode>SECC-CCPPA</productcode><vendorcode>CY</vendorcode><vendorname>Cydrill</vendorname><fullproductcode>CY-SECC-CCPPA</fullproductcode><version>1.0</version><objective>&lt;ul&gt;
&lt;li&gt;Getting familiar with essential cyber security concepts&lt;/li&gt;&lt;li&gt;Learning about security specialties of the automotive sector&lt;/li&gt;&lt;li&gt;Identify vulnerabilities and their consequences&lt;/li&gt;&lt;li&gt;Learn the security best practices in C and C++&lt;/li&gt;&lt;li&gt;Input validation approaches and principles&lt;/li&gt;&lt;li&gt;Managing vulnerabilities in third party components&lt;/li&gt;&lt;li&gt;Understanding security testing methodology and approaches&lt;/li&gt;&lt;li&gt;Getting familiar with common security testing techniques and tools&lt;/li&gt;&lt;/ul&gt;</objective><essentials>&lt;p&gt;General C/C++ development&lt;/p&gt;</essentials><audience>&lt;ul&gt;
&lt;li&gt;Automotive Sector&lt;/li&gt;&lt;li&gt;C/C++ developers&lt;/li&gt;&lt;/ul&gt;</audience><contents>&lt;ul&gt;
&lt;li&gt;Cyber security basics&lt;/li&gt;&lt;li&gt;Buffer overflow&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;Security testing&lt;/li&gt;&lt;li&gt;Wrap up&lt;/li&gt;&lt;/ul&gt;</contents><outline>&lt;p&gt;&lt;strong&gt;DAY 1 &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cyber security basics&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&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&lt;/li&gt;&lt;li&gt;Consequences of insecure software
&lt;ul&gt;
&lt;li&gt;Constraints and the market&lt;/li&gt;&lt;li&gt;The dark side&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Categorization of bugs
&lt;ul&gt;
&lt;li&gt;The Seven Pernicious Kingdoms&lt;/li&gt;&lt;li&gt;SEI CERT Secure Coding Guidelines&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Coding standards in automotive
&lt;ul&gt;
&lt;li&gt;ISO 26262&lt;/li&gt;&lt;li&gt;MISRA C 2012&lt;/li&gt;&lt;li&gt;MISRA C++ 2008&lt;/li&gt;&lt;li&gt;AUTOSAR C++14 and the future&lt;/li&gt;&lt;li&gt;CERT C Coding Standard&lt;/li&gt;&lt;li&gt;CERT C++ Coding Standard&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Cyber security in the automotive sector
&lt;ul&gt;
&lt;li&gt;Software security in the automotive world&lt;/li&gt;&lt;li&gt;Threats and trends in automotive&lt;/li&gt;&lt;li&gt;Self-driving car threats&lt;/li&gt;&lt;li&gt;The CAN bus and security&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; controlling the CAN bus through the infotainment system&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Buffer overflow&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Assembly basics and calling conventions
&lt;ul&gt;
&lt;li&gt;ARM assembly essentials&lt;/li&gt;&lt;li&gt;Registers and addressing&lt;/li&gt;&lt;li&gt;Basic ARM64 instructions&lt;/li&gt;&lt;li&gt;ARM calling conventions
&lt;ul&gt;
&lt;li&gt;The calling convention&lt;/li&gt;&lt;li&gt;The stack frame&lt;/li&gt;&lt;li&gt;Calling convention implementation on ARM64&lt;/li&gt;&lt;li&gt;Stacked function calls&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Memory management vulnerabilities
&lt;ul&gt;
&lt;li&gt;Memory management and security&lt;/li&gt;&lt;li&gt;Vulnerabilities in the real world&lt;/li&gt;&lt;li&gt;Mapping to MISRA&lt;/li&gt;&lt;li&gt;Buffer security issues&lt;/li&gt;&lt;li&gt;Buffer overflow on the stack
&lt;ul&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;/ul&gt;&lt;/li&gt;&lt;li&gt;Buffer overflow on the heap
&lt;ul&gt;
&lt;li&gt;Unsafe unlinking&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Heartbleed&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;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Best practices and some typical mistakes
&lt;ul&gt;
&lt;li&gt;Unsafe functions&lt;/li&gt;&lt;li&gt;Dealing with unsafe functions&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Fixing buffer overflow&lt;/li&gt;&lt;li&gt;What&amp;rsquo;s the problem with asctime()?&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; The problem with asctime()&lt;/li&gt;&lt;li&gt;Using std::string in C++&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;DAY 2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Buffer overflow&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some typical mistakes leading to BOF
&lt;ul&gt;
&lt;li&gt;Unterminated strings&lt;/li&gt;&lt;li&gt;readlink() and string termination&lt;/li&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&lt;/li&gt;&lt;li&gt;String length calculation mistakes&lt;/li&gt;&lt;li&gt;Off-by-one errors&lt;/li&gt;&lt;li&gt;Allocating nothing&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Memory management hardening&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mapping to MISRA&lt;/li&gt;&lt;li&gt;Securing the toolchain
&lt;ul&gt;
&lt;li&gt;Securing the toolchain in C and C++&lt;/li&gt;&lt;li&gt;Compiler warnings and security&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;li&gt;AddressSanitizer (ASan)
&lt;ul&gt;
&lt;li&gt;Using AddressSanitizer (ASan)&lt;/li&gt;&lt;li&gt;ASan changes to the prologue&lt;/li&gt;&lt;li&gt;ASan changes to memory read/write operations&lt;/li&gt;&lt;li&gt;ASan changes to epilogue&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;/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;Heap spraying&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;ul&gt;
&lt;li&gt;Return-to-libc / arc injection&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Return Oriented Programming (ROP)
&lt;ul&gt;
&lt;li&gt;Lab &amp;ndash; ROP demonstration&lt;/li&gt;&lt;li&gt;Protection against ROP&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Common software security weaknesses&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Security features
&lt;ul&gt;
&lt;li&gt;Authentication
&lt;ul&gt;
&lt;li&gt;Authentication basics&lt;/li&gt;&lt;li&gt;Multi-factor authentication&lt;/li&gt;&lt;li&gt;Authentication weaknesses &amp;ndash; spoofing&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Hacking the Mitsubishi Outlander PHEV hybrid&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Password management
&lt;ul&gt;
&lt;li&gt;Inbound password management
&lt;ul&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;ul&gt;
&lt;li&gt;NIST authenticator requirements for memorized secrets&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; The Ashley Madison data breach
&lt;ul&gt;
&lt;li&gt;The dictionary attack&lt;/li&gt;&lt;li&gt;The ultimate crack&lt;/li&gt;&lt;li&gt;Exploitation and the lessons learned&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Password database migration&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Outbound password management
&lt;ul&gt;
&lt;li&gt;Hard coded passwords&lt;/li&gt;&lt;li&gt;Best practices&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Hardcoded password&lt;/li&gt;&lt;li&gt;Protecting sensitive information in memory
&lt;ul&gt;
&lt;li&gt;Challenges in protecting memory&lt;/li&gt;&lt;li&gt;Heap inspection&lt;/li&gt;&lt;li&gt;Compiler optimization challenges&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Zeroization challenges&lt;/li&gt;&lt;li&gt;Sensitive info in non-locked memory&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Authorization
&lt;ul&gt;
&lt;li&gt;Access control basics&lt;/li&gt;&lt;li&gt;File system access control
&lt;ul&gt;
&lt;li&gt;Improper file system access control&lt;/li&gt;&lt;li&gt;Ownership&lt;/li&gt;&lt;li&gt;chroot jail&lt;/li&gt;&lt;li&gt;Using umask()&lt;/li&gt;&lt;li&gt;Linux filesystem&lt;/li&gt;&lt;li&gt;LDAP&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
&lt;strong&gt;DAY 3&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common software security weaknesses&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Input validation
&lt;ul&gt;
&lt;li&gt;Input validation principles
&lt;ul&gt;
&lt;li&gt;Blacklists and whitelists&lt;/li&gt;&lt;li&gt;Data validation techniques&lt;/li&gt;&lt;li&gt;What to validate &amp;ndash; the attack surface&lt;/li&gt;&lt;li&gt;Attack surface in automotive&lt;/li&gt;&lt;li&gt;Where to validate &amp;ndash; defense in depth&lt;/li&gt;&lt;li&gt;How to validate &amp;ndash; validation vs transformations&lt;/li&gt;&lt;li&gt;Output sanitization&lt;/li&gt;&lt;li&gt;Encoding challenges&lt;/li&gt;&lt;li&gt;Validation with regex&lt;/li&gt;&lt;li&gt;Mapping to MISRA&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Injection
&lt;ul&gt;
&lt;li&gt;Injection principles&lt;/li&gt;&lt;li&gt;Injection attacks&lt;/li&gt;&lt;li&gt;Code injection
&lt;ul&gt;
&lt;li&gt;OS command injection
&lt;ul&gt;
&lt;li&gt;Lab &amp;ndash; Command injection&lt;/li&gt;&lt;li&gt;OS command injection best practices&lt;/li&gt;&lt;li&gt;Avoiding command injection with the right APIs&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Command injection best practices&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Shellshock&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Shellshock&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Command injection in Jeep Cherokee&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Process control &amp;ndash; library injection
&lt;ul&gt;
&lt;li&gt;DLL hijacking&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; DLL hijacking&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Integer handling problems
&lt;ul&gt;
&lt;li&gt;Representing signed numbers&lt;/li&gt;&lt;li&gt;Integer visualization&lt;/li&gt;&lt;li&gt;The MISRA essential type model&lt;/li&gt;&lt;li&gt;Integer promotion&lt;/li&gt;&lt;li&gt;Composite expressions and type conversion&lt;/li&gt;&lt;li&gt;Integer overflow&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Integer overflow&lt;/li&gt;&lt;li&gt;Signed / unsigned confusion&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Signed / unsigned confusion&lt;/li&gt;&lt;li&gt;Integer truncation&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Integer truncation&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; WannaCry&lt;/li&gt;&lt;li&gt;Best practices
&lt;ul&gt;
&lt;li&gt;Upcasting&lt;/li&gt;&lt;li&gt;Precondition testing&lt;/li&gt;&lt;li&gt;Postcondition testing&lt;/li&gt;&lt;li&gt;Using big integer libraries&lt;/li&gt;&lt;li&gt;Best practices in C&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Handling integer overflow on the toolchain level in C/C++&lt;/li&gt;&lt;li&gt;Best practices in C++&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Integer handling best practices in C++&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Other numeric problems
&lt;ul&gt;
&lt;li&gt;Security issues with bitfields&lt;/li&gt;&lt;li&gt;Division by zero&lt;/li&gt;&lt;li&gt;Working with floating-point numbers&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Files and streams
&lt;ul&gt;
&lt;li&gt;Path traversal&lt;/li&gt;&lt;li&gt;Path traversal-related examples&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Path traversal&lt;/li&gt;&lt;li&gt;Link and shortcut following&lt;/li&gt;&lt;li&gt;Virtual resources&lt;/li&gt;&lt;li&gt;Path traversal best practices&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Path canonicalization
&lt;ul&gt;
&lt;li&gt;Format string issues&lt;/li&gt;&lt;li&gt;The problem with printf()&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Exploiting format string&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;DAY 4&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common software security weaknesses&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Time and state
&lt;ul&gt;
&lt;li&gt;Mapping to MISRA&lt;/li&gt;&lt;li&gt;Race conditions
&lt;ul&gt;
&lt;li&gt;Race condition in object data members&lt;/li&gt;&lt;li&gt;File race condition
&lt;ul&gt;
&lt;li&gt;Time of check to time of usage &amp;ndash; TOCTTOU&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; TOCTTOU&lt;/li&gt;&lt;li&gt;Insecure temporary file&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Potential race conditions in C/C++
&lt;ul&gt;
&lt;li&gt;Race condition in signal handling&lt;/li&gt;&lt;li&gt;Forking&lt;/li&gt;&lt;li&gt;Bit-field access&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Errors
&lt;ul&gt;
&lt;li&gt;Error and exception handling principles&lt;/li&gt;&lt;li&gt;Mapping to MISRA&lt;/li&gt;&lt;li&gt;Error handling
&lt;ul&gt;
&lt;li&gt;Returning a misleading status code&lt;/li&gt;&lt;li&gt;Error handling in C&lt;/li&gt;&lt;li&gt;Error handling in C++&lt;/li&gt;&lt;li&gt;Using std::optional safely&lt;/li&gt;&lt;li&gt;Information exposure through error reporting&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Exception handling
&lt;ul&gt;
&lt;li&gt;In the catch block. And now what?&lt;/li&gt;&lt;li&gt;Empty catch block&lt;/li&gt;&lt;li&gt;Exception handling in C++&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Exception handling mess&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;Data handling
&lt;ul&gt;
&lt;li&gt;Type mismatch&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Type mismatch&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&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Unreleased resource
&lt;ul&gt;
&lt;li&gt;Array disposal in C++&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Mixing delete and delete[]&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Control flow
&lt;ul&gt;
&lt;li&gt;Incorrect block delimitation&lt;/li&gt;&lt;li&gt;Dead code&lt;/li&gt;&lt;li&gt;Leftover debug code&lt;/li&gt;&lt;li&gt;Backdoors, dev functions and other undocumented functions&lt;/li&gt;&lt;li&gt;Using if-then-else and switch defensively&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Signal handling
&lt;ul&gt;
&lt;li&gt;Signal handlers&lt;/li&gt;&lt;li&gt;Best practices&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Object oriented programming pitfalls
&lt;ul&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;ul&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;/li&gt;&lt;li&gt;Memory and pointers
&lt;ul&gt;
&lt;li&gt;Memory and pointer issues&lt;/li&gt;&lt;li&gt;Pointer handling pitfalls&lt;/li&gt;&lt;li&gt;Alignment&lt;/li&gt;&lt;li&gt;Null pointers
&lt;ul&gt;
&lt;li&gt;NULL dereference&lt;/li&gt;&lt;li&gt;NULL dereference in pointer-to-member operators&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Pointer usage in C and C++
&lt;ul&gt;
&lt;li&gt;Use after free&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Use after free&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Runtime instrumentation&lt;/li&gt;&lt;li&gt;Double free&lt;/li&gt;&lt;li&gt;Memory leak&lt;/li&gt;&lt;li&gt;Smart pointers and RAII&lt;/li&gt;&lt;li&gt;Smart pointer challenges&lt;/li&gt;&lt;li&gt;Incorrect pointer arithmetics&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;File I/O
&lt;ul&gt;
&lt;li&gt;Working with file descriptors, structures and objects&lt;/li&gt;&lt;li&gt;File reading and writing&lt;/li&gt;&lt;li&gt;File access functions and methods&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Using vulnerable components&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Assessing the environment&lt;/li&gt;&lt;li&gt;Hardening&lt;/li&gt;&lt;li&gt;Vulnerability management
&lt;ul&gt;
&lt;li&gt;Patch management&lt;/li&gt;&lt;li&gt;Bug bounty programs&lt;/li&gt;&lt;li&gt;Vulnerability databases&lt;/li&gt;&lt;li&gt;Vulnerability rating &amp;ndash; CVSS&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Finding vulnerabilities in third-party components&lt;/li&gt;&lt;li&gt;DevOps, the build process and CI / CD&lt;/li&gt;&lt;li&gt;Insecure compiler optimization&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Security testing&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Security testing vs functional testing&lt;/li&gt;&lt;li&gt;Manual and automated methods&lt;/li&gt;&lt;li&gt;Security testing techniques and tools
&lt;ul&gt;
&lt;li&gt;Code analysis
&lt;ul&gt;
&lt;li&gt;Security aspects of code review&lt;/li&gt;&lt;li&gt;Static Application Security Testing (SAST)&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Using static analysis tools&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Dynamic analysis
&lt;ul&gt;
&lt;li&gt;Security testing at runtime&lt;/li&gt;&lt;li&gt;Penetration testing&lt;/li&gt;&lt;li&gt;Stress testing&lt;/li&gt;&lt;li&gt;Dynamic analysis tools
&lt;ul&gt;
&lt;li&gt;Dynamic Application Security Testing (DAST)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Fuzzing
&lt;ul&gt;
&lt;li&gt;Fuzzing techniques&lt;/li&gt;&lt;li&gt;Fuzzing &amp;ndash; Observing the process&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Wrap up&lt;/strong&gt;
&lt;/p&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 Schr&amp;ouml;der&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;And now what?
&lt;ul&gt;
&lt;li&gt;Software security sources and further reading&lt;/li&gt;&lt;li&gt;C and C++ resources&lt;/li&gt;&lt;li&gt;Links to automotive coding standards&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</outline><objective_plain>- Getting familiar with essential cyber security concepts
- Learning about security specialties of the automotive sector
- Identify vulnerabilities and their consequences
- Learn the security best practices in C and C++
- Input validation approaches and principles
- Managing vulnerabilities in third party components
- Understanding security testing methodology and approaches
- Getting familiar with common security testing techniques and tools</objective_plain><essentials_plain>General C/C++ development</essentials_plain><audience_plain>- Automotive Sector
- C/C++ developers</audience_plain><contents_plain>- Cyber security basics
- Buffer overflow
- Memory management hardening
- Common software security weaknesses
- Using vulnerable components
- Security testing
- Wrap up</contents_plain><outline_plain>DAY 1 

Cyber security basics



- What is security?
- Threat and risk
- Cyber security threat types
- Consequences of insecure software

- Constraints and the market
- The dark side
- Categorization of bugs

- The Seven Pernicious Kingdoms
- SEI CERT Secure Coding Guidelines
- Coding standards in automotive

- ISO 26262
- MISRA C 2012
- MISRA C++ 2008
- AUTOSAR C++14 and the future
- CERT C Coding Standard
- CERT C++ Coding Standard
- Cyber security in the automotive sector

- Software security in the automotive world
- Threats and trends in automotive
- Self-driving car threats
- The CAN bus and security
- Case study – controlling the CAN bus through the infotainment system
Buffer overflow



- Assembly basics and calling conventions

- ARM assembly essentials
- Registers and addressing
- Basic ARM64 instructions
- ARM calling conventions

- The calling convention
- The stack frame
- Calling convention implementation on ARM64
- Stacked function calls
- Memory management vulnerabilities

- Memory management and security
- Vulnerabilities in the real world
- Mapping to MISRA
- 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
- Buffer overflow on the heap

- Unsafe unlinking
- Case study – Heartbleed
- 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
- What’s the problem with asctime()?
- Lab – The problem with asctime()
- Using std::string in C++
DAY 2

Buffer overflow



- Some typical mistakes leading to BOF

- Unterminated strings
- readlink() and string termination
- Manipulating C-style strings in C++
- Malicious string termination
- Lab – String termination confusion
- String length calculation mistakes
- Off-by-one errors
- Allocating nothing
Memory management hardening



- Mapping to MISRA
- Securing the toolchain

- Securing the toolchain in C and C++
- Compiler warnings and security
- Using FORTIFY_SOURCE
- Lab – Effects of FORTIFY
- AddressSanitizer (ASan)

- Using AddressSanitizer (ASan)
- ASan changes to the prologue
- ASan changes to memory read/write operations
- ASan changes to epilogue
- 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
- Heap spraying
- 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)

- Lab – ROP demonstration
- Protection against ROP
Common software security weaknesses



- Security features

- Authentication

- Authentication basics
- Multi-factor authentication
- Authentication weaknesses – spoofing
- Case study – Hacking the Mitsubishi Outlander PHEV hybrid
- 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
- Case study – The Ashley Madison data breach

- The dictionary attack
- The ultimate crack
- Exploitation and the lessons learned
- Password database migration
- Outbound password management

- Hard coded passwords
- Best practices
- Lab – Hardcoded password
- Protecting sensitive information in memory

- Challenges in protecting memory
- Heap inspection
- Compiler optimization challenges
- Lab – Zeroization challenges
- Sensitive info in non-locked memory
- Authorization

- Access control basics
- File system access control

- Improper file system access control
- Ownership
- chroot jail
- Using umask()
- Linux filesystem
- LDAP

DAY 3

Common software security weaknesses



- Input validation

- Input validation principles

- Blacklists and whitelists
- Data validation techniques
- What to validate – the attack surface
- Attack surface in automotive
- Where to validate – defense in depth
- How to validate – validation vs transformations
- Output sanitization
- Encoding challenges
- Validation with regex
- Mapping to MISRA
- Injection

- Injection principles
- Injection attacks
- 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
- Case study – Shellshock
- Lab – Shellshock
- Case study – Command injection in Jeep Cherokee
- Process control – library injection

- DLL hijacking
- Lab – DLL hijacking
- Integer handling problems

- Representing signed numbers
- Integer visualization
- The MISRA essential type model
- Integer promotion
- Composite expressions and type conversion
- Integer overflow
- Lab – Integer overflow
- Signed / unsigned confusion
- Lab – Signed / unsigned confusion
- Integer truncation
- Lab – Integer truncation
- Case study – WannaCry
- Best practices

- Upcasting
- Precondition testing
- Postcondition testing
- Using big integer libraries
- Best practices in C
- Lab – Handling integer overflow on the toolchain level in C/C++
- Best practices in C++
- Lab – Integer handling best practices in C++
- Other numeric problems

- Security issues with bitfields
- Division by zero
- Working with floating-point numbers
- Files and streams

- Path traversal
- Path traversal-related examples
- Lab – Path traversal
- Link and shortcut following
- Virtual resources
- Path traversal best practices
- Lab – Path canonicalization

- Format string issues
- The problem with printf()
- Lab – Exploiting format string
DAY 4

Common software security weaknesses



- Time and state

- Mapping to MISRA
- Race conditions

- Race condition in object data members
- File race condition

- Time of check to time of usage – TOCTTOU
- Lab – TOCTTOU
- Insecure temporary file
- Potential race conditions in C/C++

- Race condition in signal handling
- Forking
- Bit-field access
- Errors

- Error and exception handling principles
- Mapping to MISRA
- Error handling

- Returning a misleading status code
- Error handling in C
- Error handling in C++
- Using std::optional safely
- Information exposure through error reporting
- Exception handling

- In the catch block. And now what?
- Empty catch block
- Exception handling in C++
- Lab – Exception handling mess
- Code quality

- 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[]
- Control flow

- Incorrect block delimitation
- Dead code
- Leftover debug code
- Backdoors, dev functions and other undocumented functions
- Using if-then-else and switch defensively
- Signal handling

- Signal handlers
- Best practices
- 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
- Memory and pointers

- Memory and pointer issues
- Pointer handling pitfalls
- Alignment
- Null pointers

- NULL dereference
- NULL dereference in pointer-to-member operators
- Pointer usage in C and C++

- Use after free
- Lab – Use after free
- Lab – Runtime instrumentation
- Double free
- Memory leak
- Smart pointers and RAII
- Smart pointer challenges
- Incorrect pointer arithmetics
- File I/O

- Working with file descriptors, structures and objects
- File reading and writing
- File access functions and methods
Using vulnerable components



- Assessing the environment
- Hardening
- Vulnerability management

- Patch management
- Bug bounty programs
- Vulnerability databases
- Vulnerability rating – CVSS
- Lab – Finding vulnerabilities in third-party components
- DevOps, the build process and CI / CD
- Insecure compiler optimization
Security testing



- Security testing vs functional testing
- Manual and automated methods
- Security testing techniques and tools

- Code analysis

- Security aspects of code review
- Static Application Security Testing (SAST)
- Lab – Using static analysis tools
- Dynamic analysis

- Security testing at runtime
- Penetration testing
- Stress testing
- Dynamic analysis tools

- Dynamic Application Security Testing (DAST)
- Fuzzing

- Fuzzing techniques
- Fuzzing – Observing the process
Wrap up



- Secure coding principles

- Principles of robust programming by Matt Bishop
- Secure design principles of Saltzer and Schröder
- And now what?

- Software security sources and further reading
- C and C++ resources
- Links to automotive coding standards</outline_plain><duration unit="d" days="4">4 Tage</duration><pricelist><price country="SI" currency="EUR">3000.00</price><price country="DE" currency="EUR">3000.00</price><price country="AT" currency="EUR">3000.00</price><price country="GB" currency="EUR">3000.00</price><price country="IT" currency="EUR">3000.00</price><price country="NL" currency="EUR">3000.00</price><price country="BE" currency="EUR">3000.00</price><price country="FR" currency="EUR">3000.00</price><price country="MK" currency="EUR">3000.00</price><price country="GR" currency="EUR">3000.00</price><price country="HU" currency="EUR">3000.00</price></pricelist><miles/></course>