TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bypassing CSP using polyglot JPEGs

43 pointsby inianover 8 years ago

5 comments

ubernostrumover 8 years ago
While this is a neat technical trick, it does appear to require that an attacker also be able to inject a script tag with a specific source of the attacker's choice. Which feels like cheating, kind of; for a web application that's pretty much the equivalent of "well, assume you already have root on the victim's machine, once you have that you can do THIS".
评论 #13086939 未加载
chiasover 8 years ago
Serious question: do any &quot;real&quot; web applications which allow you to upload images not re-encode the image before saving it to disk? I thought this was industry standard.<p>There&#x27;s a whole host of issues associated with not doing this, including potentially unwanted exif data, and e.g. just cat&#x27;ing a jpeg with a rar file and using the image host as an arbitrary file host, etc.
评论 #13081782 未加载
评论 #13083149 未加载
woliveirajrover 8 years ago
Well, nowadays, you just can&#x27;t trust a file by its extension, you shouldn&#x27;t trust it magic header too.
评论 #13081375 未加载
rebelwebmasterover 8 years ago
Funny enough, this is fixed in Firefox 51 already (shipping in January). <a href="https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1288361" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1288361</a>
Qwertystopover 8 years ago
Huh. Why do JPEG files support comments?<p>(I mean, that&#x27;s what this comes down to, right? Both formats support comments, and starting a comment in one is a valid start for the other, so you can interleave them and do whatever you like.)
评论 #13082767 未加载
评论 #13082743 未加载