-
Notifications
You must be signed in to change notification settings - Fork 18
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
Issue when scpd_url contains something strange #9
Comments
Hi, thank you for your issue. Does 1be5dab fix this? Please upgrade
|
Yes, the commit seems to fix the immediate issue. But, in general it may be a somewhat bad idea. Normally, services would not be allowed to issue a url outside of base_url. but if say base_url = http://192.168.0.1, but ssdp_url is http://google.com/some_url - traffic would go to google.com Then we may pass another scheme, like file://. I think we need a bit more of whitelisting here. |
Ah yes, I think I see what you mean. I'm currently adding some more checks. |
I pushed some changes in eb798af which should (hopefully) fix these issues. |
There is still an issue with ports.
Also, scheme may go up from http to https, but prob not downwards. Default I think makes sense to stay at what it is now - changing ports allowed, but not hostname or scheme downgrade. Not sure if this will follow standards, tho. Also, I think it would make sense to reconstruct scpd_url from base components instead of allowing it to stay the same to avoid issues with different url parsing used (e.g. scheme://username:password@host:port/path...). E.g. these slides: https://www.slideshare.net/codeblue_jp/a-new-era-of-ssrf-exploiting-url-parser-in-trending-programming-languages-by-orange-tsai |
Sounds good. I will start implementing these as soon as I get back to the PC 😃. |
The library will break in different ways when scpd_url contains something other than url part beginning with /.
In my specific example, a router prefixes the url with full url.
Specifically, in this line:
upnpy/upnpy/ssdp/SSDPDevice.py
Line 293 in 9b5e005
If you have
base_url == http://[router_ip]:1900
andscpd_url = http://[router_ip]:1900/some.xml
- you will get a name resolution error.Second error from here: #7 may be related.
The text was updated successfully, but these errors were encountered: