did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780321424778

Secure Programming with Static Analysis

by ;
  • ISBN13:

    9780321424778

  • ISBN10:

    0321424778

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2007-06-29
  • Publisher: Addison-Wesley Professional

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
  • Complimentary 7-Day eTextbook Access - Read more
    When you rent or buy this book, you will receive complimentary 7-day online access to the eTextbook version from your PC, Mac, tablet, or smartphone. Feature not included on Marketplace Items.
List Price: $59.99 Save up to $50.96
  • Rent Book $21.00
    Add to Cart Free Shipping Icon Free Shipping

    TERM
    PRICE
    DUE

    7-Day eTextbook Access 7-Day eTextbook Access

    IN STOCK USUALLY SHIPS IN 24 HOURS.
    HURRY! ONLY 3 COPIES IN STOCK AT THIS PRICE
    *This item is part of an exclusive publisher rental program and requires an additional convenience fee. This fee will be reflected in the shopping cart.

Supplemental Materials

What is included with this book?

Summary

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.

Author Biography

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.

 

Table of Contents

Software Security and Static Analysisp. 1
The Software Security Problemp. 3
Defensive Programming Is Not Enoughp. 4
Security Features != Secure Featuresp. 6
The Quality Fallacyp. 9
Static Analysis in the Big Picturep. 11
Classifying Vulnerabilitiesp. 14
The Seven Pernicious Kingdomsp. 15
Summaryp. 19
Introduction to Static Analysisp. 21
Capabilities and Limitations of Static Analysisp. 22
Solving Problems with Static Analysisp. 24
Type Checkingp. 24
Style Checkingp. 26
Program Understandingp. 27
Program Verification and Property Checkingp. 28
Bug Findingp. 32
Security Reviewp. 33
A Little Theory, a Little Realityp. 35
Success Criteriap. 36
Analyzing the Source vs. Analyzing Compiled Codep. 42
Summaryp. 45
Static Analysis as Part of the Code Review Processp. 47
Performing a Code Reviewp. 48
The Review Cyclep. 48
Steer Clear of the Exploitability Trapp. 54
Adding Security Review to an Existing Development Processp. 56
Adoption Anxietyp. 58
Start Small, Ratchet Upp. 62
Static Analysis Metricsp. 62
Summaryp. 69
Static Analysis Internalsp. 71
Building a Modelp. 72
Lexical Analysisp. 72
Parsingp. 73
Abstract Syntaxp. 74
Semantic Analysisp. 76
Tracking Control Flowp. 77
Tracking Dataflowp. 80
Taint Propagationp. 82
Pointer Aliasingp. 82
Analysis Algorithmsp. 83
Checking Assertionsp. 84
Naive Local Analysisp. 85
Approaches to Local Analysisp. 89
Global Analysisp. 91
Research Toolsp. 94
Rulesp. 96
Rule Formatsp. 97
Rules for Taint Propagationp. 101
Rules in Printp. 103
Reporting Resultsp. 105
Grouping and Sorting Resultsp. 106
Eliminating Unwanted Resultsp. 108
Explaining the Significance of the Resultsp. 109
Summaryp. 113
Pervasive Problemsp. 115
Handling Inputp. 117
What to Validatep. 119
Validate All Inputp. 120
Validate Input from All Sourcesp. 121
Establish Trust Boundariesp. 130
How to Validatep. 132
Use Strong Input Validationp. 133
Avoid Blacklistingp. 137
Don't Mistake Usability for Securityp. 142
Reject Bad Datap. 143
Make Good Input Validation the Defaultp. 144
Check Input Lengthp. 153
Bound Numeric Inputp. 157
Preventing Metacharacter Vulnerabilitiesp. 160
Use Parameterized Requestsp. 161
Path Manipulationp. 167
Command Injectionp. 168
Log Forgingp. 169
Summaryp. 172
Buffer Overflowp. 175
Introduction to Buffer Overflowp. 176
Exploiting Buffer Overflow Vulnerabilitiesp. 176
Buffer Allocation Strategiesp. 179
Tracking Buffer Sizesp. 186
Stringsp. 189
Inherently Dangerous Functionsp. 189
Bounded String Operationsp. 195
Common Pitfalls with Bounded Functionsp. 203
Maintaining the Null Terminatorp. 213
Character Sets, Representations, and Encodingsp. 218
Format Stringsp. 224
Better String Classes and Librariesp. 229
Summaryp. 233
Bride of Buffer Overflowp. 235
Integersp. 236
Wrap-Around Errorsp. 236
Truncation and Sign Extensionp. 239
Conversion between Signed and Unsignedp. 241
Methods to Detect and Prevent Integer Overflowp. 242
Runtime Protectionp. 251
Safer Programming Languagesp. 251
Safer C Dialectsp. 255
Dynamic Buffer Overflow Protectionsp. 258
Dynamic Protection Benchmark Resultsp. 263
Summaryp. 263
Errors and Exceptionsp. 265
Handling Errors with Return Codesp. 266
Checking Return Values in Cp. 266
Checking Return Values in Javap. 269
Managing Exceptionsp. 271
Catch Everything at the Top Levelp. 272
The Vanishing Exceptionp. 273
Catch Only What You're Prepared to Consumep. 274
Keep Checked Exceptions in Checkp. 276
Preventing Resource Leaksp. 278
C and C++p. 279
Javap. 283
Logging and Debuggingp. 286
Centralize Loggingp. 286
Keep Debugging Aids and Back-Door Access Code out of Productionp. 289
Clean Out Backup Filesp. 292
Do Not Tolerate Easter Eggsp. 293
Summaryp. 294
Features and Flavorsp. 295
Web Applicationsp. 297
Input and Output Validation for the Webp. 298
Expect That the Browser Has Been Subvertedp. 299
Assume That the Browser Is an Open Bookp. 302
Protect the Browser from Malicious Contentp. 303
HTTP Considerationsp. 319
Use POST, Not GETp. 319
Request Orderingp. 322
Error Handlingp. 322
Request Provenancep. 327
Maintaining Session Statep. 328
Use Strong Session Identifiersp. 329
Enforce a Session Idle Timeout and a Maximum Session Lifetimep. 331
Begin a New Session upon Authenticationp. 333
Using the Struts Framework for Input Validationp. 336
Setting Up the Struts Validatorp. 338
Use the Struts Validator for All Actionsp. 338
Validate Every Parameterp. 342
Maintain the Validation Logicp. 343
Summaryp. 346
XML and Web Servicesp. 349
Working with XMLp. 350
Use a Standards-Compliant XML Parserp. 350
Turn on Validationp. 352
Be Cautious about External Referencesp. 358
Keep Control of Document Queriesp. 362
Using Web Servicesp. 366
Input Validationp. 366
WSDL Worriesp. 368
Over Exposurep. 369
New Opportunities for Old Errorsp. 370
JavaScript Hijacking: A New Frontierp. 370
Summaryp. 376
Privacy and Secretsp. 379
Privacy and Regulationp. 380
Identifying Private Informationp. 380
Handling Private Informationp. 383
Outbound Passwordsp. 388
Keep Passwords out of Source Codep. 389
Don't Store Clear-Text Passwordsp. 391
Random Numbersp. 397
Generating Random Numbers in Javap. 398
Generating Random Numbers in C and C++p. 401
Cryptographyp. 407
Choose a Good Algorithmp. 407
Don't Roll Your Ownp. 409
Secrets in Memoryp. 412
Minimize Time Spent Holding Secretsp. 414
Share Secrets Sparinglyp. 415
Erase Secrets Securelyp. 416
Prevent Unnecessary Duplication of Secretsp. 418
Summaryp. 420
Privileged Programsp. 421
Implications of Privilegep. 423
Principle of Least Privilegep. 423
This Time We Mean It: Distrust Everythingp. 426
Managing Privilegep. 427
Putting Least Privilege into Practicep. 427
Restrict Privilege on the Filesystemp. 433
Beware of Unexpected Eventsp. 436
Privilege Escalation Attacksp. 439
File Access Race Conditionsp. 440
Insecure Temporary Filesp. 446
Command Injectionp. 450
Standard File Descriptorsp. 452
Summaryp. 454
Static Analysis in Practicep. 457
Source Code Analysis Exercises for Javap. 459
Installationp. 460
Begin with the End in Mindp. 461
Auditing Source Code Manuallyp. 469
Running Fortify SCAp. 471
Understanding Raw Analysis Resultsp. 472
Analyzing a Full Applicationp. 478
Tuning Results with Audit Workbenchp. 479
Auditing One Issuep. 483
Performing a Complete Auditp. 487
Writing Custom Rulesp. 491
Answers to Questions in Exercise 13.2p. 499
Source Code Analysis Exercises for Cp. 503
Installationp. 504
Begin with the End in Mindp. 505
Auditing Source Code Manuallyp. 513
Running Fortify SCAp. 514
Understanding Raw Analysis Resultsp. 515
Analyzing a Full Applicationp. 520
Tuning Results with Audit Workbenchp. 521
Auditing One Issuep. 525
Performing a Complete Auditp. 529
Writing Custom Rulesp. 531
Answers to Questions in Exercise 14.2p. 537
Epiloguep. 541
Referencesp. 545
Indexp. 559
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

Preface Preface Following the light of the sun, we left the Old World. --Christopher Columbus We live in a time of unprecedented economic growth, increasingly fueled by computer and communications technology. We use software to automate factories, streamline commerce, and put information into the hands of people who can act upon it. We live in the information age, and software is the primary means by which we tame information. But oddly enough, much of the activity that takes place under the guise of computer security isn't really about solving security problems at all; it's about cleaning up the mess that security problems create. Virus scanners, firewalls, patch management, and intrusion-detection systems are all means by which we make up for shortcomings in software security. The software industry puts more effort into compensating for bad security than it puts into creating secure software in the first place. Do not take this to mean that we see no value in mechanisms that compensate for security failures. Just as every ship should have lifeboats, it is both good and healthy that our industry creates ways to quickly compensate for a newly discovered vulnerability. But the state of software security is poor. New vulnerabilities are discovered every day. In a sense, we've come to expect that we will need to use the lifeboats every time the ship sails. Changing the state of software security requires changing the way software is built. This is not an easy task. After all, there are a limitless number of security mistakes that programmers could make! The potential for error might be limitless, but in practice, the programming community tends to repeat the same security mistakes. Almost two decades of buffer overflow vulnerabilities serve as an excellent illustration of this point. In 1988, the Morris worm made the Internet programming community aware that a buffer overflow could lead to a security breach, but as recently as 2005, buffer overflow was the number one cause of security problems cataloged by the Common Vulnerabilities and Exposures (CVE) Project CWE, 2006. This significant repetition of well-known mistakes suggests that many of the security problems we encounter today are preventable and that the software community possesses the experience necessary to avoid them. We are thrilled to be building software at the beginning of the twenty-first century. It must have felt this way to be building ships during the age of exploration. When Columbus came to America, exploration was the driving force behind economic expansion, and ships were the means by which explorers traveled the world. In Columbus's day, being a world economic power required being a naval power because discovering a new land didn't pay off until ships could safely travel the new trade routes. Software security has a similar role to play in today's world. To make information technology pay off, people must trust the computer systems they use. Some pundits warn about an impending "cyber Armageddon," but we don't fear an electronic apocalypse nearly so much as we see software security as one of the primary factors that control the amount of trust people are willing to place in technology. Without adequate security, we cannot realize the full potential of the digital age. We believe that it is the responsibility of the people who create software to make sure that their creations are secure. Software security cannot be left to the system administrator or the end user. Network security, judicious administration, and wise use are all important, but in the long run, these endeavors cannot succeed if the software is inherently vulnerable. Although security can sometimes appear to be a black art or a matter of luck, we hope to show that it is neither. Making security sound impossible or mysterious is giving

Rewards Program