WalterVictor.com - Articles

Articles About Whatever...



Sql Injection Prevention Guidelines For Developers

View PDF | Printer-Friendly View

One of the biggest flaws in the PHP language is the fact that it allows for web developers to make very big mistakes in regards to security. One example of this is through SQL injections- an exploit that malicious users take advantage of when web developers don't accurately safeguard their application.

It's rather frightening to think that a statement such as "b' OR 'b'='b'" can render one's security useless. But this is indeed true, and is what we call an SQL injection. SQL injections have been the most popular way to "hack" a website in recent years. As long as the input can be validated before it is passed along to the SQL query, we can ensure that nothing bad will go wrong.

PHP developers have used the magic quotes function to help safeguard against SQL injections. Magic quotes are no longer in use, however, since they were more of a hassle than anything. It is recommended that if a developer has used magic quotes, he or she should remove them since they are no longer supported as of PHP 6. Thus, we need to look elsewhere for a security solution.

The common way to protect against an SQL injection attack is to simply use the mysql_real_escape_string() function that PHP has support for. When passing POST values through this function, the result becomes an escaped string that can't be used to manipulate an SQL query- perfect for our situation.

Oddly enough, we can create a greater sense of security through creating more user accounts via our SQL program. We can assign different types of access to different users, which would make it quite hard for attackers to get full access to our database should they find a hole somewhere. Having a user for creating, deleting, and inserting data is a good idea to help split up responsibility.

It should be noted that programs and web applications that stop SQL injections should not be obtained- since they commonly cost quite a bit of money. As long as webmasters take precautions with what they create, there should be no reason to spend hundreds of dollars on software that only makes use of escape characters and formatting data correctly. This type of application is created to con webmasters into buying something they don't need- so dont fall victim to them!

Closing Comments

SQL injections are never a pretty sight. They ruin databases, can be a security risk to users of the website, and they even can destroy entire websites. Thus, it's good to either hire developers that know what they are doing or to brush up on some security topics by one's self. Doing so can save a world of hurt for a webmaster, as well as quite a bit of money from not having to buy mock applications that claim to do the "hard work" for webmasters. In the end, it's recommended developers pick up a good book or visit their favorite PHP security websites to stay informed.

About: Learn more on SQL Injection Query and SQL Injection String.

Article Source: WalterVictor.com - Articles


More articles in this Category


1. SQL Injection Prevention Guidelines For Developers


Articles Section Menu

Articles Home
Login
Register
Submit Article
Latest Articles
Search
Terms of Service
Privacy Statement

Links

Free Poser Tubes
Manual Directory Submission
Directory Network
Free Web Directory
Free Directory List
3D Runtime

Site Stats

Categories: 400
Articles: 1515
Authors: 653
3 user(s) online

Recommended Hosting

HostGator Web Hosting

Categories



Top Authors

1. KimandCharlesPetty (81)
2. CharlesandKimPetty (39)
3. CharlieReese (38)
4. GeorgePurdy (34)
5. ThomasGriffin (26)
6. AliceSy (22)
7. KirtChristensen (22)
8. KayleyKenzie (17)