Week 1, Lecture 2 — Why Secure Programming Matters
Module: COMP09031 — Cybersecurity & Secure Programming
Before the lecture
Read Chapter 2 — Week 1, Lecture 2: Why Secure Programming Matters in the book PDF (approximately 14 pages, 30 minutes reading time). The chapter’s spine is three real breaches — TalkTalk 2015, British Airways 2018, MOVEit 2023 — and the bug-to-breach pipeline they share. The 28–35 min block on AI coding assistants is the set piece students will remember most.
Slides
- Download
wk01_lecture02.pptx— open in PowerPoint, Keynote, or LibreOffice Impress to deliver. Speaker notes carry the talking points and time hints. - Download
wk01_lecture02.pdf— PDF export for printing or quick reference.
Lecture timing
A 50-minute slot is realistically 45–50 minutes of room time. 35 min of content + 5 min embedded interlude + 5–10 min slack for arrivals, transitions, and Q&A.
| Block | Time | Notes |
|---|---|---|
| TalkTalk and the bug-to-breach pipeline | 0–10 min | Walk the diagram explicitly; same shape returns in Ch 4 (Threat Modelling) and Ch 17 (Web Application Security) |
| The numbers, briefly | 10–15 min | Verizon DBIR + IBM cost-of-breach headline. Skim; do not read footnotes |
| Embedded interlude — live OWASP Top 10 movement | 15–20 min | See the script below |
| Why good developers write insecure code | 20–28 min | Acar 2016 + Perry 2023 are the heart of the lecture; spend time here |
| AI coding assistants | 28–35 min | Pearce 40% / Perry “more confident, less secure” / Veracode 45% — the most important slide |
| Trustworthy Computing & Heartbleed | 35–40 min | “Cultural change is possible” — that is the line |
If you run short, drop the cost-of-fix curve discussion — the chapter covers it in more detail than the lecture needs.
Embedded interlude — live OWASP Top 10 movement (~5 min)
Setup. “Open this URL on your laptop. We’ll spend five minutes here — close everything else.”
Activity.
- Have students click into A03:2021 — Injection.
- Read its current rank aloud, then ask: “Anyone know where this category sat in the previous edition?”
- Reveal: Injection was A01 from 2010 through 2017, dropped to A03 in 2021.
- Click into A01:2021 — Broken Access Control and point at the new top of the list.
Talking points.
- Why Injection was demoted — parameterised queries became framework defaults; ORMs do the work.
- Why Broken Access Control rose — authorisation bugs are now the dominant class. Capital One 2019 SSRF, the Optus 2022 unauth API, the IDOR/BOLA family.
- The Top 10 is a moving picture, not a fixed canon. Read it as “where the bug-class energy is going”.
- Forward-point to Chapter 17 (W6 L2) where Broken Access Control depth lives.
Expected student response. Surprise that “the classic” got demoted. Some students will conflate Injection with SQL injection specifically — the OWASP category is broader (XSS, command injection, NoSQL, etc.).
Wrap. “Read the Top 10 every year when it updates. The categories tell you where the industry’s eyes are. Now back to why developers keep writing the bugs in the first place.”
Pre-lecture link check. Two minutes before class, click each link below and confirm it loads. OWASP occasionally restructures its URLs; better to know now than to fumble live.
Links from this lecture
Every external reference cited in the chapter, organised by topic.
TalkTalk 2015
- Information Commissioner’s Office. TalkTalk cyber attack — how the ICO’s investigation unfolded. https://ico.org.uk/about-the-ico/media-centre/talktalk-cyber-attack-how-the-ico-investigation-unfolded/
British Airways 2018
- ICO. ICO fines British Airways £20m for data breach affecting more than 400,000 customers. 16 October 2020. https://ico.org.uk/about-the-ico/media-centre/news-and-blogs/2020/10/ico-fines-british-airways-20m-for-data-breach-affecting-more-than-400-000-customers/
- RiskIQ / Microsoft Defender Threat Intelligence. Inside the Magecart breach of British Airways. https://www.riskiq.com/blog/external-threat-management/magecart-british-airways-breach/
MOVEit 2023
- CISA. #StopRansomware: CL0P Ransomware Gang Exploits CVE-2023-34362 MOVEit Vulnerability (AA23-158A). https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-158a
- Palo Alto Networks Unit 42. Threat Brief: MOVEit Transfer SQL Injection Vulnerabilities. https://unit42.paloaltonetworks.com/threat-brief-moveit-cve-2023-34362/
The catalogues
- OWASP. OWASP Top 10:2025 (finalised December 2025). https://owasp.org/Top10/2025/
- MITRE. 2024 CWE Top 25 Most Dangerous Software Weaknesses. https://cwe.mitre.org/top25/archive/2024/2024_top25_list.html
The numbers
- Verizon Business. 2025 Data Breach Investigations Report. https://www.verizon.com/business/resources/reports/dbir/
- Mandiant / Google Cloud. M-Trends 2025. https://cloud.google.com/blog/topics/threat-intelligence/m-trends-2025
- IBM Security & Ponemon. Cost of a Data Breach Report 2025. https://www.ibm.com/reports/data-breach
- Linux Foundation / OpenSSF. Secure Software Development Education 2024 Survey. https://www.linuxfoundation.org/research/software-security-education-study
The cost-of-fix curve, with a hedge
- Anderson, Tim. The Register, 22 July 2021. “Everyone cites that ‘bugs are 100x more expensive to fix in production’ research, but the study might not even exist.” https://www.theregister.com/2021/07/22/bugs_expense_bs/ — flag this verbally, do not dwell.
Why good developers write insecure code
- Acar, Yasemin et al. You Get Where You’re Looking For: The Impact of Information Sources on Code Security. IEEE S&P 2016. https://publications.cispa.saarland/1103/
- Fischer, Felix et al. Stack Overflow Considered Harmful? IEEE S&P 2017. https://publications.cispa.saarland/922/
- Jallow, Akond et al. Measuring the Effects of Stack Overflow Code Snippet Evolution on Open-Source Software Security. IEEE S&P 2024. https://trust.cispa.saarland/publication/jallow-sp-24/jallow-sp-24.pdf
AI coding assistants — the Pearce / Perry / Veracode triad
- Pearce, Hammond et al. Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions. IEEE S&P 2022 (Distinguished Paper). https://arxiv.org/abs/2108.09293
- Perry, Neil et al. Do Users Write More Insecure Code with AI Assistants? ACM CCS 2023. https://arxiv.org/abs/2211.03622
- Snyk. 2024 AI Code Security Report. https://snyk.io/lp/secure-adoption-in-the-genai-era/
- Veracode. 2025 GenAI Code Security Report, October 2025. https://www.veracode.com/resources/analyst-reports/2025-genai-code-security-report/
- GitClear. AI Copilot Code Quality: 2025 Data. https://www.gitclear.com/ai_assistant_code_quality_2025_research
Cultural inflections
- Gates, Bill. Trustworthy Computing memo, 15 January 2002. Wired reproduced the full text: https://www.wired.com/2002/01/bill-gates-trustworthy-computing/
- Microsoft Security Blog. Celebrating 20 Years of Trustworthy Computing, 21 January 2022. https://www.microsoft.com/en-us/security/blog/2022/01/21/celebrating-20-years-of-trustworthy-computing/
Common student questions (and short answers)
- “Why do these bugs keep shipping if everyone knows about them?” — Three reasons. (1) Knowledge is unevenly distributed; the developer who shipped the bug had not read the OWASP Top 10. (2) Time pressure; the team had a deadline and the security team had no veto. (3) Inherited code; nobody alive remembered the legacy webpages TalkTalk inherited from Tiscali. The honest answer is “people, not technology”, which is why this module spends as much time on culture as on code.
- “Should I just stop using Copilot then?” — No. The Perry data shows that the bad outcome correlates with uncritical use, not with use itself. Healthy scepticism, prompt iteration, reading the output critically — these are the behaviours that work. Treat the assistant as a junior pair, not as an oracle.
- “The cost-of-fix numbers seem suspicious.” — They are. The Bossavit / Register critique is real; the original Boehm 1981 study is solid but smaller in scope, and the IBM Systems Sciences Institute citation that everyone repeats is not traceable to a primary source. Ranges, not point estimates. The general direction is right — fixing late costs more than fixing early — but be sceptical of any clean 100× number.
End-of-lecture self-check
Optional, formative — not graded. Click an option to see immediate feedback.
Going Further
- Pearce, Hammond et al. Asleep at the Keyboard? IEEE S&P 2022. — The original alarm about LLM-generated code. The methodology is straightforward; read it before you read any popular-press piece on AI and security.
- Perry, Neil et al. Do Users Write More Insecure Code with AI Assistants? ACM CCS 2023. — The user-study companion to Pearce. The “more confident, less secure” finding is the one that matters most for working developers.
- Bossavit, Laurent. The Leprechauns of Software Engineering (2015), Chapter 10. — Historical detective work on the cost-of-fix curve. Worth reading in full if you ever cite the 100× number.
- Howard, Michael, and David LeBlanc. Writing Secure Code, 2nd ed. (Microsoft Press, 2003). — The book the Trustworthy Computing pause produced. Twenty years on, much of it still lands.