01
01
2
Motivation
Quiz
SOFTWARE!
8
Why a course on software security?
9
We focus on software security, but don’t forget
that security is about, in no particular order,
people (users, employees, sys-admins, programmers,...),
access control, passwords, biometrics, cryptology, protocols,
policies & their enforcement, monitoring, auditing,
legislation, persecution, liability, risk management,
incompetence, confusion, lethargy, stupidity, mistakes,
complexity, software, bugs, verification, hackers, viruses,
hardware, operating systems, networks, databases,
public relations, public perception, conventions, standards,
physical protection, data protection, ...
10
Software may well be the weakest link in the
security chain, but
“it may also be argued that this chain is hidden in a
mud pie: it is hard to find the links, to figure out
if they hang together, or if anyone notices or
cares if it’s removed altogether:
…the mud pie will still be there…” [Arjen Lenstra]
11
The problem
Internet worms and viruses
Pictures taken from The Spread of the Sapphire/Slammer Worm, by David Moore, Vern Paxson, Stefan Savage, Colleen Shannon, Stuart Staniford,
Nicholas Weaver
14
Slammer Worm (Jan 2002)
Pictures taken from The Spread of the Sapphire/Slammer Worm, by David Moore, Vern Paxson, Stefan Savage, Colleen Shannon, Stuart Staniford,
Nicholas Weaver
15
Vulnerability in Cisco Router (source US-CERT)
Published: 2011-01-24
Vulnerability No: CVE-2011-0352
CVSS Severity Score: 7.88
Vendor/Product cisco -- linksys_wrt54gc_router_firmware
17
Vulnerability in FFmpeg (source US-CERT)
Published: 2011-01-24
Vulnerability No: CVE-2010-4705
CVSS Severity Score: 9.3
Vendor/Product: ffmpeg -- ffmpeg
18
Vulnerability in Linux/Windows/MACOS
Published: 2011-01-24
Vulnerability : CVE-2011-0638 CVE-2011-0640 CVE-2011-0639
CVSS Severity Score: 9.3
Vendor/Product: Apple Mac OS X
Microsoft - windows
Linux - Linux kernel
19
Vulnerability in Mozilla/Bugzilla
Published: 2011-01-28
Vulnerability : CVE-2010-4568
CVSS Severity Score: 7.5
Vendor/Product: Mozilla - Bugzilla
20
Vulnerability in Tandberg videoconferencing
Published: Feb 2 2011
Vulnerability : CVE-2011-0354
Vendor/Product: Tandberg- video conferencing
21
Mini-assignment for coming week
http://www.securityfocus.com/vulnerabilities
http://www.us-cert.gov/cas/bulletins
http://www.securitytracker.com/
22
Superficial analysis of the problem
Observation 1
Namely
• the Linux/Windows/Mac Operating System (OS)
• the router software
• the videoconferencing system software
• the FFmeg graphics engine
• ...
25
Rise of web application (in)security
26
Changing nature of attackers
• Traditionally, hackers are amateurs motivated by fun
• publishing attacks for the prestige
28
1. Security is secondary concern
29
Functionality vs security
31
Functionality vs security
Lost battles?
• operating systems
– huge OS, with huge attack surface (API),
• programming languages
– buffer overflows, format strings, ... in C
– public fields in Java
– ...
• web browsers
– plug-ins for various formats, javascript, ajax, VBscript, ...
• email clients
58
Functionality vs security : PHP
59
First steps in improving software security
• awareness
– that there might be a problem
– of what needs protecting, from which threats
– of the fact that you might lack knowledge
60
2. Weakness in depth
interpretable or executable input data
eg paths, filenames, .doc, .xls, .pdf, .js,...
programming languages
application
middleware
webbrowser
with plugins platform libraries sql
eg Java or .NET data
base
operating system system APIs
32
2. Weakness in depth
Software
• runs on a huge, complicated infrastructure
– OS, platforms, webbrowser, lots of libraries & APIs, ...
• is built using complicated languages
– programming languages, but also SQL, HTML, XML, ...
• using various tools
– compilers, IDEs, preprocessors, dynamic code downloads
33
3. Unfair battle
(cf. football)
34
Recap
35
Flaw or Vulnerability ?
Confusing terminology
Security weakness, flaw, vulnerability, bug, error, coding
defect …
Important distinction
1.Security weakness / flaw
Something that is wrong or could be better ...
2.Security vulnerability
Flaw that can be exploited by an attacker to violate a policy
0%
17%
buffer overflow
37%
input validation
code defect
design defect
26%
crypto
20%
Security bugs found in Microsoft bug fix month (2002)
56
Software Flaws
Software flaws can be introduced at two levels
1) Design flaw – the flaw is introduced during the design
2) Bug / code-level flaw - the flaw is introduced during
implementation
Equally common
what if
void decrease(int amount) amount is
negative?
{ if (balance <= amount)
{ balance = balance – amount; }
else { printf(“Insufficient funds\n”); }
}
what if amount
is negative? 2. Lack of input validation of
(untrusted) user
Design flaw or implementation flaw ?
G.McGraw’s Touchpoints
Security concepts & goals
Software and Security
37
Security concepts
want to maximise availability/
owners
want to minimise
usefulness
impose reduce
countermeasures
may have increase
require
vulnerabilities of
attackers lead to
exploit risks
give
rise to increase
threats to
assets
want to abuse
38
Starting point for ensuring security
• Bottlenecks:
– expressing what we (don't) want in a policy
– enforcing this, dynamically or statically
40
Security Objectives: CIA
• Confidentiality
– unauthorised users cannot read information
• Integrity
– unauthorised users cannot alter information
• Availability
– authorised users can access information
41
Security objectives
42
Security goals
43
How to realise security objectives? AAAA
• Authentication
– who are you?
• Access control/Authorisation
– control who is allowed to do what
– this requires a specification of who is allowed
to do what
• Auditing
– check if anything went wrong
• Action
– if so, take action
44
How to realise security objectives?
45
Threats vs security requirements
• information disclosure
– confidentiality
• tampering with information
– integrity
• denial-of-service (DoS)
– availability
• spoofing
– authentication
• unauthorised access
– access control
46
Countermeasures
47
Countermeasures and more vulnerabilities
48
Software security
Two sides to software security: do’s & dont’s
51
Security technologies we can use
• cryptography
– for threats related to insecure communication and
storage
(Probably adequately covered in other courses?)
• access control
– for threats related to misbehaving users
• eg role-based access control
• language-based security
– for threats related to misbehaving programs
• typing, memory-safety
• sandboxing
– eg Java, .NET/C#
52
Security technologies
53
Software infrastructure
54
Threats & vulnerabilities
55
Sources of software vulnerabilities