Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.

Similar presentations


Presentation on theme: "Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher."— Presentation transcript:

1 Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher

2 Lecture 14 Page 2 CS 236 Online Outline Introduction Principles for secure software Major problem areas

3 Lecture 14 Page 3 CS 236 Online Example Problem Areas Buffer overflows Error handling Access control issues Race conditions Use of randomness Proper use of cryptography Trust Input verification Variable synchronization Variable initialization

4 Lecture 14 Page 4 CS 236 Online Error Handling Error handling code often gives attackers great possibilities It’s rarely executed and often untested So it might have undetected errors Attackers often try to compromise systems by forcing errors

5 Lecture 14 Page 5 CS 236 Online A Typical Error Handling Problem Not cleaning everything up On error conditions, some variables don’t get reset If error not totally fatal, program continues with old values Could cause security mistakes –E.g., not releasing privileges when you should

6 Lecture 14 Page 6 CS 236 Online Some Examples Remote denial of service attack on Apache HTTP server due to bad error handling (2010) ntpd (Network Time Protocol Daemon) error handling flaw (2015) –Essentially allowing attacker to set target’s clock

7 Lecture 14 Page 7 CS 236 Online Checking Return Codes A generalization of error handling Always check return codes A security program manager for Microsoft said this is his biggest problem Very dangerous to bull ahead if it turns out your call didn’t work properly Example: Nagios XI didn’t check the return value of setuid() call, allowing privilege escalation

8 Lecture 14 Page 8 CS 236 Online Access Control Issues Programs usually run under their user’s identity with his privileges Some programs get expanded privileges –Setuid programs in Unix, e.g. Poor programming here can give too much access

9 Lecture 14 Page 9 CS 236 Online An Example Problem A program that runs setuid and allows a shell to be forked –Giving the caller a root environment in which to run arbitrary commands Buffer overflows in privileged programs usually give privileged access Privilege escalation – using program flaws to obtain greater access privileges you shouldn’t get

10 Lecture 14 Page 10 CS 236 Online A Real World Example Lenovo System Update Service Run by an unprivileged user to perform valid system updates Created a temporary admin account that had privileges to perform these updates Account name and password were predictable, allowing attacker to guess them And run as system administrator

11 Lecture 14 Page 11 CS 236 Online What To Do About This? Avoid running programs setuid –Or in other OSs’ high privilege modes If you must, don’t make them root-owned –Remember, least privilege Change back to the real caller as soon as you can –Limiting exposure Use virtualization to compartmentalize

12 Lecture 14 Page 12 CS 236 Online Virtualization Approaches Run stuff in a virtual machine –Only giving access to safe stuff Hard to specify what’s safe Hard to allow safe interactions between different VMs VM might not have perfect isolation


Download ppt "Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher."

Similar presentations


Ads by Google