Re:If your code accepts URIs as input, filter out “file://”
by l_zzie on Monday September 12, 2016 @03:27PM
(#12482866)
Importantly, fetching DNS twice (once to check, another to download) is an incomplete solution, since DNS responses can change (cf "DNS rebinding").
Re:If your code accepts URIs as input, filter out “file://”
by yuliyp on Monday September 12, 2016 @01:08PM
(#12481507)
And be sure to check it again if there's a redirect. Don't let your URL handling library do this. Alternately send all your traffic through a proxy that can't talk into your network.
Re:If your code accepts URIs as input, filter out “file://”
by captn3m0 on Monday September 12, 2016 @04:59PM
(#12483627)
I remember this was exactly how a readability service (readability or instapaper or something similar, can't recall now) was attacked. The service allowed you to fetch internal urls and presented them formatted on your phone. A mixture of file:// and internal web urls allowed complete takeover.
Really, there are so many gotchas around fetching user-supplied URLs that it's scary.