identification and protection of security-critical data

23
Identification and Protection of Security-Critical Data Nora Sovarel University of Virginia Computer Science June 6, 2006 MCS Project Presentation

Upload: thimba

Post on 14-Jan-2016

28 views

Category:

Documents


0 download

DESCRIPTION

Identification and Protection of Security-Critical Data. MCS Project Presentation. Nora Sovarel University of Virginia Computer Science June 6, 2006. Security-Critical Data. Corruption may lead to compromised security Control data Used as or used to calculate Instruction Pointer - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Identification and Protection of Security-Critical Data

Identification and Protection of Security-

Critical Data

Nora SovarelUniversity of Virginia

Computer ScienceJune 6, 2006

MCS Project Presentation

Page 2: Identification and Protection of Security-Critical Data

2

Security-Critical Data

• Corruption may lead to compromised security

• Control data– Used as or used to calculate Instruction Pointer– Numerous defenses

• StackGuard, Write or Exec, Shadow Stack• Instruction Set Randomization ([Barrantes+,CCS’03],

[Kc+,CCS’03])

• Control Flow Integrity ([Abadi+, CCS’05]), DIRA ([Smirnov and Chiueh, NDSS’05])

• Non-control data

Page 3: Identification and Protection of Security-Critical Data

3

CGI-BIN=“/bin”

POST commands

Non-Control Data Attack

• Heap corruption attack against configuration data ([Chen+,USENIX’05])

CGI-BIN=“/usr/local/httpd/cgi-bin”

SERVER POST …

rm –rf * /

CGI-BIN=“/bin”

Page 4: Identification and Protection of Security-Critical Data

4

Non-Control Data

• Execution is altered by changing data – Configuration data - CGI-BIN path– User input – validated and then corrupted– User identity data - uid, root access if

changed to 0– Decision making data - if condition

[Chen+,USENIX’05]

Page 5: Identification and Protection of Security-Critical Data

5

Non-Control Data Characteristics

• Long lifetime– Many opportunities to corrupt it

• Rarely updated• Passed as parameters to system calls

– execve, setuid, fopen, fwrite

• Special cases– If condition– Saved registers

Page 6: Identification and Protection of Security-Critical Data

6

Approach

• Store security-critical data in secure store– Protected by hardware – Writes allowed only in specially marked code

sections– Corruption attempt generates segmentation fault

• Program – Need to mark data and update sections

• By programmer – language extension• Automatically - inference

– Automatic program transformation• Store marked data in secure store• Insert system calls for update sections

Page 7: Identification and Protection of Security-Critical Data

7

Variable lifetime

init r w r r w

read-onlyread-write

Variable

Secure Store

read-write

Page 8: Identification and Protection of Security-Critical Data

8

Requirements

• No system calls injected• No system calls skipped

• Operating System support• Hardware support

• Acceptable performance penalty• Reasonable programmer effort

Use an existing controldata defense

mprotect NX/XD bit

Case studies

Page 9: Identification and Protection of Security-Critical Data

9

Roadmap

• Motivation• Approach• Design

– Language Extensions– Inference– Program Transformation

• Implementation• Case Studies

Page 10: Identification and Protection of Security-Critical Data

10

C Language Extentions

• critical - Type qualifier – Marks security critical data– Data allocated in special storage

• update – statement

update := update statement

Page 11: Identification and Protection of Security-Critical Data

11

Inference

• Security-critical data– Future Work

• Update Sections– Data marked using attributes– Assignment to critical data– Call to library function - predefined list– User defined function

• specialization for each combination of critical/non-critical parameters

– Some user guidance required

Page 12: Identification and Protection of Security-Critical Data

12

User Defined Functionsvoid set(int *p, int v) { *p = v;}

…int critical *p;…set(p,1);…

void set( int *p, int v) { *p = v;}void set1( critical int *p, int v) { enable_update(); *p = v; disable_update();}…int *critical p;…set1(p,1);…

Page 13: Identification and Protection of Security-Critical Data

13

Program Transformation

• Puts security-critical data in secure store– Heap– Static data– Stack

• Sets the initial access rights • Inserts enable/disable protection calls

Page 14: Identification and Protection of Security-Critical Data

14

Example

critical int *x;…x=malloc(…)…update {statement;}…free(x);…

int *x;…x=secure_malloc(…)…enable_update();statement; disable_update();…secure_free(x);…

Page 15: Identification and Protection of Security-Critical Data

15

Implementation

• Secure heap – modified Doug Lea memory allocator

• Enable/disable protection• Update section inference – CIL module

• Future Work– Data Inference, secure stack, secure

global data section

Page 16: Identification and Protection of Security-Critical Data

16

Case Studies - Goals

• Security-critical data and update sections– How many?– How they can be automatically

inferred?

• Measure the performance (Null-Httpd)

• Verify the update section inference (Wu-FTPD)

Page 17: Identification and Protection of Security-Critical Data

17

Case Studies - Applications

Null-Httpd 0.5.0• 2,300 LOC• Web server

– Static HTML– CGI (Perl, PHP)

• Thread for each request

• Process for each script

Wu-FTPD 2.6.0• 18,000 LOC• FTP server• Fork to execute

external applications (ls,zip,tar)

Page 18: Identification and Protection of Security-Critical Data

18

Security-Critical Data

Wu-FTPD 2.6.0• Static data

– passwd structure

• Mostly local variables - uid, args

• execve, seteuid

Null-Httpd 0.5.0• Mostly static data

– Configuration parameters

– Connection data

• Local Variables - args, env

• write/send, execve

Page 19: Identification and Protection of Security-Critical Data

19

Update Sections - Null-Httpd 0.5.0

• 117 sections– The granularity of critical– The application architecture

• snprintf – more than half of the sections• strcat, strncpy• Interesting cases

– potential deadlock - recv, read – aliasing - strchr

Page 20: Identification and Protection of Security-Critical Data

20

Update Sections – Wu-FTPD 2.6.0

• Inference found 30 sections– Usually less than one screen away from

definition

• Missed one case– critical char* gargv[MAX_GARGV]– copy pointers – no direct call to malloc– no crash, but security vulnerability

Page 21: Identification and Protection of Security-Critical Data

21

Performance - Null-Httpd 0.5.0

• Penalty per single update – more than 5 orders of magnitude

• Penalty per connection – latency protected / latency unprotected

= 1.4

• Possible improvements– The data layout (fewer data)– Merge adjacent update sections

Page 22: Identification and Protection of Security-Critical Data

22

Conclusion

• Security-critical data can be identified and protected– Most passed to a few system calls– Run-time protections provided by existing hardware

• Update sections can be inferred– Number depends on application

• Many for Null-Httpd (application design)

• Performance penalty depends on the application– Big for Null-Httpd– Not measured for Wu-FTPD, but expected to be low

Page 23: Identification and Protection of Security-Critical Data

23

Questions

Thanks: David Evans, Westley Weimer, Nate Paul, Jeff

Shirley