What's a SQL Injection Attack?

Millions of servers daily are attacked for the purpose of extracting vital data.

By Paul Boutin
Wed, March 18, 2009

The Industry Standard — Here's some scary math: IBM tells USA Today that the enterprise service provider measures 450,000 attacks per day on its large corporate clients. How many does that mean when that is projected across the entire Internet? Millions of servers daily are attacked for the purpose of extracting vital data. But USA Today never explains exactly what a SQL injection attack is.

It's important for IT workers to understand SQL injection. Standard writer Lincoln Spector writes that operating systems (read: Microsoft Windows) have become much more bulletproof. So black-hat hackers now break into the Web applications running atop the operating system, because there are far more weaknesses to exploit there. According to Gartner, three-fourths of the Web applications vulnerabilities reported last year have still not been fixed.

SQL injection attacks work by placing commands written in the database manipulation language SQL (short for Structured Query Language) into, for example, the username field on a website's login page. Incorrect handling of the username causes it to be treated as part of a SQL command by the website's servers.

Wikipedia has several examples of SQL injection. In one, the hacker (or more likely, a program written by the hacker to attack many machines at once) fills in the username field with "a' or 't'='t'." This bit of SQL gets added to the command that looks up usernames in the database, where the programmer had assumed that only usernames would be typed.

So instead of running this SQL command:

statement = "SELECT * FROM users WHERE name = '" + userName + "';"

The Web application issues this command, which always returns a valid username because the extra clause, 't' = 't' , is always true.

statement = SELECT * FROM users WHERE name = 'a' OR 't'='t';

There are well-documented programming habits that can prevent SQL injection attacks. Or you could hire IBM, which is the unwritten point of the USA Today article. Either way, preventing SQL injection attacks is a must for stopping identity theft, the hijacking of servers to make them spambots, and the further spread of such malware.

What is Tech Briefcase?
TechBriefcase is a new, free service where IT Professionals can Search, Store and Share IT white papers and content like this. Learn more
Bookmark content
Speed up your research efforts with content across the web.
Search and Store
Find the white papers you need. Create folders for any topic.
View Anywhere
Open your briefcase on your iPhone, tablet or desktop. Share with colleagues.
Don't have an account yet?
The promise of enterprise mobility means that employees are more productive and address business issues in a timely, untethered manner.
Read this new eBook to learn the top five scenarios and essential best practices for preventing database attacks and insider threats.
The options for securing increasingly valuable databases are very broad and deep, and can be confusing. This research provides an overview of three categories of controls that should be implemented to ensure that enterprise data is protected in the most efficient and effective manner.
Read the analyst report and learn how you can leverage the core capabilities of a DAP solution for better database security.
PCI DSS is mandatory for any business that handles confidential cardholder data. Riverbed® Stingray™ Traffic Manager and Stingray Application Firewall Module help with many parts of the PCI DSS specification, notably the web application firewall (WAF) requirements of section 6.6.
PCI DSS is mandatory for any business that handles confidential cardholder data. Riverbed® Stingray™ Traffic Manager and Stingray Application Firewall Module help with many parts of the PCI DSS specification, notably the web application firewall (WAF) requirements of section 6.6.
View this demo and learn how IBM InfoSphere Guardium database activity monitoring can help protect your sensitive data in distributed DBMS environments with a holistic approach to data security and compliance.
Date: Wednesday, June 13, 2012, 1:00 PM EDT / 10:00 AM PDT

In a recent study conducted by Ponemon Institute, fifty-five percent of respondents indicated they were not confident that their organization would be able to detect the loss or theft of sensitive personal information in their company's databases and applications.

Join featured guest Dr. Larry Ponemon from the Ponemon Institute, to discuss these new findings and how to best address the growing number of data breaches and privacy challenges that are facing your organization. This webinar will focus on:

- Understanding the current state of privacy and data protection in the production environment
- Identifying areas of greatest vulnerability
- Keeping data secure without sacrificing productivity
- Enterprise and configurable solutions for multiple applications
Learn how IT teams can protect against spear phishing tactics. Harry Sverdlove, chief technology officer of Bit9 offers a frank discussion about spear phishing - the most common technique used in today's advanced attacks. Learn how spear phishing works and three recommendations for IT to protect against modern threats.
Download this eSeminar to hear from experts Ziff Davis Enterprise, VMware and HP and learn how client-side virtualization can improve your organization's performance, while reducing the IT burden of managing and maintaining an increasingly diverse client universe.
In this exclusive webcast from Viewfinity, you'll hear how to leverage Group Policy Object settings to close this vulnerability by elevating privileges for standard users.
More companies are adopting business service management practices to better align their business and IT needs. Download this video to hear findings from the 2011 BSM Maturity Benchmark Survey to learn how companies are taking a customer-centric approach to IT management.
Newsletter Sign-Up »

Receive the latest news test, reviews and trends on your favorite technology topics

Choose a newsletter
  1. View all Newsletters | Privacy Policy
Sponsored Links

Master the cloud with the power of convergence from HP

Connect with IT leaders redefining mobility at the Enterprise Mobile Hub

Choose New and manage one device instead of 170

Choose New for 8x the firewall and NAT performance

Check out a smart way of mobilizing your business with enterprise-ready Samsung Mobile.

Redefine your data center with HP servers.

Enhance your business with Windstream IT Solutions. Speak to someone local.

BlackBerry® Mobile Fusion. Different mobile devices. One platform.

Click to see how Accenture has delivered high performance to clients

CYBERMARYLAND | Learn Why Maryland is the Epicenter for Cybersecurity

Get Ethernet speeds from 1 Mbps to 10 Gbps - Comcast Business Class

Cognizant. Leading in Business, Application & Technology Services

Collaboration: driving better business outcomes

Gain cutting-edge insights at MIT in 2-5 day executive programs.

Complimentary Gartner Report on BYOD: Media Tablets & Beyond. View Now

Elevate storage agility and efficiency with HP 3PAR storage.

Choose New and slash the number of devices you manage

Customized information views & Twitter events at New Fulcrum Point

Splunk translates machine data into "aha" moments for IT and the business.

ManageEngine Desktop Central - Automate and Audit Your Desktop Management! Learn More...

Cloud Readiness Starts with Intel® Technology

High performance. Delivered. Click to see Accenture's client successes

Visit the Virtually There Learning Page to learn how to use virtualization to your competitive advantage.

Free: Hunter Muller's "The Transformational CIO."

Join us for an upcoming Microsoft 365 live online demo event.

Discover your easiest path to unified communications

Virtualizing Your Infrastructure Just Got Easier

Connect with global CIOs now at Enterprise CIO Forum

Resource Center