Recent Articles

Someone AJAXified mytop!
Check this out. Someone has built and AJAX powered version of mytop, the little console based MySQL monitoring tool I wrote years ago.

SQL Injection Vulnerability
A vulnerability was discovered in the ADOdb and can be exploited by hackers doing SQL injection attacks. The vulnerability only works on the PostgreSQL users. Andy Staudacher discovered the vulnerability and Secunia reported the issue as moderately critical on Tuesday.

Microsoft SQL 2000 Disaster Recovery with SANRAD V-Switch - Planning Guide

Designing a disaster recovery system requires planning and consideration of the available options that will best fit your company's needs, SLA and budget.

MS SQL / MySQL - A Case Study

The release of Microsoft SQL Server 2005 on November 7th 2005 created a buzz around the office for IT professionals.

Taking Advantage of Open Source PHP MySQL Applications

One obvious solution is to approach a software development company and obtain a custom built product. However to take this approach one needs to first know what features and functionality is desired.


Free Software Archive:
Enterprise and Home Networking Downloads

WebProWorld Dev Forum

CSV to mySQL
I have a CSV file I spun out from MS Excel that I would like to put in a mySQL table. I use two hosts that have different versions of phpMyAdmin and one host does not have the CSV upload option.

Making Sure mySQL is optimized correctly
Does anyone know if there is a service that will insure that all the mySQL services on my server are running correctly and that things run as fast as they could be?

How to copy an existing table?
Ok let me begin by saying I am a complete newbie when it comes to databases. They scare me :| Well not really but they just confuse me more than anything.


02.14.06


Protecting Against SQL Injection With PHP And MYSQL

By Mike Morton

Security is important for all developers, but more so when combining two of the most popular Database and Web Programming technologies.

With more and more programmers creating dynamic, database driven websites, the proliferation of PHP and MYSQL is reaching critical mass proportions. With that however, comes the added "bonus" of many different security holes being opened on hosted boxes everywhere. With the current atmosphere of fear and mistrust when it comes to the security of the Internet right now, as programmers, we should be doing everything that we can to build safe, secure applications.

How can we do that? Well, the first step is education. Knowing the risks you are creating with your programming, and mitigating those risks with good programming practices. The most important part of educating yourself is understanding the different vulnerabilities that you can create with your programs. By far the most dangerous is SQL injection.

What is SQL injection? Simply put, it is the ability to inject and run arbitrary SQL code without having access to the database by traditional means. In lay terms, a user can access information or gain unauthorized access to the information contained in your database. This can be particularity troubling if you keep information such as customer contacts, credit cards, or other personal or critical information in your database.

What does SQL injection look like? Imagine the following SQL query:

select * from customer_info where name='$_POST[username]' and pass='$_POST[password]'

If someone wanted to try and gain access to the area you are securing with this query, they could simply enter as their password: ' or '1'='1', resulting in the following query being executed:

select * from customer_info where name='someusername' and pass='' or '1'='1'

If you evaluate that, then it will select everything from that table, since the OR '1'='1' will always be true, resulting in ALL the records being selected.

Protecting against this should take the form of several steps, but the first and foremost is that ANY and ALL input that is going to be used in an SQL query should first be filtered for content. This can be done for each variable individually, but that can get tedious. Instead, when I am processing a form of information that will end up in a database of some sort, I have a function that filters data based on what I want to do with it.

Because I only trust data that I have filtered exclusively for the uses I have in the script, the first thing that I do for all my scripts is filter out any slashes that may be present. I do this specifically because of a couple of php.ini settings that may be turned on: magic_quotes_gpc, and magic_quotes_runtime. These functions automatically escape quotes, which is generally a good thing, but can make a programmer lazy. This is especially true if you are developing an application for widespread use on different systems that may or may not have this setting active.

I prefer to control my own data filtering, so the first thing I do is remove any slashes that may have automatically been added:

Read the rest of the article.

Write 10,000 lines of code in 10 minutes!
Iron Speed Designer – Free Evaluation

About the Author:
Mike Morton has been developing web applications with PHP and MYSQL for more than 6 years, and is the author of Real World PHP Programming: The Basics which can be found at http://www.vtccanada.com

About SQLproNews
SQLproNews is a collection of up to date tutorials and insightful articles designed to help SQL users of any skill level implement successful SQL systems and practices. SQL Strategies and Tactics for Business

SQLproNews is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
SQLproNews.com WirelessProNews.com
CProgrammingTrends.com SysAdminNews.com




-- SQLProNews is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2006 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

advertising info | news headlines | free newsletters | comments/feedback | submit article



SQL Strategies and Tactics for Business SQLproNews News Archives About Us Feedback SQLproNews Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact