[Mapbender-commits] r7087 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Nov 3 11:30:26 EDT 2010
Author: apour
Date: 2010-11-03 08:30:26 -0700 (Wed, 03 Nov 2010)
New Revision: 7087
Modified:
trunk/mapbender/http/php/mod_saveWKT.php
Log:
Fixed possible SQL injection vulnerability
Modified: trunk/mapbender/http/php/mod_saveWKT.php
===================================================================
--- trunk/mapbender/http/php/mod_saveWKT.php 2010-11-03 14:20:26 UTC (rev 7086)
+++ trunk/mapbender/http/php/mod_saveWKT.php 2010-11-03 15:30:26 UTC (rev 7087)
@@ -96,10 +96,11 @@
$con = pg_connect ($con_string) or die ("Error while connecting database DBname");
/*
- * @security_patch sqli open
+ * @security_patch sqli done
*/
+
$sql = "SELECT f_table_name, f_geometry_column,type,srid FROM geometry_columns
- where f_table_name like '$tblmb'"; //pick only certain tables (see above)
+ where f_table_name like '".addslashes($tblmb)."'"; //pick only certain tables (see above)
//$sql = "SELECT f_table_name, f_geometry_column,type,srid FROM geometry_columns";
$res = pg_query($con,$sql);
$cnt = 0;
@@ -122,10 +123,10 @@
echo "</select>";
/*
- * @security_patch sqli open
+ * @security_patch sqli done
*/
if(isset($tablenames)){
- $sql = "SELECT * from ".$tablenames." limit 1";
+ $sql = "SELECT * from ".addslashes($tablenames)." limit 1";
$res = pg_query($con,$sql);
$num = pg_num_fields($res);
More information about the Mapbender_commits
mailing list