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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

130 Chapter 3 • Reviewing Code for <strong>SQL</strong> <strong>Injection</strong><br />

<strong>and</strong> products chosen in each situation are modified to individual requirements. Good quality<br />

assurance techniques can be effective in identifying <strong>and</strong> eliminating vulnerabilities during<br />

the development stage. Penetration testing, fuzz testing, <strong>and</strong> source code audits should all be<br />

incorporated as part of an effective quality assurance program. Improving the software<br />

development process <strong>and</strong> building better software are ways to improve software security<br />

(i.e., by producing software with fewer defects <strong>and</strong> vulnerabilities). Many COTS software<br />

packages are available to support software security assurance activities. However, before you<br />

use these tools, you must carefully evaluate them <strong>and</strong> ensure that they are effective. I suggest<br />

that before parting with what can be very large sums of money, you perform your own<br />

comprehensive product evaluation. To research the tools, you can use the free trials that are<br />

available from the companies’ Web sites or contact a sales representative.<br />

Notes from the Underground…<br />

The Right Tool for the Job<br />

Implementing SCAs into the development life cycle does not automatically result in<br />

the production of secure application code. Tools that implement metrics based on<br />

historical data in an attempt to provide management with pretty graphs <strong>and</strong> trend<br />

analysis reports that inadvertently lead to reprim<strong>and</strong>s for developers or project leads<br />

for failing to meet arbitrary targets can be counterproductive. Just like hackers,<br />

developers can be very capable of finding ingenious ways to “beat the system” so<br />

that metrics are favorable (i.e., producing code in such a manner that the SCA does<br />

not flag their code). This can lead to vulnerabilities being resident within the code<br />

<strong>and</strong> not being identified.<br />

In addition, if the developer does not underst<strong>and</strong> why a vulnerability is being<br />

reported <strong>and</strong> the tool does not provide sufficient information to instill a comprehensive<br />

underst<strong>and</strong>ing, he can be lulled into believing that the alert is nothing more than a<br />

false positive. There are a couple of very public <strong>and</strong> well-known examples of such<br />

situations occurring in the code of the RealNetworks RealPlayer software<br />

(CVE–2005–0455, CAN–2005–1766, <strong>and</strong> CVE–2007–3410). The published vulnerability<br />

announcements contained the vulnerable lines of source code. The ignore directive<br />

for a popular SCA (Flawfinder) was appended to the vulnerable lines. The tool had<br />

reported the vulnerability, but instead of fixing it, a developer had added the ignore<br />

directive to the code so that tool would stop reporting the vulnerability!<br />

Continued

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

Saved successfully!

Ooh no, something went wrong!