Secure Programming

2020: Secure Programming is not running this year, but please enjoy the materials here. University of Edinburgh students should be able to access 2019 lecture recordings on Learn.

Secure Programming is a Level 11 course given in Semester 1. See the DRPS or PATH for syllabus and assessment information.

The course lecturer is David Aspinall.

Lectures were held:

  • Tuesdays 2.10pm, Thursdays 2.10pm

The final 2019 lecture was on Thu 21st Nov.

The course is aimed at MSc students and 4th/5th year undergraduates. You will need background from a previous course in Computer Security, such as our courses Computer Security or Research Methods in Security, Privacy and Trust.

The course considers on software security broadly, discussing attacks as well as defensive programming. A good programming and systems background will be necessary.

Lecture slides and other materials appear here as the course goes along. There is no fixed text book. Reading recommendations will be given in lectures and slides. See the links in the first lecture for some starting points.

Resources on Learn

All course content will be published on this web page. On Learn (UoE only) you can access the lecture recordings.


You can ask questions and discuss the course on Piazza Q&A. Please do not disclose any coursework answers in any public questions.

Slides and reading

To preview likely upcoming material, please see the previous session of this course.

1.   Introduction     view     print    more
2.   Landscape     view     print    more
3.   Memory Corruption     view     print    more
4.   MC: Stacks & Heaps     view     print    more
5.   MC: Countermeasures     view     print    more
6.   CWEs, Injection     view     print    more
7.   SQL Injection     view     print    more
8.   Race Conditions     view     print    more
9.   Development     view     print    more
10.   Web I (authentication)     view     print    more
11.   Web II (urls,xss,authr’n)     view     print    more
12.   Web Apps III (leakage +)     view     print    more
13.   Static Analysis     view     print    more
14.   Static Analysis II     view     print    more
15.   Information Leakage     view     print    more
16.   Software Protection     view     print    more
17.   Android Malware     view     print    more
18.   Malware     view     print    more
19.   Summary     view     print    more


There will 4 main lab sessions in the course, consisting of guided exercises with checkpoint questions. You are encouraged to take brief notes as answers to checkpoints which you may submit to us for additional feedback. The final lab session in Week 11 is optional and not a formal part of the course.

Labs will be held in AT 5.05 West Lab, on:

  • Fridays 2pm-5pm Weeks 3, 5, 7, 9 and 11.
1. (4th Oct)    Env & SUID (+overflows)
2. (18th Oct) Injection
3. (1st Nov)    Race Conditions (+shellshock)
4. (15th Nov)    XSS (+CSRF)
4. (22nd Nov)    Session by SIGINT

The labs are an essential part of the delivery of the course and supported by hands-on demonstrators. You may undertake labs in your own time but you will not have access to the lab demonstrators.


There is one assessed coursework for the course, split into two halves.

The combined deadline is 5pm 15th Nov.


Home : Teaching : Courses 

Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail:
Please contact our webadmin with any comments or corrections. Logging and Cookies
Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh