[www.zomato.com] Abusing LocalParams (city) to Inject SOLR query
The city parameter in a search API was passed unsanitised into a Solr query, allowing an attacker to inject Solr local parameters. This could let an attacker modify or view all data in the Solr cluster, or potentially achieve remote code execution.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 11 days
- Paid in 11 days
- Disclosed after 4 months
Hi Team! ;)
I Found an limited SOLR Injection by Abusing LocalParams (city) in /webapi/searchapi.php, Therefore Please respect my decision to mark this report as Medium instead of High (Based on the fact the code is Vulnerable even if it's hard to exploit).
- Request (adding single Backslash):
GET /webapi/searchapi.php?city=51\ HTTP/1.1
Host: www.zomato.com
Connection: close
Accept: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/80.0.3987.149 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: en
- Response:
HTTP/1.1 500 Internal Server Error
- Request (adding double Backslashes):
GET /webapi/searchapi.php?city=51\\ HTTP/1.1
Host: www.zomato.com
Connection: close
Accept: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/80.0.3987.149 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: en
- Response:
HTTP/1.1 200 OK
As you can see - adding single Backslash \ will break the SOLR query but by adding double Backslashes \\ (closing it) will execute the SOLR query properly, Therefore this isn't an "Exception" - it's a valid SOLR Injection!!
- Source: https://portswigger.net/research/backslash-powered-scanning-hunting-unknown-vulnerability-classes
Impact
"By exploiting 'Solr (local) Parameters Injection,' it is possible to at least modify or view all the data within the Solr cluster, or even exploit known vulnerabilities to achieve remote code execution."
- Source: "https://www.veracode.com/blog/security-news/new-research-apache-solr-parameter-injection"
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 city parameter was concatenated into a Solr query without escaping or validation, allowing Solr local parameters to be injected.
Impact
By exploiting the injection, an attacker could at least modify or view all data within the Solr cluster, or even exploit known vulnerabilities to achieve remote code execution; the report notes the injection is limited and hard to exploit.
What the attacker needed
None
How it was found
- Send a request to the search API with the city parameter set to a value ending in a single backslash.
- Observe that the server returns a 500 Internal Server Error.
- Send the same request with the city parameter ending in two backslashes.
- Observe that the server returns a 200 OK response.
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.
Solr is a search engine that many websites use to find and return results. The report shows that a value taken from the URL was placed directly into a Solr query without cleaning it, so special characters could change the query. The author only demonstrated that a single backslash caused an error while two backslashes did not, which suggests the input reaches the query, but full exploitation was not shown.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.