Secure site ?

That one clearly sucks. It blocks any slash, dot, comma, and so forth. Just clean ', " and \.

No, it strips out anything but a-z, A-Z, and 0-9. And I find it laughable you're suggesting as I told you, despite still promoting your "safe" anti-SQL function.

Code:
function sanitize_data ( $sql ) {
  return preg_replace( "/[^a-zA-Z0-9 ]/i", "", $sql );
}
~Iceman

Considering this is what I posted earlier, I'd say it's perfectly safe - as long as sanitize_data() is called for all data being accepted via $_GET and $_POST, and you should be clean thus far. e.g.:

Code:
$user = $_GET['user'];

..would be..

Code:
$user = sanitize_data ( $_GET['user'] );

Don't forget to include the sanitize_data function in whatever script is calling it!

anti-sql injection

"anti-sql injection" isn't the key to solving all possible security vulnerabilities - what about XSS? What if another vulnerability in the MServer daemon resulted in root (e.g.: Unchecked buffer - possibility for a buffer overflow).

Not to mention, any other vulnerable service could be at fault.

OP, there's too many possible areas that could be gone wrong - start by fixing the forementioned.
 
Upvote 0
No, it strips out anything but a-z, A-Z, and 0-9. And I find it laughable you're suggesting as I told you, despite still promoting your "safe" anti-SQL function.



Considering this is what I posted earlier, I'd say it's perfectly safe - as long as sanitize_data() is called for all data being accepted via $_GET and $_POST, and you should be clean thus far. e.g.:

Code:
$user = $_GET['user'];
..would be..

Code:
$user = sanitize_data ( $_GET['user'] );
Don't forget to include the sanitize_data function in whatever script is calling it!



"anti-sql injection" isn't the key to solving all possible security vulnerabilities - what about XSS? What if another vulnerability in the MServer daemon resulted in root (e.g.: Unchecked buffer - possibility for a buffer overflow).

Not to mention, any other vulnerable service could be at fault.

OP, there's too many possible areas that could be gone wrong - start by fixing the forementioned.
Can't you test your site against SQL/XSS injections via the firefox extensions SQL Inject Me and XSS Me?
I have to ask cause I'm not sure if they actually are able to detect if they are vulnerable since all of mine comes up as all green (green means its protected)
 
Upvote 0
Can't you test your site against SQL/XSS injections via the firefox extensions SQL Inject Me and XSS Me?
I have to ask cause I'm not sure if they actually are able to detect if they are vulnerable since all of mine comes up as all green (green means its protected)

I wouldn't rely on third-party browser plugins to validate all scripts for potential sanitization flaws. Rather, I would just ensure proper tags and other HTML entities are escaped, as are possible SQL character controls (Space, single/double quotes, and backslashes).

Anyways, as I stated, as long as a-z, A-Z, and 0-9 characters are the only accepted form of data, virtually nothing can cause a problem. Now, granted, formatting characters may be needed, which is why you escape everything (As stated, HTML entities, and escape SQL char. controls).

google is your friend

Way to be completely void of help.
 
Upvote 0
No, it strips out anything but a-z, A-Z, and 0-9. And I find it laughable you're suggesting as I told you, despite still promoting your "safe" anti-SQL function.



Considering this is what I posted earlier, I'd say it's perfectly safe - as long as sanitize_data() is called for all data being accepted via $_GET and $_POST, and you should be clean thus far. e.g.:

Code:
$user = $_GET['user'];
..would be..

Code:
$user = sanitize_data ( $_GET['user'] );
Don't forget to include the sanitize_data function in whatever script is calling it!



"anti-sql injection" isn't the key to solving all possible security vulnerabilities - what about XSS? What if another vulnerability in the MServer daemon resulted in root (e.g.: Unchecked buffer - possibility for a buffer overflow).

Not to mention, any other vulnerable service could be at fault.

OP, there's too many possible areas that could be gone wrong - start by fixing the forementioned.

Lol, what you told me? I wrote an anti sql-injection function almost 2 year ago which does strip those 3 things. Including some functions to prevent XSS.

Shush shush.
 
Upvote 0
Lol, what you told me? I wrote an anti sql-injection function almost 2 year ago which does strip those 3 things. Including some functions to prevent XSS.

Shush shush.

Your release stripped that and much more:

http://forum.ragezone.com/f245/my-way-of-protecting-from-sql-injections-570599/?#post4993113

Code:
function antisql($sql) {
    $sql = preg_replace(sql_regcase("(select|union|0x|cast|exec|varchar|insert into|delete from|update account|update login|update character|ugradeid|drop table|show tables)"),"",$sql);
    $sql = trim($sql);
    $sql = strip_tags($sql);
    $sql = addslashes($sql);
    return $sql;
}

Let's see - words such as "select" and "varchar" are automatically removed, without notifying anyone - as I mentioned, if my password were say, "select1", then my password would be "1" without the end user being notified.

Rather than remove excess spaces and tags, it's easier to not permit those symbols.

Also, your add slashes will cause an annoyance if magic_quotes_gpc is on, as detailed in . (e.g.: \' would turn to \\\', inserting a backslash before the quote).

So no, that s most certainly not what you were doing.
 
Upvote 0
Back