28.10.2014 Views

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

4 Chapter 1 • What Is <strong>SQL</strong> <strong>Injection</strong>?<br />

In principle, all interactive database-driven Web applications operate in the same way,<br />

or at least in a similar fashion.<br />

SELECT *<br />

FROM Products<br />

WHERE Price < '100.00'<br />

ORDER BY ProductDescription;<br />

A Simple Application Architecture<br />

As noted earlier, a database-driven Web application commonly has three tiers: presentation,<br />

logic, <strong>and</strong> storage. To help you better underst<strong>and</strong> how Web application technologies interact<br />

to present you with a feature-rich Web experience, Figure 1.1 illustrates the simple three-tier<br />

example that I outlined previously.<br />

Figure 1.1 Simple Three-Tier Architecture<br />

The presentation tier is the topmost level of the application. It displays information<br />

related to such services as browsing merch<strong>and</strong>ise, purchasing, <strong>and</strong> shopping cart contents,<br />

<strong>and</strong> it communicates with other tiers by outputting results to the browser/client tier <strong>and</strong> all<br />

other tiers in the network. The logic tier is pulled out from the presentation tier, <strong>and</strong> as its<br />

own layer, it controls an application’s functionality by performing detailed processing.<br />

The data tier consists of database servers. Here, information is stored <strong>and</strong> retrieved. This tier<br />

keeps data independent from application servers or business logic. Giving data its own tier<br />

also improves scalability <strong>and</strong> performance. In Figure 1.1, the Web browser (presentation)<br />

sends requests to the middle tier (logic), which services them by making queries <strong>and</strong> updates<br />

against the database (storage). A fundamental rule in a three-tier architecture is that the

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

Saved successfully!

Ooh no, something went wrong!