Top Banner
Computer Security COMP 424 Lecture week 6 Program Security
23

Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Jul 27, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Computer Security

COMP 424Lecture week 6

Program Security

Page 2: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Program Security

● How do we keep programs free from flaws● How do we protect resources against such 

flaws?● Deals with the security aspects involved 

when writing programs.● Chapter 5 will deal with how we measure 

trust or security of a program or operating system

Page 3: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Secure Programs

– Secure programs should enforce:● Confidence● Integrity● Availability

– Evaluation of what is “Secure” is subject to the perspective of the evaluator

● Managers● Developers● Technicians● Clients

Page 4: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

General Definition of ProgramSecurity

● The quantity and types of faults in requirements design and code implementation are often used as evidence of a product's quality or security

● Fixing faults: Which is better?– A program that undergoes very rigorous testing 

and is found to have 100 errors that are fixed, or

– A program that undergoes less scrutiny but only locates 20 errors that are found and fixed?

Page 5: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Actually...

● The answer is 2.● History has shown that programs with a large 

number of identified faults tend to exhibit even more faults as time progresses.

● Fewer faults up front, even when less rigorous testing is done, is usually an indicator of well designed and fault free implementations.

Page 6: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Security Auditing

● Early security analysis attempts where based on– “Penetrate and patch”

● Step 1: Attempt to cause the program to fail● Step 2: create and apply an individual patch ASAP● Step 3: Lather, rinse, repeat

● History also shows that this approach tends to cause more problems than it fixes.

● Why?

Page 7: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Patch Problems

● Repair pressures encourage narrow problem focus. The larger causes are often over looked

● Code is not 100% without side effects. Changing a small portion of code may cause subtle or overt changes in code behavior in other unlikely areas of code.

● Patches often cause serious functionality or performance problems.

Page 8: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

A Better Approach...

● Compare and analyze the behavior of a product with the product's requirements and expectations?– Does the program do what it is required to do and 

no more?

● Unexpected behaviors are considered “program security flaws” ethier:– Faults: programmer error

– Failures: deviation from expected behavior

Page 9: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

What causes flaws?

– Misunderstandings of program requirements

– Coding and typing mistakes

– Lack of expertise

– Failure of a single component

– Failure due to interaction of multiple components

– Intentionally induced flaws

● They fall into two categories:– Inadvertent human errors

– Malicious intentional flaws

Page 10: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Which are more dangerous

● If flaws are either the result of human errors or intentional flaws which is more dangerous?

● Perception seems to be that the later is more dangerous: That intentional flaws and security breaches are more denagerous.

● The opposite is actaully true: Much more damage is allowed to happen by the existence of inadvertent human errors.

Page 11: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Why do human errors exist?● Programs are unique and complex.

– PDAs probably have more computational power, flexibility and software components than an Apollo space craft.

– We are left only being able to test the most obvious and likely problems instead of exhaustive eliminations

● Software technology evolves far more rapidly than computer security techniques.– Next year's software technology is already being 

used

Page 12: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Some common human errors

● Buffer Overflow

● Resulting failure can be catastrophic and easily detected or can be extremely subtle (and useful to intruders)

User Data System Data or Code

Page 13: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

● Incomplete Mediation– http://www.myinterestpayment.com/userinput

&parm1=john&parm2=doe&parm3=2002Jan01

– What if somebody entershttp://www.myinterestpayment.com/userinput&parm1=john&parm2=doe&parm3=1002Jan01

● This type of error can also be very problematic.

Page 14: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

● Time­of­check to Time­of­use– Basically syncronization flaws

– A real problem with modern CPU design (Since instructions are no longer executed in the same order they were requested.

– Also problematic in software programming.● Authorization could be granted based on some 

conditions● Later conditions may change (l­user gets fired)● User is allowed access based on earlier descision that 

has been rendered obsolete but has not been updated.

Page 15: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Viruses and Malicious Code● Malicious code can do much more (and often 

takes advantage of the errors)● Terms like “virus” are horrible nomenclature. 

A virus is significantly different from its host biology (not even technically alive RNA yada yada yada)

● For computers though: a virus is just code; no different from any other program, application or executable. The computer doesn't know the difference.

Page 16: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Virus abilities

● Since a “virus” is really just a program what harm can it do? What abilities do they have?– Any! If a program can do it, so can a virus.

– Corollary: Its not necessarily a bad thing...

● Viruses are not new. They have been documented well back to the early 70s.

● What is new is the explosion in the number of distinct instances and copies that have appeared

Page 17: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Kinds of Malicious Code● A “virus” is usually a term reserved for 

malicious code that has the ability to pass on malicious code  by modifying other non­malicious programs.– Many programs start with a jump statement that 

launches execution somewhere later than the start of the program. By altering this jump statement and inserting executable instructions in the segment that would have been jumped over.

– Code can also be relocated.

– Transient or resident viruses are possible. (TSR yick)

Page 18: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Trojan horses

● A trojan horse is a program that appears to fulfill its obvious intended behavior, but...

● Also performs some non­obvious side­effect.– Example: A login script.

● Presents username and password prompts● Performs obvious behavior of passing credentials on 

to operating system● ALSO mails the credential to some agent(s).

Page 19: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

● Clues– Suspicious originator and distribution of program

– Non­technical

– Unexpected attributes

– Size

– Response time delays

– Undocumented features● Always be suspicious

Page 20: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Logic Bombs

● A piece of malicious code that waits, inactive, until some condition occurs.

● Once the condition occurs the malicious code performs its neferious actions.

● Usually exploits the privileges of the user.

Page 21: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Trapdoors

● Trapdoors (or backdoors) are malicious features left in programs that allow some agent to circumvent security measures that expected to be enforced by the system.

Page 22: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

Worms

● Worms are designed to spread copies of themselves throughout a network. (as stand­alone program)

● Usually result in denial of service on infected systems.

● Often take advantage of unexpected program behaviors– Slammer

– Outlook mail macros

Page 23: Computer Securityjeffw/Courses/COMP424/Lectures/Lecture06... · 2005-04-08 · Security Auditing Early security analysis attempts where based on – “Penetrate and patch” Step

● Rabbits are like worms but their sole intention is to... well... spread like rabbits until a particular resource (computation cycles, disk space or bandwidth) is exhausted.