Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERB remote code execution via inline render #262

Open
tgoddard opened this issue Jan 14, 2016 · 2 comments
Open

ERB remote code execution via inline render #262

tgoddard opened this issue Jan 14, 2016 · 2 comments

Comments

@tgoddard
Copy link

If a target page to be cloned returns ERB code, I believe the calls to:

render :inline => @clone.page

https://github.com/pentestgeek/phishing-frenzy/blob/master/app/views/clones/show.html.erb#L15
https://github.com/pentestgeek/phishing-frenzy/blob/master/app/views/clones/preview.html.erb

will execute that embedded code. It is not safe to pass untrusted input to an inline render.

@pruby
Copy link

pruby commented Jan 14, 2016

Same person, different Github account. Have a POC for this one. The page to clone is:

http://phishing-frenzy-poc.s3-website-us-east-1.amazonaws.com/

It's a copy of the LinkedIn template from the demo templates, but with an additional script at the end:

<script type="text/html+erb">
<%= `whoami` %>
<%= `cat /etc/passwd` %>
</script>

Wrapping this in script tags nicely avoids any issues with the HTML parser getting confused by the <%= ... %> pseudo-tags, and ensures browsers will ignore it. When the site is cloned, previewing or viewing the resulting clone will execute the stored page as an ERB template, evaluating the code above:

phishing-frenzy-poc

@zeknox
Copy link
Member

zeknox commented Jan 17, 2016

Thanks for the bug report. Will look into a compensating control as time permits.

@zeknox zeknox added the bug label Jan 17, 2016
@zeknox zeknox added the Medium label Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants