Webmaster Forum

Go Back   Webmaster Forum > Webmaster Discussion Forums > Web Design and Graphics

Notices

Reply
 
LinkBack Thread Tools Display Modes
Old 05-17-2008, 04:00 PM   #1
New Member
 
Join Date: May 2008
Posts: 14
Credits: 1
Sarunas is on a distinguished road
Default Security Alert

It has recently been discovered that date and numeric field types under SQL *may* be prone to a particular type of injection attack.

Up till now, normally we correctly escaped all string fields, however it may be that more stringent checking will be required on the standard date and numeric field types. This will mean correct range checking and date validation however you should all being done this anyway.

It's not clear as to exactly which SQL databases are affected by this issue, however the advice is check everything, twice, then do it again just to make sure.

I recommend using a time stamp in an integer field. It might not be as fast as using a date field, and the value stored won't be "human readable" but it's super simple to ensure there is absolutely no possibility of injections.

Again, this is my personal recommendation coming from a person who is largely self taught, and has no specific credentials given by MySQL in the form of diplomas, degrees, or anything like that, but has studied hard and learned a lot.

Something like;

Code:
$time = mysql_query('select unix_timestamp()');
list($time1) = mysql_fetch_array($time);

echo dayz($time1) . "<hr>" . dayz(time());

dayz() is a custom function that uses the date() function to return a formated time.

The web server is in new zealand time, and the php code has a time zone set to USA eastern time.

Both times came out the same. Considering the test, I dun see any problem using the mysql unix_timestamp() function vs inserting a php generated time()
Sarunas is offline   Reply With Quote
Old 05-21-2008, 01:19 PM   #2
Counting 10,000 :D
 
Swastik's Avatar
 
Join Date: Mar 2008
Location: India
Posts: 494
Credits: 0
Swastik has a spectacular aura aboutSwastik has a spectacular aura about
Send a message via MSN to Swastik Send a message via Yahoo to Swastik
Default

Nice post.
Thanks

++ reps.
Swastik is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Review my security forum joshchan214 Website Reviews 9 04-19-2008 04:26 PM



vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios