Jump to content
osirium

Using open-uri? Check your code - you're playing with fire!

Recommended Posts

Using open-uri? Check your code - you're playing with fire!

 

"

Ruby’s OpenURI is an easy-to-use wrapper for net/http, net/https and net/ftp. As far as I know it’s the most popular way to read URL content, make a GET request or download a file.

require "open-uri" internally patches Kernel.open leaving you one step away from remote code execution and reading local files! Here are some examples:

open(params[:url]) is remote code execution for url=|ls Didn’t you know if it starts with a pipe Ruby executes it?! Ouch.

"

 

Source: https://sakurity.com/blog/2015/02/28/openuri.html

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...