mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 05:14:07 +00:00
properly escape class parameter
The class parameter was used as is, allowing for potential SQL injection via the API. Thanks to @bladeswords for finding this.
This commit is contained in:
@@ -37,7 +37,7 @@ if ($sOsmType && $iOsmId > 0) {
|
|||||||
);
|
);
|
||||||
// osm_type and osm_id are not unique enough
|
// osm_type and osm_id are not unique enough
|
||||||
if ($sClass) {
|
if ($sClass) {
|
||||||
$sSQL .= " AND class='".$sClass."'";
|
$sSQL .= " AND class='".pg_escape_string($sClass)."'";
|
||||||
}
|
}
|
||||||
$sSQL .= ' ORDER BY class ASC';
|
$sSQL .= ' ORDER BY class ASC';
|
||||||
$sPlaceId = chksql($oDB->getOne($sSQL));
|
$sPlaceId = chksql($oDB->getOne($sSQL));
|
||||||
|
|||||||
Reference in New Issue
Block a user