Re:An XSS on Facebook via PNGs and Wonky Content Types
by baby on Wednesday March 16, 2016 @11:14PM
(#11302360)
> 1. Don't serve user supplied content from a subdomain of your main site. Facebook fixed this by removing the redirect from photo.facebook.com to their CDN, so now user content comes from *.akamaihd.net.
I don't see that as an issue. As long as you don't allow for wildcard extensions on your server it won't return a wrong content-type in this kind of situation. I wonder why it's even possible that you can change the .jpg to .html :| I'm pretty sure this is disabled by default in apache.
> don't serve it from your servers with a different content type.
so yeah, the problem of the content-type comes from the fact that you can manipulate the extension as you wish once uploaded.
I don't see that as an issue. As long as you don't allow for wildcard extensions on your server it won't return a wrong content-type in this kind of situation. I wonder why it's even possible that you can change the .jpg to .html :| I'm pretty sure this is disabled by default in apache.
> don't serve it from your servers with a different content type.
so yeah, the problem of the content-type comes from the fact that you can manipulate the extension as you wish once uploaded.