SQL Injection, eye of the storm

Sunday, February 22, 2009

Originally published by Security Horizon in the Winter 2009 edition of Security Journal.

In 2008 SQL Injection became the leading method of malware distribution, infecting millions of Web pages and foisting browser-based exploits upon unsuspecting visitors. The ramifications to online businesses include data loss, PCI fines, downtime, recovery costs, brand damage, and revenue decline when search engines blacklist them. According to WhiteHat Security, 16 percent of websites are vulnerable to SQL Injection. This is likely under-reported given that the statistics are largely based on top-tier Web properties that employ a website vulnerability management solution to identify the problem. The majority of websites do not and as such may be completely unaware of the extent of the issue. In addition, some recommended security best-practice have ironically benefited malicious hackers. Websense now reports that "60 percent of the top 100 most popular Web sites have either hosted or been involved in malicious activity in the first half of 2008." Let’s examine the forces that have aligned to create the storm that allows SQL Injection to thrive.

Any custom Web application that lacks proper input-validation, fails to use parameterized SQL statements, and/or creates dynamic SQL with user-supplied data potentially leave themselves open to SQL Injection attacks -- unauthorized commands passed to back-end databases. When Rain Forest Puppy first described SQL Injection ten years ago, on Christmas Day 1998, it was a targeted one-off attack capable of exploiting only a single website at a time. Custom Web applications contain custom vulnerabilities and require custom exploits. Successfully extracting data out of an unfamiliar database is different in each instance and greatly aided by error messages revealing snippets of server-side code.

To solve the SQL Injection problem, preferably in the code, first we must identify what is broken. The easiest method to-date has been through remote black-box testing, submitting meta-characters (single quotes and semicolons) into Web applications. If the website returns a recognizable response, such as an ODBC error message, there is a high probability that a weakness exists. Comprehensive security testing, typically aided by black-box vulnerability scanners, performs the same procedure on every application input-point including URL query parameters, POST data, cookies, etc. and repeated with each code update. This software security testing process is also now one of the assessment options mandated by PCI-DSS section 6.6.

In the wake of highly publicized compromises like the 2006 incident at CardSystems, a back-end credit card transaction processor, in which millions of stolen credit card numbers fell into the wrong hands, website owners were strongly encouraged to update their Web application code and suppress error messages to defend against SQL Injection attacks. Many implemented solely the latter since it only required a simple configuration change, hindering the bad guy’s ability to identify SQL Injection vulnerabilities. Since the vulnerabilities couldn’t be found easily, perhaps this contributed to incorrectly training developers that security through obscurity was enough. Widespread attacks were not seen as prevalent enough to justify a serious software security investment. Despite cutting-edge Blind SQL Injection research helping to improve black-box testing, error message suppression contributed to three very important side effects:

  1. Black-box vulnerability scanner false-positive and false-negative rate skyrocketed.
  2. SQL Injection became significantly harder to identify, but ironically not exploit.
  3. Extracting data out of a database became exceptionally more laborious than injecting data in.
In 2007, cyber criminals in China created a new technique capable of generically exploiting SQL Injection vulnerabilities without reliance on error messages. Perpetrators inserted malicious JavaScript IFRAMEs (pointing to malware servers) into back-end databases, as opposed to pulling data out, and used the capability to exploit unpatched Web browsers and plugi-ins in record numbers. "The scale of this global criminal operation has reached such proportions that Sophos discovers one new infected webpage every 4.5 seconds – 24 hours a day, 365 days a year." No longer limited to one-off hacks, SQL Injection quickly became a method of choice to target anything and everything on the Web. According to Websense, “75 percent of Web sites with malicious code are legitimate sites that have been compromised.” Furthermore, attacks have been widely successful without even needing to authenticate. That means any website functionality beyond a login screen represents further attack targets. Worse still, security pros are unable to leverage these techniques to improve SQL Injection vulnerability detection because doing so risks adversely affecting the website.

For example, when vulnerability assessments are conducted on production systems, a cardinal rule must be followed, “Do no harm.” This often requires that testing rates be limited (X number of requests per second), testing windows be respected (usually during off-peak hours), and tests be nondestructive. It should go without saying that we do not want to crash websites or fill databases with undesirable content. Malicious hackers have no such restrictions as they may test however they want, whenever they want, for as long as they want. The other disadvantage for website defenders is that they must be 100% accurate at finding and fixing every issue all the time, while the attacker need only to exploit a single missed issue. This is an unfortunate, but inescapable reality in Web security and why testing frequency and comprehensiveness approach is vital.

Source code review (aka white-box testing) is the other option to locate SQL Injection vulnerabilities and often able to peer deeper into the problem than black-box testing. Of course you must have access to the source code. Before considering this as a scalable solution begin by asking yourself if executive management would allocate enough resources to perform source code reviews on every website every time they change. Thinking globally, let’s consider that there are over 186 million websites. While not all are “important,” if 16% had just a single vulnerability as previously cited, that means a staggering 30 million issues are in circulation. Would it be reasonable to project that finding (not fixing) each unique issue through white-box testing, even assisted by automation, would require $100 in personnel and technology costs? If so, we are talking about at least a $3 billion dollar price tag to simply locate SQL Injection -- to say nothing about other more prevalent issues such as Cross-Site Scripting and Cross-Site Request Forgery that will be left undiscovered.

Secure software education is another valuable long-term strategy that will help prevent another 30 million vulnerabilities being added to the pile over the next 15 years, but will not provide a short-term fix to the problem. Currently, there are roughly 17 million developers worldwide who are not educated on the basic concepts of secure coding that could help them tackle the SQL injection and other issues. Would $500 per developer be an acceptable rate for professional training (commercial 2-day classes typically start at $1,000 on up)? If so, the market must be prepared to make an $8.5 billion investment and then wait for everyone to come up to speed. Obviously the private sector is not going to shoulder such a financial burden alone, not in any economy, let alone in a recession. The fact is education costs must be shared in amongst colleges, enterprises, vendors, developers themselves, or through materials made freely available by organizations such as OWASP and WASC.

The climate for SQL Injection vulnerabilities has all the makings of a perfect storm, one we are already experiencing. The issue is extremely dangerous, incredibly pervasive, difficult to identify, easy to exploit, and expensive to fix. Over the last 15 years organizations have accumulated a lot Web security debt that eclipses our currently estimated spending of ~$300 million, combining outlays for scanning tools, professional services, training, and Web application firewalls. Perhaps we should ask president-elect Obama for a Web security bailout. Not likely. The fact is not every organization will invest adequately to protect themselves, at least not over night. Those who do not will undoubtedly become the low hanging fruit bad guys target first. The smart money says vast numbers of compromises will continue throughout 2009.

For those wishing to do all they can to prevent compromises, the answer is adopting a holistic approach addressing overall Web security, including SQL Injection. While fully articulating the details of each solution is beyond the scope of this article, it is important to highlight several of the most important and why they are a good ideas.
  • Security throughout the Software Development Life-Cycle, because an ounce of prevention is worth a pound of cure.
  • Education, teach a man to fish.
  • Vulnerability Assessment, because you cannot secure what you cannot measure.
  • Web Application Firewalls, because software is not and will never be perfect.
  • Web Browser security, because one must be able to protect themselves against a hostile website.
This combined strategy will prevent us from having the same conversation about Cross-Site Scripting and Cross-Site Request Forgery in the near future.
Possibly Related Articles:
12283
General Webappsec->General Vulnerabilities
SQl Injection
Post Rating I Like this!
Default-avatar
avelin injector http://blogdemellizos.blogspot.com/2014/03/contoh-naskah-drama-singkat-anak-sekolah.html
http://blogdemellizos.blogspot.com/2014/03/kata-kata-mutiara-bijak-malam-hari-indah.html
http://blogdemellizos.blogspot.com/2014/03/kata-kata-mutiara-bijak-ibu-kepada-anaknya.html
http://blogdemellizos.blogspot.com/2014/03/kata-kata-mutiara-doa-untuk-ibu-bunda-tercinta.html
http://blogdemellizos.blogspot.com/2014/03/contoh-naskah-drama-persahabatan-menyesal.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-mutiara-bijak-motivasi-indah-sore-hari.html

http://blogdemellizos.blogspot.com/2014/02/kata-kata-motivasi-mutiara-bijak-indah-sore-hari.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-galau-sedih-kesepian-tanpa-cinta-malam-hari.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-move-on-hati-yang-tersakiti-cinta.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-mutiara-hati-yang-paling-dalam.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-doa-mutiara-indah-buat-bunda-tercinta.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-doaku-indah-pagi-hari-doa-motivasi-bijak-hari-ini.html

http://blogdemellizos.blogspot.com/2014/02/kata-kata-jomblo-ngenes-lucu-gokil-ngaco-romantis.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-nasehat-mutiara-bijak-islami-pagi-hari.html
http://blogdemellizos.blogspot.com/2014/02/puisi-pagi-hari-ucapan-selamat-pagi-romantis.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-doa-indah-sabar-dan-ikhlas.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-nasehat-lucu-ngaco-gokil.html
http://blogdemellizos.blogspot.com/2014/02/kata-kata-ucapan-selamat-tidur-romantis.html

http://blogdemellizos.blogspot.com/2014/01/kata-kata-kesetiaan-cinta-sejati.html
http://blogdemellizos.blogspot.com/2014/01/pantun-gombal-cinta-romantis-gokil-lucu.html
http://blogdemellizos.blogspot.com/2014/01/kata-kata-mutiara-cinta-islam-untuk-wanita.html
http://blogdemellizos.blogspot.com/2014/01/kata-kata-romantis-cinta-malam-hari.html
http://blogdemellizos.blogspot.com/2013/12/kata-kata-galau-cinta-buat-pacar.html
http://blogdemellizos.blogspot.com/2013/12/kata-kata-nasehat-bijak-ayah-tercinta.html

http://blogdemellizos.blogspot.com/2013/12/kata-kata-nasehat-ibu-kepada-anaknya.html
http://blogdemellizos.blogspot.com/2013/12/kata-kata-nasehat-bijak-ibu-tersayang.html
http://blogdemellizos.blogspot.com/2013/12/kata-kata-bijak-pagi-hari-yang-cerah.html
http://blogdemellizos.blogspot.com/2013/11/kata-kata-doa-pagi-renungan-mutiara-pagi-hari.html
http://blogdemellizos.blogspot.com/2013/11/kata-kata-galau-sakit-hati-kecewa.html
http://blogdemellizos.blogspot.com/2013/11/kata-kata-cinta-menyentuh-hati.html

http://blogdemellizos.blogspot.com/2013/11/kata-kata-galau-karena-mantan-pacar.html
http://blogdemellizos.blogspot.com/2013/10/kata-kata-renungan-cinta-malam-hari.html
http://blogdemellizos.blogspot.com/2013/10/kata-kata-bijak-cinta-penuh-makna.html
http://blogdemellizos.blogspot.com/2014/11/kata-kata-nyindir-orang-sombong.html
http://blogdemellizos.blogspot.com/2014/11/kata-kata-malam-minggu-yang-sepi.html
http://blogdemellizos.blogspot.com/2014/11/kata-kata-cinta-buat-gebetan.html

http://blogdemellizos.blogspot.com/2014/11/kata-kata-kecewa-buat-pacar.html
http://blogdemellizos.blogspot.com/2014/11/kata-kata-sedih-buat-pacar.html
http://blogdemellizos.blogspot.com/2014/11/kata-kata-dibohongi.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-patah-hati-kecewa-karena-cinta.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-lucu-banget-bahasa-jawa.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-rindu-buat-pacar.html

http://blogdemellizos.blogspot.com/2014/10/contoh-surat-izin-tidak-masuk-sekolah.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-sakit-hati-kecewa-untuk-teman.html
http://blogdemellizos.blogspot.com/2014/10/gambar-dp-bbm-anak-racing.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-sindiran-halus-buat-teman.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-pacaran-jarak-jauh.html
http://blogdemellizos.blogspot.com/2014/10/gambar-wallpaper-bunga-melati-putih.html

http://blogdemellizos.blogspot.com/2014/10/kata-kata-aku-bahagia-bersamamu.html
http://blogdemellizos.blogspot.com/2014/10/tes-iq-online-indonesia.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-benci.html
http://blogdemellizos.blogspot.com/2014/10/cinta-bertepuk-sebelah-tangan.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-anak-racing-drag-balap-motor.html
http://blogdemellizos.blogspot.com/2014/10/model-kebaya-wisuda.html

http://blogdemellizos.blogspot.com/2014/10/kata-kata-sindiran-lucu-gokil-buat-pacar.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-sindiran-buat-orang-sirik-iri.html
http://blogdemellizos.blogspot.com/2014/10/contoh-surat-kuasa-pengambilan-bpkb.html
http://blogdemellizos.blogspot.com/2014/10/contoh-surat-permohonan-izin-cuti-menikah.html
http://blogdemellizos.blogspot.com/2014/10/contoh-surat-izin-tidak-masuk-kuliah.html
http://blogdemellizos.blogspot.com/2014/10/contoh-surat-permohonan-magang-kerja-resmi.html

http://blogdemellizos.blogspot.com/2014/10/contoh-slip-gaji-bulanan-karyawan-swasta.html
http://blogdemellizos.blogspot.com/2014/10/download-dp-bbm-lucu-gokil-unik-terbaru.html
http://blogdemellizos.blogspot.com/2014/10/sakitnya-tuh-disini.html
http://blogdemellizos.blogspot.com/2014/10/gambar-dp-bbm-sindiran-halus-buat-pacar.html
http://blogdemellizos.blogspot.com/2014/10/gambar-dan-kata-kata-doa-kristen-rohani.html
http://blogdemellizos.blogspot.com/2014/10/gambar-kata-kata-gokil-unik-keren-lucu.html

http://blogdemellizos.blogspot.com/2014/10/gambar-foto-kata-kata-gombal-cinta-romantis.html
http://blogdemellizos.blogspot.com/2014/10/gambar-dp-bbm-motivasi-semangat-pagi-hari.html
http://blogdemellizos.blogspot.com/2014/10/download-gambar-foto-kata-kata-cinta-romantis.html
http://blogdemellizos.blogspot.com/2014/10/wallpaper-kata-kata-galau-lucu-terbaru.html
http://blogdemellizos.blogspot.com/2014/10/gambar-kata-kata-cemburu-cinta-buat-pacar.html
http://blogdemellizos.blogspot.com/2014/10/wallpaper-kata-kata-mutiara-indah-terbaru.html

http://blogdemellizos.blogspot.com/2014/10/wallpaper-kata-kata-cinta-romantis-terbaru.html
http://blogdemellizos.blogspot.com/2014/10/wallpaper-kata-kata-lucu-gokil-unik-terbaru.html
http://blogdemellizos.blogspot.com/2014/10/gambar-foto-kata-kata-mutiara-bijak-islam.html
http://blogdemellizos.blogspot.com/2014/10/gambar-display-picture-bbm-galau-sedih.html
http://blogdemellizos.blogspot.com/2014/10/gambar-display-picture-bbm-mutiara-cinta-romantis.html
http://blogdemellizos.blogspot.com/2014/10/gambar-display-picture-bbm-lucu-unik-gokil.html

http://blogdemellizos.blogspot.com/2014/10/download-foto-foto-lucu-untuk-dp-bbm-terbaru.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-motivasi-galau-cinta-mario-teguh.html
http://blogdemellizos.blogspot.com/2014/10/gambar-dp-bbm-naruto-shippuden-terbaru.html
http://blogdemellizos.blogspot.com/2014/10/gambar-dp-bbm-kata-kata-mutiara-lelah-menunggu.html
http://blogdemellizos.blogspot.com/2014/10/kata-kata-lelah-hati-ini-menunggu-cinta.html
http://blogdemellizos.blogspot.com/2014/10/gambar-tulisan-galau-sedih-buat-dp-bbm.html

http://blogdemellizos.blogspot.com/2014/03/kata-kata-mutiara-cinta-suami-istri.html
http://blogdemellizos.blogspot.com/2014/10/gambar-dp-bbm-kata-kata-sakitnya-tuh-disini.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-pantang-menyerah.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-bijak-selingkuh.html
http://blogdemellizos.blogspot.com/2014/09/gambar-kata-kata-rindu-mantan-kekasih.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-sakit-kepala-pusing-mumet-jenuh.html

http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-bosan-bete-capek.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-karma-cinta-buat-mantan.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-mutiara-bijak-putus-asa.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-sayang-romantis.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-gokil-lucu-kocak-unik-terbaru.html
http://blogdemellizos.blogspot.com/2014/09/kata-kata-mutiara-bijak-sindiran-lucu.html

http://blogdemellizos.blogspot.com/2014/09/download-gambar-kata-kata-galau-sedih-kecewa.html
http://blogdemellizos.blogspot.com/2014/09/download-gambar-kata-kata-sakit-hati-kecewa.html
http://blogdemellizos.blogspot.com/2014/09/download-gambar-kata-kata-mutiara-bijak-terbaru.html
http://blogdemellizos.blogspot.com/2014/09/kata-kata-rindu-kangen-sahabat-tercinta.html
http://blogdemellizos.blogspot.com/2014/09/kata-kata-romantis-merindukan-seorang-kekasih.html
http://blogdemellizos.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-sindiran-mantan-penghianat.html

http://ikatakataromantis.blogspot.com/2014/01/kata-kata-romantis-buat-mantan-kekasih.html
http://ikatakataromantis.blogspot.com/2014/01/kata-kata-galau-kecewa-sakit-hati.html
http://ikatakataromantis.blogspot.com/2014/01/kata-kata-galau-sedih-patah-hati.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-sindiran-pacar-sok-sibuk.html
http://ikatakataromantis.blogspot.com/2014/09/kata-kata-menyindir-pacar-yang-cuek-jutek.html

http://ikatakataromantis.blogspot.com/2013/12/kata-kata-galau-sedih-romantis.html
http://ikatakataromantis.blogspot.com/2014/04/kata-kata-sindiran-buat-orang-sombong.html
http://ikatakataromantis.blogspot.com/2014/04/kata-kata-sindiran-buat-orang-munafik.html
http://ikatakataromantis.blogspot.com/2014/04/kata-kata-romantis-buat-istri-tercinta.html

http://ikatakataromantis.blogspot.com/2014/10/gambar-sedih-sakit-hati-buat-dp-bbm.html
http://ikatakataromantis.blogspot.com/2014/10/gambar-tulisan-galau-sedih-buat-dp-bbm.html
http://ikatakataromantis.blogspot.com/2014/09/kata-kata-motivasi-bijak-putus-cinta.html
http://ikatakataromantis.blogspot.com/2014/09/kata-kata-semangat-buat-patah-hati-karena-cinta.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-kata-kata-indah-buat-pacar-tercinta.html
http://ikatakataromantis.blogspot.com/

http://ikatakataromantis.blogspot.com/2014/09/gambar-kata-kata-sayang-tulus-sama-pacar.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-galau-lelah-capek-jenuh.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-keren-gaul-gokil.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-foto-dp-bbm-sakit-hati-karena-cinta.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-lelah-bosan-menunggu.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-kata-kata-marah-kecewa-kesal-buat-pacar.html

http://ikatakataromantis.blogspot.com/2014/09/kata-kata-mutiara-cinta-buat-mantan-kekasih.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-menghina-menyinggung-mantan.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-buat-orang-sirik-iri-dengki.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-sindiran-mantan-munafik.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-lucu-gokil-buat-mantan.html
http://ikatakataromantis.blogspot.com/2014/09/gambar-dp-bbm-kata-kata-sindiran-buat-pacar-egois.html
1417349094