Why Should You Take This Course? Why Should You Not Take This Course?

Why Should You Take This Course? Why Should You Not Take This Course?

Outline Orientation Motivations Secure Programming Lecture 1: Introduction Topics in the course This course is Secure Programming It is taught by David Aspinall Practicalities David Aspinall, Informatics @ Edinburgh In the School of Informatics at the University of Edinburgh. Recommended resources 13th January 2014 References What is this course about? Why should you take this course? Why should you not take this course? É Building software that’s more secure É finding security flaws in existing software É avoiding flaws in new software É Want to work in the cyber security industry? É techniques, tools and understanding to do this É None of the previous points apply É security appraisal, system and code reviewing É You don’t have the right background (see next slide) A better title might be Software Security É ethical hacking É É malware analysis You don’t want to risk taking a new course It’s not only about the programming. É cyber defence (or attack, espionage, . ) É running earlier than expected É materials are still in development É Want to work in security research? É Infrastructure around software É will have teething troubles É academic (conceptual advances, fixing, breaking) É language, libraries, run-time; other programs É please bear with us É commercial (mainly breaking and fixing) É data storage, distributed software É honest, constructive feedback is very welcome É (Hopefully): you think it’s fun and interesting! É Security policies: É what should be protected É what is trusted É Risk assessment Target audience Learning outcomes Safety versus security Here is the list from the Course Catalogue Entry: É Aimed at 4th year UGs É Should have passed 3rd year Computer Security 1. Know how to respond to security alerts (concerning Safety is concerned with ensuring bad things don’t É Programming practice software) happen accidently. For example, aeroplanes don’t fall É should be confident in programming 2. Identify possible security programming errors when out of the sky because maintenance checks are É necessarily will use a range of languages conducting code reviews in languages such as Java, forgotten. É . including some C C or Python Security is concerned with with ensuring that bad É but don’t have be “master hacker” 3. Define a methodology for security testing and use things don’t happen because of malicious actions by É Programming theory appropriate tools in its implementation others. For example, terrorists cannot drive bombs into 4. Apply new security-enhanced programming models É interest in PL concepts and design airport departure halls. É knowledge of compilers useful and tools which help ensure security goals, e.g., É also software engineering, esp testing with access control, information flow tracking, É theory courses helpful, semantics protocol implementation, or atomicity enforcement. The challenge of software security Cost estimates are difficult But it’s agreed they’re increasing. Software artefacts are among the most complex built. É Design flaws are likely É Bugs are near inevitable Flaws and bugs lead to vulnerabilities which are exploited by attackers. Usually: to learn secrets, obtain money. Cyber warfare is real And privacy is disappearing Why isn’t software security better? Why (else) isn’t software security better? What’s the outlook? Dimensions: practice and theory Practice É Programming securely, identifying security issues É Asymmetry: attackers have the advantage New frontiers: É Mistakes in language, APIs, crypto, comms. É just need to find one viable attack route É Ultimately: detailed, highly specific knowledge É defenders have to anticipate all É PCs in decline, but connected devices increasing É Attackers focus on weakest links: É Mobile new target point (convergence, mobility) Theory É since 1990s, network security defences vastly É Cloud storage: storage providers, protocols improved É Cyber resilience: need for automatic response, É Understand reasons for failure, ways to mitigate patching É Understand advanced techniques, automated tools É Current penetrate-and-patch approach is broken É Secure programming practice must extend to new É In general: transferable concepts and methods. É understood by managers and developers (“show me domains, modes the problem!”) This is not really a “vocational” course. I hope it will É but no substitute for secure design give you the foundation to allow you to rapidly develop detailed specific knowledge needed later. There are a number of certification schemes for building practical knowledge. Overview of topics Threats Vulnerabilities General organisation: É Threats É What attackers want, can do É Overflows – example next É Vulnerabilities É Types of bad code: malware, spyware, PUPs É Injections É Defences É How bad code gets in É Race conditions É Processes É Classification of vulnerabilities and weaknesses, É Information leaks É Emerging Methods CVE/CWEs We’ll look at details under each of these headings (in various orders). Overflow example Overflow example What is a BDF file? 338 char charName[100]; STARTFONT 2.1 339 int ignore; 338 char charName[100]; COMMENT 340 339 int ignore; COMMENT Copyright (c) 1999, Thomas A. Fine 341 if (sscanf((char *) line, "STARTCHAR %s", charName) !=1){ 340 COMMENT 342 bdfError("bad character name in BDF file\n"); 341 if (sscanf((char *) line, "STARTCHAR %s", charName) !=1){ ... 343 goto BAILOUT; /* bottom of function, free and return error */ 342 bdfError("bad character name in BDF file\n"); FONT -atari-small 344 } 343 goto BAILOUT; /* bottom of function, free and return error */ SIZE 11 75 75 344 } FONTBOUNDINGBOX 4 8 0 -1 STARTCHAR C000 SYNOPSIS ENCODING 0 Jan. 7, 2014 - Stack buffer overflow in parsing of BDF SWIDTH 1 0 #include <stdio.h> DWIDTH 4 0 font files in libXfont BBX 4 8 0 -1 int sscanf(const char *str, const char CVE-2013-6462: An authenticated X client can cause BITMAP *format, ...); 00 an X server to read a font file that overflows a buffer on 00 DESCRIPTION the stack in the X server, potentially leading to crash ... and/or privilege escalation in setuid servers. The fix is sscanf() scans input from the character string pointed included in libXfont 1.4.7. See the advisory for more É BDF = Bitmap Distribution Format to by str, according to format string. This may contain details. conversions; results are stored in locations pointed to É A (mostly) obsolete font format by Adobe by the pointer arguments that follow format. Advisory: Description Advisory: Affected Versions Advisory: Fix Scanning of the libXfont sources with the cppcheck static analyzer included a report: [lib/libXfont/src/bitmap/bdfread.c:341]: (warning) scanf without field width limits can crash... diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c index e2770dc..e11c5d2 100644 This bug appears to have been introduced in the initial --- a/src/bitmap/bdfread.c Evaluation of this report by X.Org developers concluded RCS version 1.1 checked in on 1991/05/10, and is +++ b/src/bitmap/bdfread.c that a BDF font file containing a longer than expected thus believed to be present in every X11 release @@ -338,7+338,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, char charName[100]; string could overflow the buffer on the stack. starting with X11R5 up to the current libXfont 1.4.6. int ignore; Testing in X servers built with Stack Protector resulted (Manual inspection shows it is present in the sources in an immediate crash when reading a user-provided from the X11R5 tarballs, but not in those from the - if (sscanf((char *) line, "STARTCHAR %s", charName) !=1){ + if (sscanf((char *) line, "STARTCHAR %99s", charName) !=1){ specially crafted font. X11R4 tarballs.) bdfError("bad character name in BDF file\n"); goto BAILOUT; /* bottom of function, free and return error */ As libXfont is used to read user-specified font files in all } X servers distributed by X.Org, including the Xorg server which is often run with root privileges or as setuid-root in order to access hardware, this bug may lead to an unprivileged user acquiring root privileges in some systems. Defences Processes Emerging methods É Protection mechanisms É Secure design principles É Methods and tools to find problems É Avoidance by secure coding É Testing and reviewing to find vulnerabilities É Detecting buggy patterns automatically É Trade-offs in adding protection mechanisms É Assessing/measuring security of code É Building security in: language based security Delivery and assessment Lab sessions Formative feedback during Labs Scheduled on Fridays at 2pm-5.30pm: We will have É Week 3, 31st January One reason to introduce labs in this course is to allow É Week 5, 14th February É 16 lectures covering core course topics us to give face-to-face formative feedback on your É Week 7, 7th March learning. É 4 lab sessions É Week 9, 21st March É 1 coursework contributing 30% of final mark We plan to do this by reviewing the results from one lab É 1 written exam contributing 70% of final mark Each session will examine some software session at the next lab session. To do this effectively we vulnerabilities: why they exist, how they can be will ask that you submit your work and/or discuss it Lecture slides will be made available in several formats. discovered, exploited, and repaired. with us during the lab sessions. They have numerous embedded links to useful Labs will start with a guided introduction (up to 30 Lab sessions will be run by me together with the course resources (the links are more noticeable in the online mins). TA, who is Joseph Hallett. versions). Working together is encouraged. We want to foster a supportive learning environment. Students who have prior knowledge or expertise are especially welcome. Coursework Ethics Communications A repeat of the advice given in the Computer Security É New course: course: É honest, constructive feedback is very welcome The coursework will be an assignment following a Nothing in this course is intended as incitement É As with any course, I welcome similar pattern to the lab exercises: discover, exploit to crack into running systems! then repair.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us