TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Remote Code Execution in Elasticsearch – CVE-2015-1427

90 pointsby biafraabout 10 years ago

11 comments

stygiansonicabout 10 years ago
Great article.<p><i>One feature of the _search API endpoint is to allow users to submit Groovy code in the search query itself. The server will then execute the code in a sandboxed environment, returning the result to the user. This way, the elasticsearch code can be used to execute… more code.</i><p>Quite a dangerous feature indeed. Thankfully, according to the documentation[0], this feature is disabled by default since v1.4.3. (Hindsight is 20&#x2F;20, but this probably should have been the case from the get-go)<p>0. <a href="https:&#x2F;&#x2F;www.elastic.co&#x2F;guide&#x2F;en&#x2F;elasticsearch&#x2F;reference&#x2F;current&#x2F;modules-scripting.html#modules-scripting" rel="nofollow">https:&#x2F;&#x2F;www.elastic.co&#x2F;guide&#x2F;en&#x2F;elasticsearch&#x2F;reference&#x2F;curr...</a>
jwcruxabout 10 years ago
Hey there! Author here - thanks for posting this!<p>In response to this, I made an open-source honeypot (in Go!) called Elastichoney. I recently released every single log I collected in nice JSON form:<p><a href="http:&#x2F;&#x2F;jordan-wright.github.io&#x2F;blog&#x2F;2015&#x2F;05&#x2F;11&#x2F;60-days-of-watching-hackers-attack-elasticsearch&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jordan-wright.github.io&#x2F;blog&#x2F;2015&#x2F;05&#x2F;11&#x2F;60-days-of-wa...</a><p>Let me know if you have any questions!
skuaabout 10 years ago
This is old. There are bots that scan servers for ES and try to exploit this vulnerability. Our servers were hacked through this hole before we upgraded to a newer version of ES. Now we don&#x27;t allow remote access to ES directly. We use a proxy script that parses HTTP requests from users, interacts with local ES instance and serves users with transformed data.
评论 #9552452 未加载
评论 #9554783 未加载
agnokapatheticabout 10 years ago
I created an Nmap script to find this on your own networks:<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;jwpari&#x2F;3369a537b422ecfa23f5" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;jwpari&#x2F;3369a537b422ecfa23f5</a><p>Use with:<p><pre><code> nmap -T5 -p 9200 -Pn --script=+elasticsearch-cve-2015-1427 10.0.0.0&#x2F;8</code></pre>
callmeedabout 10 years ago
I had a Digital Ocean VPS shut down because of the previous exploit (mentioned in the article). I was just testing an open-source project of my own and did a standard&#x2F;stock install.<p>I don&#x27;t really understand why a project like this would default to having such vulnerable settings turned ON.
fiveoakabout 10 years ago
FYI, it looks like this was released ~3 months ago on Feb 17th of this year: <a href="https:&#x2F;&#x2F;web.nvd.nist.gov&#x2F;view&#x2F;vuln&#x2F;detail?vulnId=CVE-2015-1427" rel="nofollow">https:&#x2F;&#x2F;web.nvd.nist.gov&#x2F;view&#x2F;vuln&#x2F;detail?vulnId=CVE-2015-14...</a>
AgentMEabout 10 years ago
This vulnerability sounds similar to the issue I described here: <a href="https:&#x2F;&#x2F;crashcoherency.net&#x2F;posts&#x2F;perils_of_source_based_sandboxing" rel="nofollow">https:&#x2F;&#x2F;crashcoherency.net&#x2F;posts&#x2F;perils_of_source_based_sand...</a><p>tl;dr: If you&#x27;re doing sandboxing by blacklisting specific strings in your input, you&#x27;re doing it wrong. Java actually has good sandboxing capabilities. Use them!
vorgabout 10 years ago
The author of that sandboxing feature of Groovy recently wrote a blog article on improving sandboxing of Groovy scripts that are executed at runtime, see <a href="http:&#x2F;&#x2F;melix.github.io&#x2F;blog&#x2F;2015&#x2F;03&#x2F;sandboxing.html" rel="nofollow">http:&#x2F;&#x2F;melix.github.io&#x2F;blog&#x2F;2015&#x2F;03&#x2F;sandboxing.html</a><p>His conclusion says that using Groovy for scripting on the JVM comes at the price of security, and that the customizers in the Groovy distribution and those in the wild aren&#x27;t enough to guarantee security of execution of scripts in the general case, but if you loosen some of the dynamic features of Groovy, you can work around those limitations through type checking extensions, though that solution <i>isn&#x27;t available</i> in Groovy&#x27;s core distro. He adds he&#x27;ll have less time to work on Groovy, probably refering to how he and the other full-timer building Groovy had their funding pulled beginning the following week (end March 2015). There&#x27;s now noone working fulltime building Groovy.
MichaelGGabout 10 years ago
If you have Elasticsearch open to arbitrary inputs, isn&#x27;t it a given anyone can mess you up?
616cabout 10 years ago
I have always followed CouchDB from a distance, so I am curious, has anyone been able to pull the same crap writing Erlang or Javascript? This is more relevant to the latter bc of the sandbox, but this NoSQL architecture decision sounds very familiar.<p>I swore I read something about attempting to break the JS sandbox but found nothing with my weak Googlefu.
评论 #9554026 未加载
评论 #9553435 未加载
timrabout 10 years ago
Don&#x27;t expose elasticsearch to the public. You wouldn&#x27;t expose your database to the public (or would you?), and this isn&#x27;t any different.<p>At the very least, limit the set of IPs that can connect to your server.