+ All Categories
Home > Documents > Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web...

Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web...

Date post: 02-Aug-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
41
Program Structure II Steven M. Bellovin November 17, 2015 1
Transcript
Page 1: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Program Structure II

Steven M. Bellovin November 17, 2015 1

Page 2: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

More Architecture—More on Email Security

• We want to secure email

• Generally, that requires crypto, which in turn requires protecting keys

• How shall we do that?

Steven M. Bellovin November 17, 2015 2

Page 3: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Standard Techniques

• Encrypt the private key with a user-typed passphrase

• Use special-purpose crypto hardware

• The latter is rarely available; we need to use the former, at least insome cases

Steven M. Bellovin November 17, 2015 3

Page 4: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Where are Decryption and Signing Done?

• Gateway machine?

• End-user’s machine?

Steven M. Bellovin November 17, 2015 4

Page 5: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Signing at the Gateway

• Tempting target

• Hard for user to supply the key or the passphrase

• How does the gateway know who sent the mail?

• Best for organizational signatures

• But—what if the connection to the gateway is authenticated?

Steven M. Bellovin November 17, 2015 5

Page 6: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Decrypting at the Gateway

• Again, how are keys supplied?

• When is decryption done?

• Is the mail stored internally in the clear?

Steven M. Bellovin November 17, 2015 6

Page 7: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Signing Every Message

• Suppose we want to sign every message

• Do we prompt users for a passphrase on each email sent?

• Rather annoying—can we cache passphrases?

Steven M. Bellovin November 17, 2015 7

Page 8: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

(Why Sign Everything?)

• Principle?

• Prevent false attribution?

• Anti-spam?

Steven M. Bellovin November 17, 2015 8

Page 9: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Caching Keys

• If we cache keys, they’re exposed to bugs in the mailer

• How risky are mailers?

• (How big are they?)

Steven M. Bellovin November 17, 2015 9

Page 10: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Some Mailer Sizes

Mailer KLOCThunderbird 6000Evolution 2500

(extras) 2200Claws-Mail 840Pine 530Mutt 288

Numbers are very imprecise. All of these mailers require many libraries,especially the GUI mailers. (GTK+ is about 3,000,000 lines of code.)

Steven M. Bellovin November 17, 2015 10

Page 11: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

(Why are Mailers So Big?)

• Mail formats are complex

– MIME

– Multilingual

– GUIs

• HTML rendering

• Other stuff bundled in (calendar, vCard, etc)

• Frequently include an editor

Steven M. Bellovin November 17, 2015 11

Page 12: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Why are Mailers Insecure?

• Size—security hole rates go up as the square of the code size

• Accept untrusted input

• Plenty of room for user error

Steven M. Bellovin November 17, 2015 12

Page 13: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Entrust our Keys to Mailers?

• They’re big and complicated

• They interact with lots of other programs

• They have long histories of security problems

• Handing them keys doesn’t sound like a great idea. . .

Steven M. Bellovin November 17, 2015 13

Page 14: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Outboard Key Manager

• Should we have a separate application to handle keys?

• How big are such applications?

• Can we trust them?

Steven M. Bellovin November 17, 2015 14

Page 15: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Key Managers

Component KLOCGNOME Keyring 150GNOME Keyring Manager 97GPG 520GPG2 737pinentry 55

These aren’t exactly tiny, either. . .

Steven M. Bellovin November 17, 2015 15

Page 16: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Bug Rates

• How many bugs per 1,000 lines of code?

• Hard to measure

• Different types of software have different rates

• We can’t count bugs that aren’t found!

• That said. . .Component Bugs/KLOCLinux 2.6 Kernel .17Commercial code 20–30

(Is that bug rate for Linux believable?)

• But—Microsoft claims that Vista and its components have had fewersecurity bugs than the open source competition. This is probablyaccurate.

+ The last Patch Tuesday update fixed many bugsSteven M. Bellovin November 17, 2015 16

Page 17: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Managing the Key Manager

• The mailer still tells the key manager what to decrypt or sign

• If the mailer is buggy, it can fool the key manager

• You don’t know what’s really being signed or decrypted

• (This all applies to crypto hardware solutions, too)

Steven M. Bellovin November 17, 2015 17

Page 18: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Pure Outboard Solution?

• Save inbound mail; manually decrypt it

• (Hand-carry it to an offline decryption machine? The SecureDropsystem requires behavior like that.)

• Edit outbound mail separately; manually sign, then paste that intomailer buffer

• (Hand-carry it from an offline encryption and signing machine?)

• Does this work?

Steven M. Bellovin November 17, 2015 18

Page 19: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

It’s Too Inconvenient

• Most users won’t put up with this

• Result: very few signed messages

• Result: reluctance to receive inbound encrypted messages

• Does this give us worse security?

• (Also: intelligence agencies can get through air gaps.)

Steven M. Bellovin November 17, 2015 19

Page 20: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

What Do We Do?

• There are no perfect solutions

• How disciplined are the users?

• How important is secure email?

• Can you have separate grades of keys?

• Who is your enemy?

Steven M. Bellovin November 17, 2015 20

Page 21: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Outboard Keys

• Despite the risks, outboard keys are still better

• Still simpler than the mailer

• Less risk of key theft

• Easier to add (secure) audit trail

Steven M. Bellovin November 17, 2015 21

Page 22: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Windows Vista and IE

• Web browsers have also been problematic

• Historically, Internet Explorer has been bad, but it’s been improving

• (IE 6 was horrid)

• (These days, Firefox seems to have twice as many security bugs asIE.)

• IE 7 on Vista was a lot better; its successors are better still

• Why?

• (But Microsoft has abandoned IE in favor of Edge.)

Steven M. Bellovin November 17, 2015 22

Page 23: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Protected Mode

• Run web browser with fewer privileges (exception: trusted sites canhave full privileges)

• Compromise of the browser does not result in compromise of (most)user files

• (Plus—very rigorous development process, with a lot of emphasis onsecurity)

Steven M. Bellovin November 17, 2015 23

Page 24: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Components

• User Account Control (UAC)

• Mandatory Integrity Control (MIC)

• User Interface Privilege Isolation (UIPI)

Steven M. Bellovin November 17, 2015 24

Page 25: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

User Account Control

• Eliminate need to log in as Administrator

• Even Administrator can run most applications without privilege —they changed the privilege requirements for some operations

• Privilege can be raised as needed, with password entry. (Will usersmake that decision correctly?)

• Users have found UAC very annoying

Steven M. Bellovin November 17, 2015 25

Page 26: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Mandatory Integrity Control

• Low-privilege processes cannot write to protected files

• Available levels: low, medium, high

• Similar to MAC

Steven M. Bellovin November 17, 2015 26

Page 27: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Bell-Lapdula and MIC

• Recall how Bell-Lapadula confidentiality mechanisms could be usedfor integrity protection, by reversing labels

• MIC uses half of it: it’s really “no write down”

• MIC does not provide confidentiality protection

Steven M. Bellovin November 17, 2015 27

Page 28: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Privilege is Inherited

• The privilege level of a process is inherited by its children

• Children spawned by protected mode IE also run at Low privilege

• This blocks attacks by ActiveX, VBScript, etc.

Steven M. Bellovin November 17, 2015 28

Page 29: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Virtualization

• A lot of existing code wants to write files (cache, temporary files,cookies, history, registry, etc.)

• A shim layer virtualizes these functions

• Files to be modified in Low mode are copied to the Low area; thechanges are made only to the copies

Steven M. Bellovin November 17, 2015 29

Page 30: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Why Virtualization?

• Legacy code and legacy design patterns

• Older programs were not intended to be sandboxed like this

• Virtualization layer makes it easy to convert

+ If the applications had been designed for MIC and sandboxing in thefirst place, we wouldn’t need this

Steven M. Bellovin November 17, 2015 30

Page 31: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Gaining Privilege

• Sometimes, Low processes need to do things requiring privilege

• Special broker processes will perform such operations on request

• Brokers ask user consent before proceeding

• Is that reliable?

Steven M. Bellovin November 17, 2015 31

Page 32: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Trusting the User?

• Users can be tricked

• Many of today’s dialog boxes are useless

• From a W3C glossary Wiki:

Dialog box: A window in which resides a button labeled “OK”and a variety of text and other content that users ignore.

Steven M. Bellovin November 17, 2015 32

Page 33: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Users Don’t Like It

• Some older applications break

• These were probably insecure to begin with

• But people are used to them

• Windows 7 has cut down on the prompts—but some say that makes itless secure. Must security be annoying?

Steven M. Bellovin November 17, 2015 33

Page 34: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Lack of Confidentiality Protection

• Low mode malware can still read your files

• It appears possible for Low mode applications to export data

• But—full Bell-Lapadula confidentiality control is impractical

• Cookies are a special case—prevent (some) cross-site scriptingattacks

Steven M. Bellovin November 17, 2015 34

Page 35: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

User Interface Privilege Isolation

• Prevents Low mode processes for sending certain messages tohigher-mode processes

• Blocks “shatter attack” (inject code into another process via Windowsmessages)

• In essence, ACL for message-passing

Steven M. Bellovin November 17, 2015 35

Page 36: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

What Has Microsoft Done?

• Separated Internet Explorer from Windows Explorer (i.e., restored thedistinction between net and desktop)

• (In the antitrust trial in 1998, Microsoft claimed they couldn’t separatethe two.)

• Used OS access controls to isolate browser

• Added more access controls

• Structural separation

Steven M. Bellovin November 17, 2015 36

Page 37: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Does it Work?

• IE7 on Vista is immune to the .ani file (animated cursor) attack (seehttp://www.microsoft.com/technet/security/bulletin/

MS07-017.mspx)

• More precisely, the attack code couldn’t escape the Low mode jail

• Human interface attacks may still be an issue

• Other delivery mechanisms for .ani still work

+ Despite this, IE security holes are still being found, including ways toescape the sandbox.

+ This is better than nothing, but it’s far from perfect

Steven M. Bellovin November 17, 2015 37

Page 38: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Firefox vs. Chrome

• Chrome has a higher rate of security bugs reported than Firefox does

• (May reflect different amounts of attention)

• But—critical and high priority bug rates in Chrome are much lower(and falling) than in Firefox

• Is this because of the privilege separation architecture in Chrome? Itstill has holes, but they’re not nearly as serious.

• Firefox does not use privilege separation.

Steven M. Bellovin November 17, 2015 38

Page 39: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Securing a Browser

• User interface runs with normal privileges

• Retrieving and rendering pages done with low privileges

• What about separation between sites?

Steven M. Bellovin November 17, 2015 39

Page 40: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Process Separation

• Firefox runs as one process

• Chrome and IE 8 use a process per tab

+ Good for monitoring and controlling resource consumption

• Experimental Gazelle browser uses separate protection domains foreach web site contacted

– Protects against improper information flow between web sites

– Matches browser’s “same origin” principal

– In other words: implement browser security semantics via OSsecurity mechanisms

Steven M. Bellovin November 17, 2015 40

Page 41: Program Structure II - Columbia Universitysmb/classes/f15/l_struct2.pdf · Windows Vista and IE Web browsers have also been problematic Historically, Internet Explorer has been bad,

Summary

• Structural separation helps

• It’s not a panacea

• There are still challenging user interface issues

• Backwards compatibility is a problem

Steven M. Bellovin November 17, 2015 41


Recommended