Docsity

Improving Security Using Extensible Lightweight Static Analysis | CS 6463, Study notes of Computer Science

Toggle sidebar
bg1
Improving Security Using Extensible
Lightweight Static Analysis
David Evans and David Larochelle
Presented by: Sreedevi Jagavarapu
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Improving Security Using Extensible Lightweight Static Analysis | CS 6463 and more Study notes Computer Science in PDF only on Docsity!

Improving Security Using Extensible

Lightweight Static Analysis

David Evans and David Larochelle

Presented by: Sreedevi Jagavarapu

Overview

 Introduction  Common Vulnerabilities  Mitigating Software Vulnerabilities  Splint Overview  Buffer Overflows  Use warnings  Describing functions  Analyzing Program values  Extensible checking  Detecting format bugs  Taintedness attributes  Conclusion

Common Vulnerabilities

Mitigating Software Vulnerabilities  Limiting damage  Modifying program binaries to insert runtime checks  Running applications in restricted environments  Eliminating flaws

 Human Code reviews

 Time-consuming and expensive

 Testing

 Ineffective for finding security vulnerabilities

 Static Analysis

 Rather than observe program execution, they analyze source code directly

Splint Overview

 Annotations

 Denoted using C comments identified by an @ character following the /* comment marker

 Analysis

 We can analyze both theoretically and practically  It analyzes procedure calls from annotations  Preconditions,postconditions  No guarantee that all messages indicate real bugs  No guarantee that all bugs will be found

Buffer Overflows

 It is single most important security problem of the past decades eg: Overwriting a buffer on the stack, replacing the return address  C programs are vulnerable  C is designed with emphasis on performance and simplicity  Unsafe functions in ANSI C eg: gets()---enters unbounded amount of input  Splint detects both stack and heap-based buffer overflows  Use warnings  Describing functions  Analyzing Program values

Describe Functions

 This property can describe by adding a “requires” clause to the declaration  It uses two buffer attributes  MaxsetMaxRead  Produce warnings  If maxSet (s) >= maxRead(t)  s might be over run by strcpy call

Analyzing Program Values

 Splint analyzes a function body annotated precondition  It generates preconditions and post conditions at the expression level in the parse tree using internal rules  eg: char buf[maxsize]  Preconditions maxSet (buf) = MAXSIZE – 1 and minSet (buf) = 0  Sprint issues a warnings about the unsatisfied condition  If it cannot determine that the value is between 0 and MAXSIZE - 1

Detecting Format Bugs

Format bug: Attacker can send hostile input as the format string for a variable arguments  eg: printf ,%n  Detect Format vulnerabilites  Provide warnings for any unknown string at compile time  set +formatconst flag  Detect weather it comes from user or external environment  Eg: Perl’s taint option  Set –T flag

Taintedness Attributes

 Splint can detect dangerous operations with tainted values at compile time  Taintedness attributes associated with char * objects  Annotations are tainted and untainted  Transfers  Merge  Defaults

How to run Splint

 Running Splint is an iterative process  Splint checks approximately 1,000 lines per second, so it is fairly easy to run Splint  The goal is to eliminate all the warnings by modifying code or adjusting annotations

Running Splint on wu-ftpd

Conclusion

 No tool will eliminate all security risks  Lightweight static analysis tools will help codify known security vulnerabilities and integrate into development process  Splint plays an important part in codifying security vulnerabilities

References

 1. Common Vulnerabilities and Exposures, version 20010918, The Mitre Corporation, 2001; http://cve.mitre.org (current Nov. 2001).  2. D. Wagner et al., “A First Step Towards Automated Detection of Buffer Overrun Vulnerabilities,” Proc. 200 Network and Distributed System Security Symp., Internet Society, Reston, Va., 2000; www.isoc.org/ndss2000/proceedings (current Nov. 2001).  3. I. Goldberg et al., “A Secure Environment for Untrusted Helper Applications: Confining the Wily Hacker,” Proc.Sixth Usenix Security Symp., Usenix Assoc., Berkeley, Calif., 1996; www.cs.berkeley.edu/~daw/papers/anus-usenix96.ps (current Nov. 2001).  4. D. Evans and A. Twyman, “Flexible Policy-Directed Code Safety,” IEEE Symp. Security and Privacy , IEEE CS Press, Los Alamitos, Calif., 1999, pp. 32–45.  5. A. Baratloo, N. Singh, and T. Tsai, “Transparent Run-Time Defense Against Stack-Smashing Attacks,” Proc.Ninth Usenix Security Symp. , Usenix Assoc., Berkeley,Calif., 2000; www.usenix.org/events/usenix2000/general/baratloo.html (current Nov. 2001).