SQL injection on ██████████ via 'where' parameter
The 'where' parameter of an ArcGIS Server query endpoint was vulnerable to SQL injection. An attacker could supply a true condition to retrieve all database records, or a false condition to get an empty response, confirming the injection.
- Triaged in 12 hours
- Fixed in 15 days
- Disclosed after 39 days
An sql injection vulnerability is produced on 'where' parameter of ArcGIS server allows to retreive db content
PoC
1- Go to https://█████/arcgis/rest/services/Data/ANC_External/MapServer/1/query?where=&text=&objectIds=&time=&timeRelation=esriTimeRelationOverlaps&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&returnExtentOnly=false&sqlFormat=none&datumTransformation=¶meterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&f=html, this will show a web form.
2- On where field, insert the following query : 1=1, the query is a 1=1 that is true, so it will show all record content of the DB.
██████████
███████
3- So if you inserts 1=0 on where column, the server response will be empty and didn't show any info.
NOTE: i will attach the sql injection vulnerability confirmed by esri support: https://support.esri.com/en-us/knowledge-base/arcgis-10-1-sp1-for-server-contains-a-blind-sql-injecti-000011683
Impact
An attacker is able to exploit sql injection via arcGIS server
System Host(s)
██████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
1- Go to https://██████/arcgis/rest/services/Data/ANC_External/MapServer/1/query?where=&text=&objectIds=&time=&timeRelation=esriTimeRelationOverlaps&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&returnExtentOnly=false&sqlFormat=none&datumTransformation=¶meterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&f=html, this will show a web form.
2- On where field, insert the following query : 1=1, the query is a 1=1 that is true, so it will show all record content of the DB.
3- So if you inserts 1=0 on where column, the server response will be empty and didn't show any info.
Suggested Mitigation/Remediation Actions
Esri released an update to ArcGIS Server 10.1 Service Pack 1. If you cannot patch, please consider the following workarounds.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the 'where' parameter was concatenated into a SQL query without proper sanitisation or parameterisation.
Impact
An attacker could exploit SQL injection through the ArcGIS server to retrieve database content.
What the attacker needed
Access to the ArcGIS query endpoint
The fix
Esri released an update to ArcGIS Server 10.1 Service Pack 1; if patching is not possible, workarounds should be considered.
How it was found
- Open the ArcGIS MapServer query URL with the 'where' parameter empty to see a web form.
- Enter a true condition in the 'where' field to make the server return all database records.
- Enter a false condition in the 'where' field to get an empty response, confirming the injection.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
SQL injection is when a website puts user input directly into a database command without checking it. Here, the 'where' field of a map query was passed to the database, so typing a condition that is always true made the server return every record. This let someone read data they should not see.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.