<?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="30330" language="de" source="https://portal.flane.ch/swisscom/xml-course/cydrill-secc-ccppmd" lastchanged="2026-01-12T11:23:49+01:00" parent="https://portal.flane.ch/swisscom/xml-courses"><title>Secure coding in C and C++ for medical devices</title><productcode>SECC-CCPPMD</productcode><vendorcode>CY</vendorcode><vendorname>Cydrill</vendorname><fullproductcode>CY-SECC-CCPPMD</fullproductcode><version>1</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 healthcare 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;/ul&gt;</objective><essentials>&lt;p&gt;General C/C++ development&lt;/p&gt;</essentials><audience>&lt;p&gt;C/C++ developers developing medical devices&lt;/p&gt;</audience><outline>&lt;h4&gt;Day 1&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cyber security basics&lt;/strong&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 &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;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Regulations and standards&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Healthcare data protection regulations&lt;/li&gt;&lt;li&gt;Regulations for medical devices&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cyber security in the healthcare sector&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Threats to medical devices&lt;/li&gt;&lt;li&gt;Attackers and motivation&lt;/li&gt;&lt;li&gt;The problem of legacy systems&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Memory management vulnerabilities&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Assembly basics and calling conventions&lt;/strong&gt;&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;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Buffer overflow&lt;/strong&gt;&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;Buffer security issues&lt;/li&gt;&lt;li&gt;Buffer overflow on the stack&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Day 2&lt;/h4&gt;&lt;p&gt;
&lt;strong&gt;Memory management vulnerabilities&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Best practices and some typical mistakes&lt;/strong&gt;&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;#039;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;li&gt;&lt;strong&gt;Some typical mistakes leading to BOF&lt;/strong&gt;&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;Case study &amp;ndash; Off-by-one error in VxWorks TCP &amp;#039;Urgent Data&amp;#039; parsing&lt;/li&gt;&lt;li&gt;Allocating nothing&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Memory management hardening&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Securing the toolchain&lt;/strong&gt;&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;/li&gt;&lt;li&gt;RELRO protection against GOT hijacking&lt;/li&gt;&lt;li&gt;Heap overflow protection&lt;/li&gt;&lt;li&gt;Stack smashing protection&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Runtime protections&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Runtime instrumentation&lt;/li&gt;&lt;li&gt;Address Space Layout Randomization (ASLR)&lt;/li&gt;&lt;li&gt;Non-executable memory areas&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Common software security weaknesses&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Security features&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Authentication&lt;/li&gt;&lt;li&gt;Authorization&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Day 3&lt;/h4&gt;&lt;p&gt;
&lt;strong&gt;Common software security weaknesses&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Security features (continued)&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Password management&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;&lt;strong&gt;Input validation&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Input validation principles&lt;/li&gt;&lt;li&gt;Denylists and allowlists&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Improper input validation in Natus Xltek NeuroWorks 8&lt;/li&gt;&lt;li&gt;What to validate &amp;ndash; the attack surface&lt;/li&gt;&lt;li&gt;Where to validate &amp;ndash; defense in depth&lt;/li&gt;&lt;li&gt;When 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;Unicode challenges&lt;/li&gt;&lt;li&gt;Validation with regex&lt;/li&gt;&lt;li&gt;Regular expression denial of service (ReDoS)&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; ReDoS in C&lt;/li&gt;&lt;li&gt;Dealing with ReDoS&lt;/li&gt;&lt;li&gt;Integer handling problems&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Day 4&lt;/h4&gt;&lt;p&gt;
&lt;strong&gt;Common software security weaknesses&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Input validation&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Injection&lt;/li&gt;&lt;li&gt;Process control&lt;/li&gt;&lt;li&gt;Files and streams&lt;/li&gt;&lt;li&gt;Format string issues&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Time and state&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Race conditions&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Errors&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Error and exception handling principles&lt;/li&gt;&lt;li&gt;Error handling&lt;/li&gt;&lt;li&gt;Exception handling&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Code quality&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Code quality and security&lt;/li&gt;&lt;li&gt;Data handling&lt;/li&gt;&lt;li&gt;Object oriented programming pitfalls&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Wrap up&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Secure coding principles&lt;/li&gt;&lt;li&gt;And now what?&lt;/li&gt;&lt;/ul&gt;</outline><objective_plain>- Getting familiar with essential cyber security concepts
- Learning about security specialties of the healthcare sector
- Identify vulnerabilities and their consequences
- Learn the security best practices in C and C++
- Input validation approaches and principles</objective_plain><essentials_plain>General C/C++ development</essentials_plain><audience_plain>C/C++ developers developing medical devices</audience_plain><outline_plain>Day 1


- Cyber security basics
- What is security?
- Threat and risk
- Cyber security threat types – the CIA triad
- Cyber security threat types – the STRIDE model
- Consequences of insecure software
- Regulations and standards
- Healthcare data protection regulations
- Regulations for medical devices
- Cyber security in the healthcare sector
- Threats to medical devices
- Attackers and motivation
- The problem of legacy systems
Memory management vulnerabilities


- Assembly basics and calling conventions
- x64 assembly essentials
- Registers and addressing
- Most common instructions
- Calling conventions on x64
- Buffer overflow
- Memory management and security
- Vulnerabilities in the real world
- Buffer security issues
- Buffer overflow on the stack
Day 2


Memory management vulnerabilities


- 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++
- 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
- Case study – Off-by-one error in VxWorks TCP 'Urgent Data' parsing
- Allocating nothing
Memory management hardening


- Securing the toolchain
- Securing the toolchain in C and C++
- Compiler warnings and security
- Using FORTIFY_SOURCE
- Lab – Effects of FORTIFY
- AddressSanitizer (ASan)
- RELRO protection against GOT hijacking
- Heap overflow protection
- Stack smashing protection
- Runtime protections
- Runtime instrumentation
- Address Space Layout Randomization (ASLR)
- Non-executable memory areas
Common software security weaknesses


- Security features
- Authentication
- Authorization
Day 3


Common software security weaknesses


- Security features (continued)
- Password management
Common software security weaknesses


- Input validation
- Input validation principles
- Denylists and allowlists
- Case study – Improper input validation in Natus Xltek NeuroWorks 8
- What to validate – the attack surface
- Where to validate – defense in depth
- When to validate – validation vs transformations
- Output sanitization
- Encoding challenges
- Unicode challenges
- Validation with regex
- Regular expression denial of service (ReDoS)
- Lab – ReDoS in C
- Dealing with ReDoS
- Integer handling problems
Day 4


Common software security weaknesses


- Input validation
- Injection
- Process control
- Files and streams
- Format string issues
Time and state


- Race conditions
Errors


- Error and exception handling principles
- Error handling
- Exception handling
Code quality


- Code quality and security
- Data handling
- Object oriented programming pitfalls
Wrap up


- Secure coding principles
- And now what?</outline_plain><duration unit="d" days="4">4 Tage</duration><pricelist><price country="DE" currency="EUR">3000.00</price><price country="CH" currency="CHF">3300.00</price></pricelist><miles/></course>