exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Ruby Gem kelredd-pruview 0.3.8 Command Injection

Ruby Gem kelredd-pruview 0.3.8 Command Injection
Posted Apr 12, 2013
Authored by Larry W. Cashdollar

Ruby Gem kelredd-pruview version 0.3.8 suffers from a remote command injection vulnerability.

tags | exploit, remote, ruby
SHA-256 | dd1b24534bc513df316ed360fb139f228b8988566fe55fe24f004ec934cc9308

Ruby Gem kelredd-pruview 0.3.8 Command Injection

Change Mirror Download
Remote command injection in Ruby Gem kelredd-pruview 0.3.8

Larry W. Cashdollar
4/4/2013
@_larry0

Description: "A gem to ease generating image previews (thumbnails) of various files."

https://rubygems.org/gems/kelredd-pruview

Remote commands can be executed if the file name contains shell meta characters.

./kelredd-pruview-0.3.0/lib/pruview/document.rb

In the following code snippet, we see the user input isn't sanitized for shell metacharacters. A malicious file with special characters in the filename could be used to execute commands as the local user.

69 run_system_command("convert -format jpg \"{source}[0]\" \"{@tempfile.path}\"", "Error processing postscript document")
85 colorspace = run_system_command("identify #{GLOBAL_CMD_ARGS} -format \"%r\" #{image.path}", "Error reading document colorspace")

function run_system_comand() passes user supplied input to the command line.

141 def run_system_command(command, error_message)
142 output = `{command}`
143 raise "{error_message}: error given {$?}\n{output}" if $? != 0
144 return output
145 end

In kelredd-pruview-0.3.0/lib/pruview/video.rb: Also the video encoding and scaling features are vulnerable as well:

27 run("#{FLVTOOL} -U #{target}", "Unable to add meta-data for #{target}.")

51 run(build_command(@source, target, width, height, get_info(info_yml), scale_static), "Una ble to convert #{@source} to #{target}.")

Run is defined as:

140 def run(command, error_message = "Unknown error.")
141 raise "Ffmpeg error: " + error_message + " - command: '#{command}'" if !system(command)
142 end

User controlled data is being sent to the command line with out any shell meta charatcers being escaped.

In kelredd-pruview-0.3.0/lib/pruview/video_image.rb:

13 run(build_command(source, "-ss 00:00:#{duration * 0.1}", 'mjpeg', target), "Unable to get preview image for #{target}")

30 def self.build_command(source, time_str, format, target) 31 command = %Q{#{Video::FFMPEG} -i "#{source}"} 32 command += " #{time_str}" 33 command += " -f #{format}" if !format.empty? 34 command += " -an -y #{target}" 35 end

where function run() is defined as:

37 def self.run(command, error_message = "Unknown error.")
38 raise "Ffmpeg error: " + error_message + " - command: '#{command}'" if !system(command)
39 end

In line 38 user supplied data is passed to the command line.
This vulnerability doesn't have a CVE assigned yet.

http://vapid.dhs.org/advisories/kelredd-pruview-cmd-inject.html
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close