Secure Coding in C and C++

Producing secure programs requires secure designs. However, even the best designs can lead to insecure programs if developers are unaware of the many security pitfalls inherent in C and C++ programming. This four-day course provides a detailed explanation of common programming errors in C and C++ and describes how these errors can lead to code that is vulnerable to exploitation. The course concentrates on security issues intrinsic to the C and C++ programming languages and associated libraries. The intent is for this course to be useful to anyone involved in developing secure C and C++ programs regardless of the specific application.

Please note: you must bring a laptop computer equipped with the latest version of Adobe Reader and VMware Player. See the Prerequisites section for download information.

The course assumes basic C and C++ programming skills but does not assume an in-depth knowledge of software security. The ideas presented apply to various development environments, but the examples are specific to Microsoft Visual Studio and Linux/GCC and the 32-bit Intel Architecture (IA-32). Material in this presentation was derived from the Addison-Wesley books Secure Coding in C and C++ and The CERT C Secure Coding Standard.

Who should attend?

This course is designed for C and C++ developers.


Topics

  • string management
  • dynamic memory management
  • integer security
  • formatted output
  • file I/O

Subjects covered in the first two days are general, but examples are taken from both the Microsoft Visual Studio and GCC compilers on Windows and Linux platforms. Course material on integers uses examples from the IA-32 architecture.

The third and fourth days of the course focus on POSIX platforms. Doug Lea's malloc (dlmalloc) is used to demonstrate exploits in the Linux environment, while the file I/O sections focus on UNIX and the UNIX file system (UFS).

An online demonstration version of the integer module of this course can be accessed at http://oli.web.cmu.edu. Enter the course key: scodedemo.


Objectives

Participants should come away from this course with a working knowledge of common programming errors that lead to software vulnerabilities, how these errors can be exploited, and effective mitigation strategies for preventing the introduction of these errors. In particular, participants will learn how to

  • improve the overall security of any C or C++ application
  • thwart buffer overflows and stack-smashing attacks that exploit insecure string manipulation logic
  • avoid vulnerabilities and security flaws resulting from the incorrect use of dynamic memory management functions
  • eliminate integer-related problems: integer overflows, sign errors, and truncation errors
  • correctly use formatted output functions without introducing format-string vulnerabilities
  • avoid I/O vulnerabilities, including race conditions

Moreover, this course encourages programmers to adopt security best practices and develop a security mindset that can help protect software from tomorrow's attacks, not just today's.

Prerequisites

It is recommended that participants have a basic to intermediate understanding of the C and C++ programming languages. Software security knowledge or experience is not required.

Required Equipment

Students must bring a personal computer equipped with

Materials

The Secure Coding in C and C++, Second Edition and The CERT® C Coding Standard, Second Edition: 98 Rules for Developing Safe, Reliable, and Secure Systems (2nd Edition) books authored by Robert C. Seacord and published by Addison-Wesley will be provided. Participants will also receive a CD containing course and reference materials.

Schedule

This four-day class meets at the following times:

Days 1-4, 9:00 a.m. - 5:00 p.m. (U.S. Locations)
Days 1-4, 9:30 a.m. - 5:30 p.m. (non-U.S. Locations)

Course Details

Course Fees [USD]

U.S. Industry: $2500

U.S. Government/Academic: $2000

International: $3750

Please select a course offering then click REGISTER.
 

2014 Dates

August 19 - 22, 2014 (SEI, Pittsburgh, PA)

 
This course may be offered by special arrangement at customer sites.

For More Information

E-mail: course-info@sei.cmu.edu
Phone: 412-268-7622


Help us improve

Visitor feedback helps us continually improve our site.

Please tell us what you
think with this short
(< 5 minute) survey.