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

webui security bug #128

Open
arcusfelis opened this issue Jan 4, 2012 · 6 comments
Open

webui security bug #128

arcusfelis opened this issue Jan 4, 2012 · 6 comments

Comments

@arcusfelis
Copy link
Contributor

I found few errors in the etorrent_cowboy_handler.erl file. I can get access to any file on the erlang node throw cowboy:

 telnet 127.0.0.1 8080

GET /../../../../../log/console.log HTTP/1.0
Host: 127.0.0.1

And mimetypes:filename returns undefined (not unknown).

2> mimetypes:filename("test.hrl").
undefined
@jlouis
Copy link
Owner

jlouis commented Jan 4, 2012

Can you with this patch? It attempts being a bit more limiting to what you can put in, but my PropEr test might not be tight enough.

https://github.com/jlouis/etorrent/tree/jlouis-security-sanity

Thanks for reporting it. I'd rather go for something which is not a white-list if possible.

@jlouis
Copy link
Owner

jlouis commented Jan 4, 2012

I'd look into the mimetypes error later today perhaps :)

@arcusfelis
Copy link
Contributor Author

I think the part of the system, which handles requests to the real files must be implemented in the cowboy application. It will be more elegant way to solving this problem.

@jlouis
Copy link
Owner

jlouis commented Jan 4, 2012

I agree. @klaar has been working on writing a static file handler for Cowboy I think, so I can ask him about what he has done there and adopt it.

@arcusfelis
Copy link
Contributor Author

I found it:
https://github.com/klaar/cowboy_static.git

@ghost
Copy link

ghost commented Jan 4, 2012

We just merged a simpler version of that into the master branch of extend/cowboy, batteries included!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants