21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3 CHAPTER 3<br />

Input Validation<br />

Eavesdropping attacks are often easy to launch, but most people don’t worry about<br />

them in their applications. Instead, they tend to worry about what malicious things<br />

can be done on the machine on which the application is running. Most people are far<br />

more worried about active attacks than they about passive attacks.<br />

Pretty much every active attack out there is the result of some kind of input from an<br />

attacker. Secure programming is largely about making sure that inputs from bad people<br />

do not do bad things. Indeed, most of this book addresses how to deal with malicious<br />

inputs. For example, cryptography and a strong authentication protocol can<br />

help prevent attackers from capturing someone else’s login credentials and sending<br />

those credentials as input to the program.<br />

If this entire book focuses primarily on preventing malicious inputs, why do we have<br />

a chapter specifically devoted to this topic? It’s because this chapter is about one<br />

important class of defensive techniques: input validation.<br />

In this chapter, we assume that people are connected to our software, and that some<br />

of them may send malicious data (even if we think there is a trusted client on the<br />

other end). One question we really care about is this: “What does our application do<br />

with that data?” In particular, does the program take data that should be untrusted<br />

and do something potentially security-critical with it? More importantly, can any<br />

untrusted data be used to manipulate the application or the underlying system in a<br />

way that has security implications?<br />

3.1 Understanding Basic Data Validation<br />

Techniques<br />

<strong>Problem</strong><br />

You have data coming into your application, and you would like to filter or reject<br />

data that might be malicious.<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.<br />

71

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!