We have developed a search engine (simple search, no login required) where users can search details in the database (Apache Lucene) by entering their name (et. al.), then clicking the search button. The search invokes a asynchronous HTTP GET request (an AJAX call on the same domain) to the server which in turn calls the search engine. The response is a JSON object.
I have disabled the "Allow cross origin access" policy on the server. It seems that an attacker is continuously hitting the search server programmatically to download the data. We know this because the number of hits on the search server is much larger than the one shown by Google Analytics for the index page.
Other developers have suggested the following:
- Create a session for the search.
- Put captcha on the index page and verify it on the server.
- They suggest that someone can still programmatically make GET requests with parameters and hence perform a search, explained by the huge difference between page visits and visits to the index page.
This confuses me:
- Whether captcha is really required for an application which only fetches information, apart from making the usability worse?
- If I have disabled "cross origin access", how can someone programmatically invoke calls to the server?
Are there better ways to approach this (especially captcha)?