1 assurance, malicious code vulnerability analysis nov 30, 2006 lecture 9 is 2150 / tel 2810...

60
1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

Upload: noel-osborne

Post on 19-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

1

Assurance, Malicious CodeVulnerability Analysis

Nov 30, 2006Lecture 9

IS 2150 / TEL 2810Introduction to Security

Page 2: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

2

Overview

Trust Problems from lack of assurance Types of assurance Life cycle and assurance Waterfall life cycle model Other life cycle models

Page 3: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

3

Trust Trustworthy entity has sufficient credible

evidence leading one to believe that the system will meet a set of requirements

Trust is a measure of trustworthiness relying on the evidence

Assurance is confidence that an entity meets its security requirements based on evidence provided by the application of assurance techniques Formal methods, design analysis, testing etc.

Page 4: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

4

Relationships

Policy

Mechanisms

Assurance

Statement of requirements that explicitly definesthe security expectations of the mechanism(s)

Provides justification that the mechanism meets policythrough assurance evidence and approvals based onevidence

Executable entities that are designed and implementedto meet the requirements of the policy

Evaluation standardsTrusted Computer System Evaluation Criteria

Information Technology Security Evaluation Criteria Common Criteria

Page 5: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

5

Problem Sources (Neumann)1. Requirements definitions, omissions, and

mistakes2. System design flaws3. Hardware implementation flaws, such as wiring

and chip flaws4. Software implementation errors, program bugs,

and compiler bugs5. System use and operation errors and inadvertent

mistakes6. Willful system misuse7. Hardware, communication, or other equipment

malfunction8. Environmental problems, natural causes, and

acts of God9. Evolution, maintenance, faulty upgrades, and

decommissions

Page 6: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

6

Examples Challenger explosion (1986)

Sensors removed from booster rockets to meet accelerated launch schedule

Deaths from faulty radiation therapy system Hardware safety interlock removed Flaws in software design

Bell V22 Osprey crashes Failure to correct for malfunctioning components;

two faulty ones could outvote a third Intel 486 chip bug (trigonometric function)

Cost a lot of time and money

Page 7: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

7

Role of Requirements Requirements are statements of

goals that must be met Vary from high-level, generic issues

to low-level, concrete issues Security objectives are high-level

security issues and business goals Security requirements are specific,

concrete issues

Page 8: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

8

Types of Assurance Policy assurance is evidence establishing

security requirements in policy is complete, consistent, technically sound To counter threats and meet objectives

Design assurance is evidence establishing design sufficient to meet requirements of security policy

Implementation assurance is evidence establishing implementation consistent with security requirements of security policy Need to use good engineering practices

Page 9: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

9

Types of Assurance Operational assurance is evidence

establishing system sustains the security policy requirements during installation, configuration, and day-to-day operation Also called administrative assurance Example,

Do a thorough review of product or system documentation and procedures, to ensure that the system cannot accidentally be placed in a non-secure state.

Page 10: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

10

Assurance steps

Security requirements

Design

Implementation

1

32

4

Assurancejustification

Design andimplementationrefinement

Page 11: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

11

Life Cycle

Conception

Manufacture

Deployment

Fielded Product Life

Page 12: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

12

Conception Idea

Decisions to pursue it Proof of concept

See if idea has merit Rapid prototyping, analysis, etc.

High-level requirements analysis What does “secure” mean for this concept?

Identify threats Is it possible for this concept to meet this meaning of

security? Is the organization willing to support the additional

resources required to make this concept meet this meaning of security?

Page 13: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

13

Manufacture Develop detailed plans for each group

involved May depend on use; internal product

requires no sales Plans: marketing, sales training,

development, testing Software development and engineering

process Implement the plans to create entity

Includes decisions whether to proceed, for example due to market needs

May be the longest stage

Page 14: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

14

Deployment

Delivery Assure that correct (assured) masters are

delivered to production and protected Distribute to customers, sales

organizations Installation and configuration

Developers must ensure that the system operates properly in the production environment

Page 15: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

15

Fielded Product Life Routine maintenance, patching

Responsibility of engineering in small organizations

Responsibility may be in different group than one that manufactures product

Customer service, support organizations Answering questions; recording bugs

Retirement or decommission of product Migration plans for customers

Page 16: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

16

Waterfall Life Cycle Model

Requirementsdefinition andanalysis

System andsoftwaredesign

Implementationand unittesting Integration

and systemtesting

Operationandmaintenance

Page 17: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

17

Other Models of Software Development Exploratory programming (adequacy is goal)

Develop working system quickly Used when detailed requirements specification

cannot be formulated in advance, No requirements or design specification,

low assurance Prototyping

Objective is to establish system requirements Future iterations (after first) allow assurance

techniques

Page 18: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

18

Models Formal transformation

Create formal specification Translate it into program using correctness-

preserving transformations Very conducive to assurance methods

System assembly from reusable components Depends on whether components are trusted Must assure connections, composition as well Very complex, difficult to assure This is common approach to building secure

and trusted systems

Page 19: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

19

Models Extreme programming

Rapid prototyping and “best practices” Project driven by business decisions Requirements open until project complete Programmers work in teams Components tested, integrated several

times a day Objective is to get system into production as

quickly as possible, then enhance it Evidence adduced after development

needed for assurance

Page 20: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

20

Build or Add? Security is an integral part of a system

Address security issues at system design phase Easy to analyze and assure

Reference monitor (total mediation!) Mediates all accesses to objects by subjects

Reference validation mechanism must be– 1. Tamperproof2. Never be bypassed3. Small enough to be subject to analysis and testing

– the completeness can be assured Security kernel

Hardware + software implementing a RM

Page 21: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

21

Trusted Computing Base TCB consists of all protection

mechanisms within a computer system that are responsible for enforcing a security policy

TCB monitors four basic interactions Process activation Execution domain switching Memory protection I/O operation

A unified TCB may be too large Create a security kernel

Page 22: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

22

Malicious Code

Page 23: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

23

What is Malicious Code? Set of instructions that causes a security

policy to be violated Is an unintentional mistake that violates policy

malicious code? (Tricked into doing that?) What about “unwanted” code that doesn’t

cause a security breach? Generally relies on “legal” operations

Authorized user could perform operations without violating policy

Malicious code “mimics” authorized user

Page 24: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

24

Types of Malicious Code

Trojan Horse Trick user into executing malicious code

Virus Replicates and inserts itself into fixed

set of files Worm

Copies itself from computer to computer

Page 25: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

25

Trojan Horse Program with an overt (expected) and

covert (unexpected) effect Appears normal/expected Covert effect violates security policy

User tricked into executing Trojan horse Expects (and sees) overt behavior Covert effect performed with user’s

authorization Trojan horse may replicate

Create copy on execution Spread to other users/systems

Page 26: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

26

Propagation Perpetrator

cat >/homes/victim/ls <<eofcp /bin/sh /tmp/.xxshchmod u+s,o+x /tmp/.xxshrm ./lsls $*eof

Victimls

It is a violation to trick someone into creating a shell that is setuid to themselves

How to replicate this?

Page 27: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

27

Virus Self-replicating code

A freely propagating Trojan horse some disagree that it is a Trojan horse

Inserts itself into another file Alters normal code with “infected” version

Operates when infected code executedIf spread condition then

For target filesif not infected then alter to include virus

Perform malicious actionExecute normal program

Page 28: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

28

Virus Types Boot Sector Infectors (The Brain Virus)

Problem: How to ensure virus “carrier” executed? Solution: Place in boot sector of disk

Run on any boot Propagate by altering boot disk creation

Executable infector (The Jerusalem Virus, Friday 13th, not 1987 )

Malicious code placed at beginning of legitimate program (.COM .EXE files)

Runs when application run Application then runs normally

Multipartite virus : boot sector + executable infector

Page 29: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

29

Virus Types/Properties Terminate and Stay Resident

Stays active in memory after application complete Allows infection of previously unknown files

Trap calls that execute a program Can be boot sector infectors or executable infectors

(Brain and Jerusalem) Stealth (an executable infector)

Conceal Infection Trap read to provide disinfected file Let execute call infected file

Encrypted virus Prevents “signature” to detect virus [Deciphering routine, Enciphered virus code, Deciphering Key]

Polymorphism Change virus code to something equivalent each time it

propagates

Page 30: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

30

Virus Types/Properties Macro Virus

Composed of a sequence of instructions that is interpreted rather than executed directly

Infected “executable” isn’t machine code Relies on something “executed” inside application

data Example: Melissa virus infected Word 97/98 docs

Otherwise similar properties to other viruses Architecture-independent Application-dependent

Page 31: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

31

Worms

Replicates from one computer to another Self-replicating: No user action required Virus: User performs “normal” action Trojan horse: User tricked into

performing action Communicates/spreads using

standard protocols

Page 32: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

32

Other forms of malicious logic We’ve discussed how they propagate

But what do they do? Rabbits/Bacteria

Exhaust system resources of some class Denial of service; e.g., While (1) {mkdir x; chdir

x} Logic Bomb

Triggers on external event Date, action

Performs system-damaging action Often related to event

Others?

Page 33: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

33

We can’t detect it: Now what?Detection Signature-based antivirus

Look for known patterns in malicious code Always a battle with the attacker Great business model!

Checksum (file integrity, e.g. Tripwire) Maintain record of “good” version of file

Compute signature blocks Check to see if changed

Validate action against specification Including intermediate results/actions N-version programming: independent programs

A fault-tolerance approach (diversity)

Page 34: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

34

Detection

Proof-carrying code Code includes proof of correctness At execution, verify proof against code

If code modified, proof will fail

Statistical Methods High/low number of files read/written Unusual amount of data transferred Abnormal usage of CPU time

Page 35: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

35

Defense

Clear distinction between data and executable Virus must write to program

Write only allowed to data Must execute to spread/act

Data not allowed to execute Auditable action required to change

data to executable

Page 36: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

36

Defense Information Flow

Malicious code usurps authority of user Limit information flow between users

If A talks to B, B can no longer talk to C Limits spread of virus Problem: Tracking information flow

Least Privilege Programs run with minimal needed

privilege Example:

Limit file types accessible by a program

Page 37: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

37

Defense

Sandbox / Virtual Machine Run in protected area Libraries / system calls replaced with

limited privilege set Use Multi-Level Security Mechanisms

Place programs at lowest level Don’t allow users to operate at that level Prevents writes by malicious code

Page 38: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

38

Vulnerability Analysis

Page 39: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

39

Vulnerability Analysis Vulnerability or security flaw: specific

failures of security controls (procedures, technology or management) Errors in code Human violators Mismatch between assumptions

Exploit: Use of vulnerability to violate policy Attacker: Attempts to exploit the

vulnerability

Page 40: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

40

Techniques for Detecting Vulnerabilities System Verification

Determine preconditions, post-conditions Validate that system ensures post-conditions

given preconditionsCan prove the absence of vulnerabilities

Penetration testing Start with system/environment characteristics Try to find vulnerabilitiesCan not prove the absence of vulnerabilities

Page 41: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

41

System Verification

What are the problems? Invalid assumptions Limited view of system Still an inexact science External environmental factors Incorrect configuration, maintenance

and operation of the program or system

Page 42: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

42

Penetration Testing Test strengths of security controls of the

complete system Attempt to violate stated policy Works on in-place system Framework for evaluating results Examines procedural, operational and

technological controls Typical approach: Red Team, Blue Team

Red team attempts to discover vulnerabilities Blue team simulates normal administration

Detect attack, respond White team injects workload, captures results

Page 43: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

43

Types/layers of Penetration Testing Black Box (External Attacker)

External attacker has no knowledge of target system Attacks often build on human element – Social

Engineering System access provided (External Attacker)

Red team provided with limited access to system Models external attack

Goal is to gain normal or elevated access Then violate policy

Internal attacker Red team provided with authorized user access Goal is to elevate privilege / violate policy

Page 44: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

44

Red Team ApproachFlaw Hypothesis Methodology: Information gathering

Examine design, environment, system functionality

Flaw hypothesis Predict likely vulnerabilities

Flaw testing Determine where vulnerabilities exist

Flaw generalization Attempt to broaden discovered flaws

Flaw elimination (often not included) Suggest means to eliminate flaw

Flaw does Not exist

Refine with newunderstanding

Page 45: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

45

Problems withPenetration Testing Nonrigorous

Dependent on insight (and whim) of testers No good way of evaluating when “complete”

How do we make it systematic? Try all classes of likely flaws But what are these?

Vulnerability Classification!

Page 46: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

46

Vulnerability Classification Goal: describe spectrum of possible

flaws Enables design to avoid flaws Improves coverage of penetration testing Helps design/develop intrusion detection

How do we classify? By how they are exploited? By where they are found? By the nature of the vulnerability?

Page 47: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

47

Example flaw: xterm log

xterm runs as root Generates a log file Appends to log file if file exists

Problem: ln /etc/passwd log_file Solution

if (access(“log_file”, W_OK) == 0)fd = open(“log_file”, O_WRONLY|O_APPEND)

What can go wrong?

Page 48: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

48

Example: Finger Daemon(exploited by Morris worm)

finger sends name to fingerd fingerd allocates 512 byte buffer on stack Places name in buffer Retrieves information (local finger) and returns

Problem: If name > 512 bytes, overwrites return address

Exploit: Put code in “name”, pointer to code in bytes 513+ Overwrites return address

Page 49: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

49

Vulnerability Classification:Generalize

xterm: race condition between validation and use

fingerd: buffer overflow on the stack

Can we generalize to cover all possible vulnerabilities?

Page 50: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

50

RISOS:Research Into Secure Operating Systems (7 Classes)1. Incomplete parameter validation

– Check parameter before use– E.g., buffer overflow –

2. Inconsistent parameter validation– Different routines with different formats for same data

3. Implicit sharing of privileged / confidential data– OS fails to isolate processes and users

4. Asynchronous validation / inadequate serialization– Race conditions and TOCTTOU flaws

5. Inadequate identification /authentication / authorization– Trojan horse; accounts without passwords

6. Violable prohibition / limit– Improper handling of bounds conditions (e.g., in memory allocation)

7. Exploitable logic error– Incorrect error handling, incorrect resource allocations etc.

Page 51: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

51

Protection Analysis Model Classes

Pattern-directed protection evaluation Methodology for finding vulnerabilities

Applied to several operating systems Discovered previously unknown

vulnerabilities Resulted in two-level hierarchy of

vulnerability classes Ten classes in all

Page 52: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

52

PA flaw classes1. Improper protection domain initialization and

enforcementa. domain: Improper choice of initial protection domainb. exposed representations: Improper isolation of

implementation detail (Covert channels)c. consistency of data over time: Improper changed. naming: Improper naming (two objects with same

name)e. residuals: Improper deallocation or deletion

2. Improper validation validation of operands, queue management dependencies:

3. Improper synchronizationa. interrupted atomic operations: Improper indivisibilityb. serialization: Improper sequencing

4. critical operator selection errors: Improper choice of operand or operation

Page 53: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

53

NRL Taxonomy Three classification schemes

How did it enter When was it “created” Where is it

Genesis

Intentional

Malicious Nonmalicious

Trapdoor Trojan horse Logic/time bomb Covert channel Other

Timing StorageNonreplicating Replicating

Page 54: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

54

NRL Taxonomy (Genesis)

Inadvertent

Validation error (Incomplete/Inconsistent)

Domain error (including object re-use, residuals, and exposed representation errors

Serialization/aliasing (including TCTTOU errors)

Boundary conditions violation (including resource exhaustion and violable constraint errors)

Other exploitable logic error

Page 55: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

55

NRL Taxonomy:Time

Time ofintroduction

Development Maintenance Operation

Requirementspecification

designSource code Object code

Page 56: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

56

NRL Taxonomy:Location

Location

Software Hardware

OperatingSystem

Application Support

PrivilegedUtilities

UnprivilegedUtilities

Systeminitialization

Memory Management

Process management/ scheduling

Device management

File ManagementIdentification /Authentication

Other /Unknown

Page 57: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

57

Aslam’s Model Attempts to classify faults

unambiguously Decision procedure to classify

faults Coding Faults

Synchronization errors Timing window Improper serialization

Condition validation errors Bounds not checked Access rights ignored Input not validated Authentication / Identification

failure

Emergent Faults Configuration errors

Wrong install location Wrong configuration

information Wrong permissions

Environment Faults

Page 58: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

58

Common Vulnerabilities and Exposures (cve.mitre.org)

Captures specific vulnerabilities Standard name Cross-reference to

CERT, etc. Entry has three

parts Unique ID Description References

Name CVE-1999-0965

Description Race condition in xterm allows local users to modify arbitrary files via the logging option.

References•CERT:CA-93.17 •XF:xterm

Page 59: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

59

Buffer Overflow

As much as 50% of today’s widely exploited vulnerability

Why do we have them Bad language design

usually C, C++ : note they are good from other reasons

Hence good programming practice is needed Java is a safer language

Poor programming

Page 60: 1 Assurance, Malicious Code Vulnerability Analysis Nov 30, 2006 Lecture 9 IS 2150 / TEL 2810 Introduction to Security

60

Buffer Overflow

Some culprits String operations that do no

argument checking strcpy() (most risky) gets() (very risky) scanf () (very risky)

void main(int argc, char **argv) {char buf[256]; sscanf(argv[0],”%s”, &buf)

}Buffer overflow if the input is more than256 characters

Better designdst = (char *)malloc(strlen(src) +1);strcpy(dst, src);