SQL Injection

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

p3dro.sola
Posts: 25
Joined: 22 Dec 2009, 17:00

SQL Injection

Postby p3dro.sola » 10 Sep 2010, 01:52

Hi, i was wondering what sort of protection (if any) smartfox server has against sql injection attacks on serverside extentions.

For example, let's say i have a function in a serverside extentsion that logs moves from a game to a MySQL database. So everytime a player makes a move this code gets run (Actionscript)

Code: Select all

dbase.executeCommand("UPDATE table SET log = CONCAT(log, '"+params.log+"') WHERE match_id = '"+params.match_id+"';");


That will work fine, however if a user were to modify the parameters being sent to SFS then they would be able to perform an SQL Injection.

What would solve this is the equivalent of mysql_real_escape_string() in PHP.

Any ideas?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 10 Sep 2010, 04:02

_server.escapeQuotes(...)
Smartfox's forum is my daily newspaper.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 46 guests