HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
There are a number of secure programming books on the market, but none that go as deep as this one. The depth and detail exceeds all books that I know about by an order of magnitude.
Halvar Flake, CEO and head of research, SABRE Security GmbH
The Definitive Insider's Guide to Auditing Software SecurityThis is one of the most detailed, sophisticated, and useful guides to software security auditing ever written. The authors are leading security consultants and researchers who have personally uncovered vulnerabilities in applications ranging from sendmail to Microsoft Exchange, Check Point VPN to Internet Explorer. Drawing on their extraordinary experience, they introduce a start-to-finish methodology for ripping apart applications to reveal even the most subtle and well-hidden security flaws.
The Art of Software Security Assessment covers the full spectrum of software vulnerabilities in both UNIX/Linux and Windows environments. It demonstrates how to audit security in applications of all sizes and functions, including network and Web software. Moreover, it teaches using extensive examples of real code drawn from past flaws in many of the industry's highest-profile applications.
Coverage includes
Code auditing: theory, practice, proven methodologies, and secrets of the trade
Bridging the gap between secure software design and post-implementation review
Performing architectural assessment: design review, threat modeling, and operational review
Identifying vulnerabilities related to memory management, data types, and malformed data
UNIX/Linux assessment: privileges, files, and processes
Windows-specific issues, including objects and the filesystem
Auditing interprocess communication, synchronization, and state
Evaluating network software: IP stacks, firewalls, and common application protocols
Auditing Web applications and technologies
This book is an unprecedented resource for everyone who must deliver secure software or assure the safety of existing software: consultants, security specialists, developers, QA staff, testers, and administrators alike.
Contents
ABOUT THE AUTHORS xv
PREFACE xvii
ACKNOWLEDGMENTS xxi
I Introduction to Software Security Assessment
1 SOFTWARE VULNERABILITY FUNDAMENTALS 3
2 DESIGN REVIEW 25
3 OPERATIONAL REVIEW 67
4 APPLICATION REVIEW PROCESS 91
II Software Vulnerabilities
5 MEMORY CORRUPTION 167
6 C LANGUAGE ISSUES 203
7 PROGRAM BUILDING BLOCKS 297
8 STRINGS ANDMETACHARACTERS 387
9 UNIX I: PRIVILEGES AND FILES 459
10 UNIX II: PROCESSES 559
11 WINDOWS I: OBJECTS AND THE FILE SYSTEM 625
12 WINDOWS II: INTERPROCESS COMMUNICATION 685
13 SYNCHRONIZATION AND STATE 755
III Software Vulnerabilities in Practice
14 NETWORK PROTOCOLS 829
15 FIREWALLS 891
16 NETWORK APPLICATION PROTOCOLS 921
17 WEB APPLICATIONS 1007
18 WEB TECHNOLOGIES 1083
BIBLIOGRAPHY 1125
INDEX 1129
C Language Issues for Application Security
Download the sample pages (includes Chapter 6 and Index)
ABOUT THE AUTHORS xv
PREFACE xvii
ACKNOWLEDGMENTS xxi
I Introduction to Software Security Assessment
1 SOFTWARE VULNERABILITY FUNDAMENTALS 3
2 DESIGN REVIEW 25
3 OPERATIONAL REVIEW 67
4 APPLICATION REVIEW PROCESS 91
II Software Vulnerabilities
5 MEMORY CORRUPTION 167
6 C LANGUAGE ISSUES 203
7 PROGRAM BUILDING BLOCKS 297
8 STRINGS ANDMETACHARACTERS 387
9 UNIX I: PRIVILEGES AND FILES 459
10 UNIX II: PROCESSES 559
11 WINDOWS I: OBJECTS AND THE FILE SYSTEM 625
12 WINDOWS II: INTERPROCESS COMMUNICATION 685
13 SYNCHRONIZATION AND STATE 755
III Software Vulnerabilities in Practice
14 NETWORK PROTOCOLS 829
15 FIREWALLS 891
16 NETWORK APPLICATION PROTOCOLS 921
17 WEB APPLICATIONS 1007
18 WEB TECHNOLOGIES 1083
BIBLIOGRAPHY 1125
INDEX 1129
"If popular culture has taught us anything, it is that someday mankind must
face and destroy the growing robot menace."
- Daniel H. Wilson, How to Survive a Robot Uprising
The past several years have seen huge strides in computer security, particularly in the field of software vulnerabilities. It seems as though every stop at the bookstore introduces a new title on topics such as secure development or exploiting software.
Books that cover application security tend to do so from the perspective of software designers and developers and focus on techniques to prevent software vulnerabilities from occurring in applications. These techniques start with solid security design principles and threat modeling and carry all the way through to implementation best practices and defensive programming strategies. Although they serve as strong defensive foundations for application development, these resources tend to give little treatment to the nature of vulnerabilities; instead, they focus on how to avoid them. What's more, every development team can't start rebuilding a secure application from the ground up. Real people have to deal with huge existing codebases, in-place applications, and limited time and budget. Meanwhile, the secure coding mantra seems to be "If it smells bad, throw it out." That's certainly necessary in some cases, but often it's too expensive and time consuming to be reasonable. So you might turn your attention to penetration testing and ethical hacking instead. A wide range of information on this topic is available, and it's certainly useful for the acid test of a software system. However, even the most technically detailed resources have a strong focus on exploit development and little to no treatment on how to find vulnerabilities in the first place. This still leaves the hanging question of how to find issues in an existing application and how to get a reasonable degree of assurance that a piece of software is safe.
This problem is exactly the one faced by those in the field of professional software security assessment. People are growing more concerned with building and testing secure systems, but very few resources address the practice of finding vulnerabilities. After all, this process requires a deep technical understanding of some very complex issues and must include a systematic approach to analyzing an application. Without formally addressing how to find vulnerabilities, the software security industry has no way of establishing the quality of a software security assessment or training the next generation in the craft. We have written this book in the hope of answering these questions and to help bridge the gap between secure software development and practical post-implementation reviews. Although this book is aimed primarily at consultants and other security professionals, much of the material will have value to the rest of the IT community as well. Developers can gain insight into the subtleties and nuances of how languages and operating systems work and how those features can introduce vulnerabilities into an application that otherwise appears secure. Quality assurance (QA) personnel can use some of the guidelines in this book to ensure the integrity of in-house software and cut down on the likelihood of their applications being stung by a major vulnerability. Administrators can find helpful guidelines for evaluating the security impact of applications on their networks and use this knowledge to make better decisions about future deployments. Finally, hobbyists who are simply interested in learning more about how to assess applications will find this book an invaluable resource (we hope!) for getting started in application security review or advancing their current skill sets.
Prerequisites
The majority of this book has been targeted at a level that any moderately experienced
developer should find approachable. This means you need to be fairly comfortable
with at least one programming language, and ideally, you should be familiar
with basic C/C++ programming. At several stages throughout the book, we use
Intel assembly examples, but we have attempted to keep them to a minimum and
translate them into approximate C code when possible. We have also put a lot
of effort into making the material as platform neutral as possible, although
we do cover platform specifics for the most common operating systems. When necessary,
we have tried to include references to additional resources that provide background
for material that can't be covered adequately in this book.
How to Use This Book
Before we discuss the use of this book, we need to introduce its basic structure.
The book is divided into three different parts:
You'll get the most value if you read this book straight through at least once so that you can get a feel for the material. This approach is best because we have tried to use each section as an opportunity to highlight techniques and tools that help you in performing application assessments. In particular, you should pay attention to the sidebars and notes we use to sum up the more important concepts in a section.
Of course, busy schedules and impending deadlines can have a serious impact on your time. To that end, we want to lay out a few tracks of focus for different types of reviews. However, you should start with Part 1 (Chapters 14) because it establishes a foundation for the rest of the book. After that, you can branch out to the following chapters: