24 deadly sins of software security: programming flaws and how to fix them
Book information
Description
"What makes this book so important is that it reflects the experiences of two of the industry's most experienced hands at getting real-world engineers to understand just what they're being asked for when they're asked to write secure code. The book reflects Michael Howard's and David LeBlanc's experience in the trenches working with developers years after code was long since shipped, informing them of problems." —From the Foreword by Dan Kaminsky, Director of Penetration Testing, IOActive Eradicate the Most Notorious Insecure Designs and Coding Vulnerabilities Fully updated to cover the latest security issues, 24 Deadly Sins of Software Security reveals the most common design and coding errors and explains how to fix each one—or better yet, avoid them from the start. Michael Howard and David LeBlanc, who teach Microsoft employees and the world how to secure code, have partnered again with John Viega, who uncovered the original 19 deadly programming sins. They have completely revised the book to address the most recent vulnerabilities and have added five brand-new sins. This practical guide covers all platforms, languages, and types of applications. Eliminate these security flaws from your code: • SQL injection • Web server- and client-related vulnerabilities • Use of magic URLs, predictable cookies, and hidden form fields • Buffer overruns • Format string problems • Integer overflows • C++ catastrophes • Insecure exception handling • Command injection • Failure to handle errors • Information leakage • Race conditions • Poor usability • Not updating easily • Executing code with too much privilege • Failure to protect stored data • Insecure mobile code • Use of weak password-based systems • Weak random numbers • Using cryptography incorrectly • Failing to protect network traffic • Improper use of PKI • Trusting network name resolution Contents......Page 12 Foreword......Page 30 Acknowledgments......Page 34 Introduction......Page 36 Part I: Web Application Sins......Page 40 1 SQL Injection......Page 42 Overview of the Sin......Page 43 Affected Languages......Page 44 The Sin Explained......Page 45 Spotting the Sin During Code Review......Page 52 Testing Techniques to Find the Sin......Page 53 Example Sins......Page 55 Redemption Steps......Page 57 Extra Defensive Measures......Page 63 Other Resources......Page 64 Summary......Page 66 2 Web Server–Related Vulnerabilities (XSS, XSR, and Response Splitting)......Page 68 Overview of the Sin......Page 69 The Sin Explained......Page 70 Spotting the XSS Sin During Code Review......Page 82 Testing Techniques to Find the Sin......Page 83 Example Sins......Page 85 Redemption Steps (XSS and Response Splitting)......Page 86 Redemption Steps (XSRF)......Page 94 Extra Defensive Measures......Page 96 Other Resources......Page 99 Summary......Page 101 3 Web Client–Related Vulnerabilities (XSS)......Page 102 Overview of the Sin......Page 103 The Sin Explained......Page 104 Spotting the Sin During Code Review......Page 107 Example Sins......Page 108 Redemption Steps......Page 110 Other Resources......Page 112 Summary......Page 113 4 Use of Magic URLs, Predictable Cookies, and Hidden Form Fields......Page 114 The Sin Explained......Page 115 Spotting the Sin During Code Review......Page 117 Testing Techniques to Find the Sin......Page 118 Redemption Steps......Page 120 Summary......Page 124 Part II: Implementation Sins......Page 126 5 Buffer Overruns......Page 128 Overview of the Sin......Page 129 Affected Languages......Page 130 The Sin Explained......Page 131 Spotting the Sin During Code Review......Page 138 Testing Techniques to Find the Sin......Page 139 Example Sins......Page 140 Redemption Steps......Page 142 Extra Defensive Measures......Page 144 Other Resources......Page 145 Summary......Page 146 6 Format String Problems......Page 148 Affected Languages......Page 149 The Sin Explained......Page 150 Spotting the Sin During Code Review......Page 153 Example Sins......Page 154 Extra Defensive Measures......Page 155 Summary......Page 156 7 Integer Overflows......Page 158 Affected Languages......Page 159 The Sin Explained......Page 160 Spotting the Sin Pattern......Page 171 Spotting the Sin During Code Review......Page 172 Example Sins......Page 175 Redemption Steps......Page 177 Extra Defensive Measures......Page 180 Summary......Page 181 8 C++ Catastrophes......Page 182 CWE References......Page 183 The Sin Explained......Page 184 Spotting the Sin During Code Review......Page 189 Redemption Steps......Page 190 Other Resources......Page 193 Summary......Page 194 9 Catching Exceptions......Page 196 The Sin Explained......Page 197 Spotting the Sin During Code Review......Page 204 Redemption Steps......Page 206 Other Resources......Page 207 Summary......Page 208 10 Command Injection......Page 210 The Sin Explained......Page 211 Spotting the Sin During Code Review......Page 214 Example Sins......Page 216 Redemption Steps......Page 217 Summary......Page 221 11 Failure to Handle Errors Correctly......Page 222 The Sin Explained......Page 223 Example Sin......Page 227 Redemption Steps......Page 228 Summary......Page 229 12 Information Leakage......Page 230 CWE References......Page 231 The Sin Explained......Page 232 Spotting the Sin During Code Review......Page 238 Example Sins......Page 239 Redemption Steps......Page 240 Extra Defensive Measures......Page 242 Summary......Page 243 13 Race Conditions......Page 244 CWE References......Page 245 The Sin Explained......Page 246 Spotting the Sin During Code Review......Page 249 Example Sins......Page 250 Redemption Steps......Page 252 Summary......Page 254 14 Poor Usability......Page 256 The Sin Explained......Page 257 Spotting the Sin During Code Review......Page 260 Example Sins......Page 261 Redemption Steps......Page 263 Other Resources......Page 267 Summary......Page 268 15 Not Updating Easily......Page 270 The Sin Explained......Page 271 Spotting the Sin Pattern......Page 274 Example Sins......Page 275 Redemption Steps......Page 276 Other Resources......Page 280 Summary......Page 281 16 Executing Code with Too Much Privilege......Page 282 The Sin Explained......Page 283 Testing Techniques to Find the Sin......Page 285 Example Sins......Page 286 Redemption Steps......Page 287 Summary......Page 290 17 Failure to Protect Stored Data......Page 292 The Sin Explained......Page 293 Spotting the Sin During Code Review......Page 298 Testing Techniques to Find the Sin......Page 299 Redemption Steps......Page 301 Summary......Page 304 18 The Sins of Mobile Code......Page 306 Overview of the Sin......Page 307 CWE References......Page 308 The Sin Explained......Page 309 Spotting the Sin During Code Review......Page 310 Testing Techniques to Find the Sin......Page 311 Redemption Steps......Page 312 Other Resources......Page 314 Summary......Page 315 Part III: Cryptographic Sins......Page 316 19 Use of Weak Password-Based Systems......Page 318 Affected Languages......Page 319 The Sin Explained......Page 320 Spotting the Sin Pattern......Page 324 Spotting the Sin During Code Review......Page 326 Example Sins......Page 327 Redemption Steps......Page 330 Extra Defensive Measures......Page 334 Summary......Page 335 20 Weak Random Numbers......Page 338 The Sin Explained......Page 339 Spotting the Sin Pattern......Page 342 Spotting the Sin During Code Review......Page 343 Testing Techniques to Find the Sin......Page 344 Example Sins......Page 345 Redemption Steps......Page 347 Extra Defensive Measures......Page 351 Summary......Page 352 21 Using Cryptography Incorrectly......Page 354 CWE References......Page 355 The Sin Explained......Page 356 Spotting the Sin During Code Review......Page 362 Example Sins......Page 365 Redemption Steps......Page 366 Other Resources......Page 371 Summary......Page 372 Part IV: Networking Sins......Page 374 22 Failing to Protect Network Traffic......Page 376 Affected Languages......Page 377 The Sin Explained......Page 378 Testing Techniques to Find the Sin......Page 382 Example Sins......Page 383 Redemption Steps......Page 384 Summary......Page 385 23 Improper Use of PKI, Especially SSL......Page 386 CWE References......Page 387 The Sin Explained......Page 388 Spotting the Sin Pattern......Page 389 Spotting the Sin During Code Review......Page 390 Testing Techniques to Find the Sin......Page 391 Example Sins......Page 392 Redemption Steps......Page 393 Summary......Page 397 24 Trusting Network Name Resolution......Page 400 Affected Languages......Page 401 The Sin Explained......Page 402 Spotting the Sin Pattern......Page 405 Example Sins......Page 406 Redemption Steps......Page 408 Summary......Page 409 A......Page 410 B......Page 411 C......Page 412 D......Page 415 E......Page 416 F......Page 417 I......Page 418 L......Page 420 M......Page 421 O......Page 422 P......Page 423 R......Page 425 S......Page 426 T......Page 428 V......Page 430 W......Page 431 Y......Page 432
Similar books
24 deadly sins of software security: programming flaws and how to fix them
2009 · PDF
24 deadly sins of software security: programming flaws and how to fix them
2009 · PDF
19 Deadly Sins of Software Security: Programming Flaws and How to Fix Them
2005 · CHM
Writing Secure Code: Practical Strategies and Proven Techniques for Building Secure Applications in a Networked World
2004 · EPUB
Writing Secure Code for Windows Vista®
2007 · EPUB
Writing Secure Code
2002 · CHM
Writing Secure Code
2007 · CHM
War in European History
2009 · PDF