MySQL avoid unauthorized reading and SQL Injection vulnerabilities in PHP

by on January 6, 2007 · 0 comments· LAST UPDATED January 6, 2007

in , ,

The LOAD DATA statement can load a file that is located on the server host, or it can load a file that is located on the client host when the LOCAL keyword is specified.

In a Web server environment where the clients are connecting from a Web server, a user could use LOAD DATA LOCAL to read any files that the Web server process has read access to (assuming that a user could run any command against the SQL server). In this environment, the client with respect to the MySQL server actually is the Web server, not the remote program being run by the user who connects to the Web server. Attacker can take advantage of this SQL injection via PHP/perl etc.

Open my.cnf file:
# vi my.cnf
Append following line [mysqld] section
local-infile=0

Save and restart MySQL server:
# /etc/init.d/mysql restart

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: