Advertisement
Mayk0

#; Ruby Gem Karteek Docsplit 0.5.4 Command Injection Vulnera

Apr 10th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1.  
  2. Full title: Ruby Gem Karteek Docsplit 0.5.4 Command Injection Vulnerability
  3. Date add: 2013-04-11
  4. Category: web applications
  5. Platform: windows
  6.  
  7. Description:
  8. Ruby Gem Karteek versión 0.5.4 Docsplit no desinfectar suministrado por el usuario de entrada. Si un usuario es engañado para extraer un archivo con caracteres de shell en el nombre, el código se puede ejecutar de forma remota.
  9. --------------------------------------------------------------------------
  10.  
  11. Remote Command Injection Ruby Gem Karteek Docsplit 0.5.4
  12.  
  13. Larry W. Cashdollar
  14.  
  15. Entrada proporcionada por el usuario no está desinfectado contra metacaracteres de shell y se alimenta directamente a la cáscara. Si el usuario es engañado para extraer un archivo con caracteres de shell en el nombre de código se puede ejecutar remotamente.
  16.  
  17. https://rubygems.org/gems/karteek-docsplit
  18.  
  19. ./karteek-docsplit-0.5.4/lib/docsplit/text_extractor.rb
  20.  
  21. def extract_from_ocr(pdf, pages)
  22. tempdir = Dir.mktmpdir
  23. base_path = File.join(@output, @pdf_name)
  24. if pages
  25. pages.each do |page|
  26. tiff = "{tempdir}/{@pdf_name}{page}.tif"
  27. file = "{basepath}{page}"
  28. run "MAGICKTMPDIR={tempdir} OMP_NUM_THREADS=2 gm convert -despeckle +adjoin #{MEMORY_ARGS} #{OCR_FLAGS} {pdf}[{page - 1}] #{tiff} 2>&1"
  29. run "tesseract #{tiff} {file} -l eng 2>&1"
  30. clean_text(file + '.txt') if @clean_ocr
  31. FileUtils.remove_entry_secure tiff
  32. end
  33. else
  34. tiff = "{tempdir}/{@pdf_name}.tif"
  35. run "MAGICK_TMPDIR={tempdir} OMP_NUM_THREADS=2 gm convert -despeckle #{MEMORY_ARGS} #{OCR_FLAGS} #{pdf} #{tiff} 2>&1"
  36. run "tesseract #{tiff} #{base_path} -l eng 2>&1"
  37. clean_text(base_path + '.txt') if @clean_ocr
  38. end
  39.  
  40. Run is defined as:
  41.  
  42. def run(command)
  43. result = `#{command}`
  44. raise ExtractionFailed, result if $? != 0
  45. result
  46. end
  47.  
  48. Esta vulnerabilidad se le ha asignado CVE-2013-1933.
  49.  
  50. http://vapid.dhs.org/advisories/karteek-docsplit-cmd-inject.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement