Hacker News new | ask | show | jobs
by lazyjones 4399 days ago
Nice one; I gave up trying to solve the last with the http-only google.com/jsapi and hosted my own with https, but then it occurred to me that it's even more trivial than I thought!

Checking our stuff for this mistake now ...

4 comments

I used "//" to get around the http regex (but this requires using an https host as you mentioned), is there another way to get around the regex?
Adding a space just before the URL works just as well.
Spoiler: RaNDoM cApS
//www.google.com/jsapi?callback=alert
data:,alert('hi')
Use upper-case characters
i think ftp:// works too

EDIT: no, it doesn't :D

SPOILER: You need a way to defeat the regex (see other comments here). Then think about what the "foo" actually does (and read the error console).
What's the trivial solution to this? I also wound up hosting the malicious file on my personal server...
data-uris also work: #data:text/javascript,alert('pwn')
That's what I used too. Hosting scripts is far too much like hard work...
There are apparently easier ways, but I just chucked an alert(); in my Dropbox public folder, did an //dl.dropboxusercontent.com/u/14XXX/xss.js as they serve both http and https.
I put a small gist up and hotlinked through githack.com
gist.github.com serves https, so you can use it whenever you need something sent over https.