mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 02:58:13 +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
|
||||
if ($sClass) {
|
||||
$sSQL .= " AND class='".$sClass."'";
|
||||
$sSQL .= " AND class='".pg_escape_string($sClass)."'";
|
||||
}
|
||||
$sSQL .= ' ORDER BY class ASC';
|
||||
$sPlaceId = chksql($oDB->getOne($sSQL));
|
||||
|
||||
Reference in New Issue
Block a user