"RokuKevin" wrote:
It would also enable internet sites to more easily create cross-site scripting attacks on the Roku.
--Kevin
Hi Kevin, thanks for responding.
Right now, the Roku responds to ECP commands from any address, local or remote. I have written javascript that can scan for Rokus on the local network and subsequently control them. The only thing I can't access directly (in the current firmware) is the channel list. I appreciate the need for security against scripted attacks, so if there's an alternative that would enable a pure js solution while maintaining security, I'm completely open to it.
I'm sure you may be wondering how I can pick up the Roku addresses from js. Here's what I'm doing to scan for local Roku boxes:
In my remote app, I create a hidden iframe with a src =
http://w.x.y.z:8060/query/apps and initialize a boolean to false. Then I start a timer with a 750ms timeout. If/when the iframe loads, the boolean is set to true. Then, when the timeout occurs, if the variable is true, then there is probably a Roku at that address and it is added to a list of available units to control. Then the last octet variable is incremented by 1 and process repeats. Scanning through the entire last octet takes, at most, slightly more than 3 minutes, and there is a field for the user to indicate how many Rokus they own, so the script will stop looking if it finds them all. I also ask for the first three octets. On my network of two rokus, one wireless and one wired, using an iphone and chrome (both wireless) this process generally only takes 10 seconds or so.
I've thought this through a bit and obviously, a bad guy could silently scan every possible ip without prompting for any user input at all, and simply record its place in a cookie when the page is left, then pickup the scan anytime the evil page is loaded. If he made the reasonable guess that most home networks are of the 192.168 variety, and most of them have a 0, 1, or 2 for the third octet, it wouldn't take near as long as simply starting at 1.1.1.1 and working up, to detect Rokus. And once he has the address, he can then send any set of commands he'd like, since the Roku will happily process a command from any non-authenticated client.
After seeing the new SDK features, I'd planned to create a companion channel for remoku that would incorporate a simple webserver to request the channel list internally, then send it on to the remote app without restriction, which would remove my need for a CORS policy. Unfortunately, I couldn't get the web server example to run (
debugger details posted here). When it's working, I have some other things planned for the companion channel as well, like serving the whole remote from it, so users could install from the channel store and then be presented with a screen on the tv like "Now browse to
http://192.168.1.8:8888/ to start using Remoku".
So, at least until I can serve content from the Roku myself, I'm still stuck for a solution to my original problem, the channel list being unavailable to js. Any thoughts?
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com