Secure programming with static analysis / Brian Chess and Jacob West.
By: Chess, Brian
.
Contributor(s): West, Jacob
.
Material type:
BookSeries: Addison-Wesley software security series: Publisher: Upper Saddle River, NJ : Addison-Wesley, 2007Description: xxix, 587 p. : ill., map ; 24 cm.ISBN: 0321424778 ; 9780321424778.Subject(s): Computer security| Item type | Current library | Call number | Copy number | Status | Barcode | |
|---|---|---|---|---|---|---|
| General lending | MTU Bishopstown Library Lending | 005.8 (Browse shelf(Opens below)) | 1 | Available | 00170260 |
Enhanced descriptions from Syndetics:
The First Expert Guide to Static Analysis for Software Security!
Creating secure code requires more than just good intentions. Programmers need to know that their code will be safe in an almost infinite number of scenarios and configurations. Static source code analysis gives users the ability to review their work with a fine-toothed comb and uncover the kinds of errors that lead directly to security vulnerabilities. Now, there''s a complete guide to static analysis: how it works, how to integrate it into the software development processes, and how to make the most of it during security code review. Static analysis experts Brian Chess and Jacob West look at the most common types of security defects that occur today. They illustrate main points using Java and C code examples taken from real-world security incidents, showing how coding errors are exploited, how they could have been prevented, and how static analysis can rapidly uncover similar mistakes. This book is for everyone concerned with building more secure software: developers, security engineers, analysts, and testers. Coverage includes: Why conventional bug-catching often misses security problems How static analysis can help programmers get security right The critical attributes and algorithms that make or break a static analysis tool 36 techniques for making static analysis more effective on your code More than 70 types of serious security vulnerabilities, with specific solutions Example vulnerabilities from Firefox, OpenSSH, MySpace, eTrade, Apache httpd, and many more Techniques for handling untrusted input Eliminating buffer overflows: tactical and strategic approaches Avoiding errors specific to Web applications, Web services, and Ajax Security-aware logging, debugging, and error/exception handling Creating, maintaining, and sharing secrets and confidential information Detailed tutorials that walk you through the static analysis process "We designed Java so that it could be analyzed statically. This book shows you how to apply advanced static analysis techniques to create more secure, more reliable software." - Bill Joy, Co-founder of Sun Microsystems, co-inventor of the Java programming language "''Secure Programming with Static Analysis'' is a great primer on static analysis for security-minded developers and security practitioners. Well-written, easy to read, tells you what you need to know." - David Wagner, Associate Professor, University of California Berkeley "Software developers are the first and best line of defense for the security of their code. This book gives them the security development knowledge and the tools they need in order to eliminate vulnerabilities before they move into the final products that can be exploited." - Howard A. Schmidt, Former White House Cyber Security Advisor BRIAN CHESS is Founder and Chief Scientist of Fortify Software, where his research focuses on practical methods for creating secure systems. He holds a Ph.D. in Computer Engineering from University of California Santa Cruz, where he studied the application of static analysis to finding security-related code defects. JACOB WEST manages Fortify Software''s Security Research Group, which is responsible for building security knowledge into Fortify''s products. He brings expertise in numerous programming languages, frameworks, and styles together with deep knowledge about how real-world systems fail. CD contains a working demonstration version of Fortify Software''s Source Code Analysis (SCA) product; extensive Java and C code samples; and the tutorial chapters from the book in PDF format. Part I: Software Security and Static Analysis 1 1 The Software Security Problem 3 2 Introduction to Static Analysis 21 3 Static Analysis as Part of the Code Review Process 47 4 Static Analysis Internals 71 Part II: Pervasive Problems 115 5 Handling Input 117 6 Buffer Overflow 175 7 Bride of Buffer Overflow 235 8 Errors and Exceptions 265 Part III: Features and Flavors 295 9 Web Applications 297 10 XML and Web Services 349 11 Privacy and Secrets 379 12 Privileged Programs 421 Part IV: Static Analysis in Practice 457 13 Source Code Analysis Exercises for Java 459 14 Source Code Analysis Exercises for C 503 Epilogue 541 References 545 Index 559Includes bibliographical references (pages 545-558) and index.
Part I: Software Security and Static Analysis -- The software security problem -- Introduction to Static Analysis -- Static Analysis as Part of the Code Review Process -- Static Analysis Internals -- Part II: Pervasive Problems -- Handling Input -- Buffer Overflow -- Bride of Buffer Overflow -- Errors and Exceptions -- Part III: Features and Flavors -- Web Applications -- XML and Web Services -- Privacy and Secrets -- Privileged Programs -- Part IV: Static Analysis in Practice -- Source Code Analysis Exercises for Java -- Source Code Analysis Exercises for C.
Table of contents provided by Syndetics
- Part I Software Security and Static Analysis (p. 1)
- 1 The Software Security Problem (p. 3)
- 1.1 Defensive Programming Is Not Enough (p. 4)
- 1.2 Security Features != Secure Features (p. 6)
- 1.3 The Quality Fallacy (p. 9)
- 1.4 Static Analysis in the Big Picture (p. 11)
- 1.5 Classifying Vulnerabilities (p. 14)
- The Seven Pernicious Kingdoms (p. 15)
- 1.6 Summary (p. 19)
- 2 Introduction to Static Analysis (p. 21)
- 2.1 Capabilities and Limitations of Static Analysis (p. 22)
- 2.2 Solving Problems with Static Analysis (p. 24)
- Type Checking (p. 24)
- Style Checking (p. 26)
- Program Understanding (p. 27)
- Program Verification and Property Checking (p. 28)
- Bug Finding (p. 32)
- Security Review (p. 33)
- 2.3 A Little Theory, a Little Reality (p. 35)
- Success Criteria (p. 36)
- Analyzing the Source vs. Analyzing Compiled Code (p. 42)
- Summary (p. 45)
- 3 Static Analysis as Part of the Code Review Process (p. 47)
- 3.1 Performing a Code Review (p. 48)
- The Review Cycle (p. 48)
- Steer Clear of the Exploitability Trap (p. 54)
- 3.2 Adding Security Review to an Existing Development Process (p. 56)
- Adoption Anxiety (p. 58)
- Start Small, Ratchet Up (p. 62)
- 3.3 Static Analysis Metrics (p. 62)
- Summary (p. 69)
- 4 Static Analysis Internals (p. 71)
- 4.1 Building a Model (p. 72)
- Lexical Analysis (p. 72)
- Parsing (p. 73)
- Abstract Syntax (p. 74)
- Semantic Analysis (p. 76)
- Tracking Control Flow (p. 77)
- Tracking Dataflow (p. 80)
- Taint Propagation (p. 82)
- Pointer Aliasing (p. 82)
- 4.2 Analysis Algorithms (p. 83)
- Checking Assertions (p. 84)
- Naive Local Analysis (p. 85)
- Approaches to Local Analysis (p. 89)
- Global Analysis (p. 91)
- Research Tools (p. 94)
- 4.3 Rules (p. 96)
- Rule Formats (p. 97)
- Rules for Taint Propagation (p. 101)
- Rules in Print (p. 103)
- 4.4 Reporting Results (p. 105)
- Grouping and Sorting Results (p. 106)
- Eliminating Unwanted Results (p. 108)
- Explaining the Significance of the Results (p. 109)
- Summary (p. 113)
- Part II Pervasive Problems (p. 115)
- 5 Handling Input (p. 117)
- 5.1 What to Validate (p. 119)
- Validate All Input (p. 120)
- Validate Input from All Sources (p. 121)
- Establish Trust Boundaries (p. 130)
- 5.2 How to Validate (p. 132)
- Use Strong Input Validation (p. 133)
- Avoid Blacklisting (p. 137)
- Don't Mistake Usability for Security (p. 142)
- Reject Bad Data (p. 143)
- Make Good Input Validation the Default (p. 144)
- Check Input Length (p. 153)
- Bound Numeric Input (p. 157)
- 5.3 Preventing Metacharacter Vulnerabilities (p. 160)
- Use Parameterized Requests (p. 161)
- Path Manipulation (p. 167)
- Command Injection (p. 168)
- Log Forging (p. 169)
- Summary (p. 172)
- 6 Buffer Overflow (p. 175)
- 6.1 Introduction to Buffer Overflow (p. 176)
- Exploiting Buffer Overflow Vulnerabilities (p. 176)
- Buffer Allocation Strategies (p. 179)
- Tracking Buffer Sizes (p. 186)
- 6.2 Strings (p. 189)
- Inherently Dangerous Functions (p. 189)
- Bounded String Operations (p. 195)
- Common Pitfalls with Bounded Functions (p. 203)
- Maintaining the Null Terminator (p. 213)
- Character Sets, Representations, and Encodings (p. 218)
- Format Strings (p. 224)
- Better String Classes and Libraries (p. 229)
- Summary (p. 233)
- 7 Bride of Buffer Overflow (p. 235)
- 7.1 Integers (p. 236)
- Wrap-Around Errors (p. 236)
- Truncation and Sign Extension (p. 239)
- Conversion between Signed and Unsigned (p. 241)
- Methods to Detect and Prevent Integer Overflow (p. 242)
- 7.2 Runtime Protection (p. 251)
- Safer Programming Languages (p. 251)
- Safer C Dialects (p. 255)
- Dynamic Buffer Overflow Protections (p. 258)
- Dynamic Protection Benchmark Results (p. 263)
- Summary (p. 263)
- 8 Errors and Exceptions (p. 265)
- 8.1 Handling Errors with Return Codes (p. 266)
- Checking Return Values in C (p. 266)
- Checking Return Values in Java (p. 269)
- 8.2 Managing Exceptions (p. 271)
- Catch Everything at the Top Level (p. 272)
- The Vanishing Exception (p. 273)
- Catch Only What You're Prepared to Consume (p. 274)
- Keep Checked Exceptions in Check (p. 276)
- 8.3 Preventing Resource Leaks (p. 278)
- C and C++ (p. 279)
- Java (p. 283)
- 8.4 Logging and Debugging (p. 286)
- Centralize Logging (p. 286)
- Keep Debugging Aids and Back-Door Access Code out of Production (p. 289)
- Clean Out Backup Files (p. 292)
- Do Not Tolerate Easter Eggs (p. 293)
- Summary (p. 294)
- Part III Features and Flavors (p. 295)
- 9 Web Applications (p. 297)
- 9.1 Input and Output Validation for the Web (p. 298)
- Expect That the Browser Has Been Subverted (p. 299)
- Assume That the Browser Is an Open Book (p. 302)
- Protect the Browser from Malicious Content (p. 303)
- 9.2 HTTP Considerations (p. 319)
- Use POST, Not GET (p. 319)
- Request Ordering (p. 322)
- Error Handling (p. 322)
- Request Provenance (p. 327)
- 9.3 Maintaining Session State (p. 328)
- Use Strong Session Identifiers (p. 329)
- Enforce a Session Idle Timeout and a Maximum Session Lifetime (p. 331)
- Begin a New Session upon Authentication (p. 333)
- 9.4 Using the Struts Framework for Input Validation (p. 336)
- Setting Up the Struts Validator (p. 338)
- Use the Struts Validator for All Actions (p. 338)
- Validate Every Parameter (p. 342)
- Maintain the Validation Logic (p. 343)
- Summary (p. 346)
- 10 XML and Web Services (p. 349)
- 10.1 Working with XML (p. 350)
- Use a Standards-Compliant XML Parser (p. 350)
- Turn on Validation (p. 352)
- Be Cautious about External References (p. 358)
- Keep Control of Document Queries (p. 362)
- 10.2 Using Web Services (p. 366)
- Input Validation (p. 366)
- WSDL Worries (p. 368)
- Over Exposure (p. 369)
- New Opportunities for Old Errors (p. 370)
- JavaScript Hijacking: A New Frontier (p. 370)
- Summary (p. 376)
- 11 Privacy and Secrets (p. 379)
- 11.1 Privacy and Regulation (p. 380)
- Identifying Private Information (p. 380)
- Handling Private Information (p. 383)
- 11.2 Outbound Passwords (p. 388)
- Keep Passwords out of Source Code (p. 389)
- Don't Store Clear-Text Passwords (p. 391)
- 11.3 Random Numbers (p. 397)
- Generating Random Numbers in Java (p. 398)
- Generating Random Numbers in C and C++ (p. 401)
- 11.4 Cryptography (p. 407)
- Choose a Good Algorithm (p. 407)
- Don't Roll Your Own (p. 409)
- 11.5 Secrets in Memory (p. 412)
- Minimize Time Spent Holding Secrets (p. 414)
- Share Secrets Sparingly (p. 415)
- Erase Secrets Securely (p. 416)
- Prevent Unnecessary Duplication of Secrets (p. 418)
- Summary (p. 420)
- 12 Privileged Programs (p. 421)
- 12.1 Implications of Privilege (p. 423)
- Principle of Least Privilege (p. 423)
- This Time We Mean It: Distrust Everything (p. 426)
- 12.2 Managing Privilege (p. 427)
- Putting Least Privilege into Practice (p. 427)
- Restrict Privilege on the Filesystem (p. 433)
- Beware of Unexpected Events (p. 436)
- 12.3 Privilege Escalation Attacks (p. 439)
- File Access Race Conditions (p. 440)
- Insecure Temporary Files (p. 446)
- Command Injection (p. 450)
- Standard File Descriptors (p. 452)
- Summary (p. 454)
- Part IV Static Analysis in Practice (p. 457)
- 13 Source Code Analysis Exercises for Java (p. 459)
- Exercise 13.0 Installation (p. 460)
- Exercise 13.1 Begin with the End in Mind (p. 461)
- Exercise 13.2 Auditing Source Code Manually (p. 469)
- Exercise 13.3 Running Fortify SCA (p. 471)
- Exercise 13.4 Understanding Raw Analysis Results (p. 472)
- Exercise 13.5 Analyzing a Full Application (p. 478)
- Exercise 13.6 Tuning Results with Audit Workbench (p. 479)
- Exercise 13.7 Auditing One Issue (p. 483)
- Exercise 13.8 Performing a Complete Audit (p. 487)
- Exercise 13.9 Writing Custom Rules (p. 491)
- Answers to Questions in Exercise 13.2 (p. 499)
- 14 Source Code Analysis Exercises for C (p. 503)
- Exercise 14.0 Installation (p. 504)
- Exercise 14.1 Begin with the End in Mind (p. 505)
- Exercise 14.2 Auditing Source Code Manually (p. 513)
- Exercise 14.3 Running Fortify SCA (p. 514)
- Exercise 14.4 Understanding Raw Analysis Results (p. 515)
- Exercise 14.5 Analyzing a Full Application (p. 520)
- Exercise 14.6 Tuning Results with Audit Workbench (p. 521)
- Exercise 14.7 Auditing One Issue (p. 525)
- Exercise 14.8 Performing a Complete Audit (p. 529)
- Exercise 14.9 Writing Custom Rules (p. 531)
- Answers to Questions in Exercise 14.2 (p. 537)
- Epilogue (p. 541)
- References (p. 545)
- Index (p. 559)
Excerpt provided by Syndetics
Author notes provided by Syndetics
B rian Chess is a founder of Fortify Software. He currently serves as Fortify's Chief Scientist, where his work focuses on practical methods for creating secure systems. Brian holds a Ph.D. in Computer Engineering from the University of California at Santa Cruz, where he studied the application of static analysis to the problem of finding security-relevant defects in source code. Before settling on security, Brian spent a decade in Silicon Valley working at huge companies and small startups. He has done research on a broad set of topics, ranging from integrated circuit design all the way to delivering software as a service. He lives in Mountain View, California.
J acob West manages Fortify Software's Security Research Group, which is responsible for building security knowledge into Fortify's products. Jacob brings expertise in numerous programming languages, frameworks, and styles together with knowledge about how real-world systems can fail. Before joining Fortify, Jacob worked with Professor David Wagner at the
University of California at Berkeley to develop MOPS (MOdel Checking Programs for Security properties), a static analysis tool used to discover security vulnerabilities in C programs. When he is away from the keyboard, Jacob spends time speaking at conferences and working with customers to advance their understanding of software security. He lives in San Francisco, California.